/* Letora additions to the supplied SB Admin 2 theme. */
:root {
    --bs-primary: #4e73df;
    --bs-primary-rgb: 78, 115, 223;
    --bs-success: #1cc88a;
    --bs-success-rgb: 28, 200, 138;
    --bs-info: #36b9cc;
    --bs-info-rgb: 54, 185, 204;
    --bs-warning: #f6c23e;
    --bs-warning-rgb: 246, 194, 62;
    --bs-body-color: #858796;
    --bs-body-bg: #f8f9fc;
    --bs-border-color: #e3e6f0;
    --bs-border-radius: .35rem;
}
body { font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; }
h1, h2, h3, h4, h5, h6 { font-weight: 400; }
a { color: #4e73df; }
a:hover { color: #224abe; }
.topbar .nav-item .nav-link:focus-visible, .sidebar .nav-item .nav-link:focus-visible,
.sidebar #sidebarToggle:focus-visible, .topbar #sidebarToggleTop:focus-visible { outline: 2px solid #4e73df; outline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid #4e73df; outline-offset: 3px; }
.btn-primary {
    --bs-btn-bg: #4e73df; --bs-btn-border-color: #4e73df;
    --bs-btn-hover-bg: #2e59d9; --bs-btn-hover-border-color: #2653d4;
    --bs-btn-active-bg: #2653d4; --bs-btn-active-border-color: #244ec9;
    --bs-btn-disabled-bg: #4e73df; --bs-btn-disabled-border-color: #4e73df;
}
.card { --bs-card-bg: #fff; border: 1px solid #e3e6f0; border-radius: .35rem; }
.card-body { padding: 1.25rem; }
.table { --bs-table-bg: #fff; --bs-table-border-color: #e3e6f0; }
.card-header { background-color: #f8f9fc; border-bottom: 1px solid #e3e6f0; padding: .75rem 1.25rem; }
.shadow { box-shadow: 0 .15rem 1.75rem 0 rgb(58 59 69 / 15%) !important; }
.form-control, .form-select { background-color: #fff; color: #6e707e; border-color: #d1d3e2; }
.form-control:focus, .form-select:focus { border-color: #bac8f3; box-shadow: 0 0 0 .2rem rgb(78 115 223 / 25%); }
form.user .form-control-user { font-size: .8rem; border-radius: 10rem; padding: .85rem 1rem; min-height: 50px; }
form.user .btn-user { font-size: .8rem; border-radius: 10rem; padding: .75rem 1rem; }
.form-label { font-size: .85rem; color: #5a5c69; }
.form-check-input:checked { background-color: #4e73df; border-color: #4e73df; }
.password-field { position: relative; }
.password-field input { padding-right: 4.5rem !important; }
.password-field .is-invalid { background-image: none; }
.password-toggle { position: absolute; top: .8rem; right: 1rem; border: 0; background: transparent; color: #4e73df; padding: .15rem; font-size: .8rem; }
.auth-page { background: #fff; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
html[data-theme="dark"] .auth-page { background: #101010; color: #f5f5f5; }
html[data-theme="dark"] .auth-page .text-gray-900 { color: #f5f5f5 !important; }
html[data-theme="dark"] .auth-page .auth-footer { color: #b7b7b7; }
html[data-theme="dark"] .auth-page .card { background-color: #1f2937; border-color: #475569; color: #f5f5f5; }
html[data-theme="dark"] .auth-page .card .text-muted,
html[data-theme="dark"] .auth-page .card ol,
html[data-theme="dark"] .auth-page .card li { color: #e2e8f0 !important; }
html[data-theme="dark"] .auth-page .card .text-primary { color: #93c5fd !important; }
html[data-theme="dark"] .auth-page .form-text,
html[data-theme="dark"] .auth-page .form-check-label,
html[data-theme="dark"] .auth-page .text-muted,
html[data-theme="dark"] .auth-page .card .text-muted,
html[data-theme="dark"] .auth-page .card ol,
html[data-theme="dark"] .auth-page .card li,
html[data-theme="dark"] .auth-page .card span.text-muted { color: #e2e8f0 !important; }
html[data-theme="dark"] .auth-page .alert-info,
html[data-theme="dark"] .auth-page .alert-secondary { color: #e2e8f0 !important; }
html[data-theme="dark"] .auth-page .alert-info { background: #17324a; border-color: #3b82f6; }
html[data-theme="dark"] .auth-page .alert-secondary { background: #1f2937; border-color: #64748b; }
html[data-theme="dark"] .auth-page .cf-turnstile { color-scheme: light; }
html[data-theme="dark"] .auth-page .form-check-label a { color: #93c5fd !important; }
html[data-theme="dark"] .auth-page .password-toggle { color: #93c5fd; }
html[data-theme="dark"] .auth-page .cookie-notice { background: #1f2937; color: #f8fafc; border-color: #64748b; }
html[data-theme="dark"] .auth-page .cookie-notice p { color: #cbd5e1; }
html[data-theme="dark"] .auth-page .cookie-notice .btn { background: #f28c28; color: #102a43; border-color: #f28c28; }
.auth-shell { width: 100%; max-width: 430px; padding: 2rem 1.5rem; }
.error-shell { max-width: 620px; padding-block: 4rem; }
.error-icon-internal { margin: 0 auto 1rem; width: 4rem; height: 4rem; border-radius: 1.2rem; background: #fff4e5; color: #f28c28; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.auth-brand { display: block; width: 190px; margin: 0 auto 1rem; }
.auth-brand img { display: block; width: 100%; height: auto; }
html[data-theme="dark"] .auth-brand img { content: url('/assets/letora-logo-dark.webp'); filter: brightness(0) invert(1); }
.auth-footer { text-align: center; font-size: .75rem; margin-top: 3rem; color: #858796; }
.google-mark { flex: 0 0 auto; display: inline-block; }
.auth-shell hr { border-color: #e3e6f0; opacity: 1; margin: 1.5rem 0 1rem; }
.sidebar { flex-shrink: 0; padding-left: 0; margin-bottom: 0; }
.sidebar-logo { width: 48px; height: 48px; object-fit: contain; border-radius: .35rem; content: url('/assets/letora-logo-dark.webp'); filter: brightness(0) invert(1); }
.sidebar button.nav-link { font-family: inherit; text-align: center !important; }
.sidebar button.nav-link.collapsed::after { content: '\f105'; font-family: 'Font Awesome 5 Free'; font-weight: 900; float: right; }
.sidebar button.nav-link:not(.collapsed)::after { content: '\f107'; font-family: 'Font Awesome 5 Free'; font-weight: 900; float: right; }
.topbar { position: sticky; top: 0; z-index: 1030; padding: .5rem 1rem; }
.modal-content { background-color: #fff; }
.sidebar.toggled button.nav-link::after { display: none; }
.profile-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: #eaecf4; color: #858796; display: inline-flex; align-items: center; justify-content: center; }
.dropdown-menu { background-color: #fff; border-color: #e3e6f0; }
.dashboard-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; }
@media (min-width: 768px) {
    .sidebar button.nav-link { text-align: left !important; }
    .sidebar.toggled button.nav-link { text-align: center !important; }
}
@media (max-width: 767.98px) {
    .sidebar button.nav-link::after { display: none; }
}
@media (max-width: 575.98px) {
    .auth-shell { padding-top: 1rem; }
    .auth-brand { width: 155px; margin-bottom: .75rem; }
    .sidebar button.nav-link::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.table thead { --bs-table-bg: #f8f9fc; color: #6e707e; }
.table > :not(caption) > * > * { padding: .85rem .75rem; }
.table tbody tr:last-child > * { border-bottom-width: 0; }
.selected-document { border-left: 4px solid #4e73df; background: #f0fff7; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.action-row .btn, .action-menu > summary { min-width: 2.15rem; line-height: 1.25; }
.action-menu { display: inline-block; vertical-align: middle; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] { position: relative; z-index: 2; }
.action-menu form { min-width: 220px; padding: .75rem; background: #fff; border: 1px solid #e3e6f0; border-radius: .35rem; box-shadow: 0 .35rem 1rem rgb(58 59 69 / 15%); }
.print-page { max-width: 900px; }
.toast-container { z-index: 1090; }
@media print {
    body { background: white !important; color: #222; font-size: 11pt; }
    .no-print, .toast-container { display: none !important; }
    .print-page { max-width: none; margin: 0; padding: 0 !important; }
    .print-document { padding: 0 !important; }
    .print-document table { break-inside: avoid; }
}
.organisation-switch { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767.98px) { .organisation-switch { max-width: 110px; } .topbar { padding-left: .5rem; padding-right: .5rem; } }
.document-list { max-height: 34rem; overflow-y: auto; }
@media print {
    .admin-page #accordionSidebar, .admin-page .topbar, .admin-page .sticky-footer,
    .admin-page form, .admin-page details, .admin-page nav { display: none !important; }
    .admin-page #content-wrapper { width: 100%; background: white; }
    .admin-page .shadow { box-shadow: none !important; }
    .admin-page .table-responsive { overflow: visible; }
}

.document-list { max-height: 38rem; overflow-y: auto; }

.thermal-receipt { width:80mm; max-width:100%; margin:0 auto; padding:4mm; font-family:monospace; font-size:11px; color:#111; }
.thermal-receipt.thermal-58 { width:58mm; font-size:10px; }
.thermal-receipt td { padding:2mm 0; }
.receipt-reference { overflow-wrap:anywhere; }
.thermal-preview-stage { min-height: 34rem; padding: 2rem; background: #555a5e; overflow: auto; display: flex; align-items: flex-start; justify-content: center; }
.thermal-preview-stage .thermal-receipt { flex: 0 0 auto; box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,.2); }
.thermal-preview-empty { align-items: center; flex-direction: column; justify-content: center; color: #fff; text-align: center; gap: .35rem; }
.thermal-preview-empty i { color: #fff; }
.thermal-preview-nonreceipt { margin: auto; color: #fff; text-align: center; }
@media print { body.thermal-print .print-page { width:auto; padding:0 !important; } .thermal-receipt { padding:2mm; } }
.report-chart { position:relative; height:320px; }
.admin-page .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-page .table-responsive > .table { min-width: 680px; }
@media (max-width: 767.98px) {
    .admin-page .table-responsive > .table { min-width: 640px; }
    .admin-page .modal-dialog { max-width: calc(100vw - 1rem); margin: .5rem; }
    .admin-page .modal-body { overflow-x: hidden; }
}
 .cookie-notice { position: fixed; z-index: 1050; left: 1rem; right: 1rem; bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid #d7dce5; border-radius: .5rem; box-shadow: 0 .5rem 1.5rem rgba(31,45,65,.16); }
 .cookie-notice p { color: #687386; }
 @media (max-width: 575.98px) { .cookie-notice { align-items: flex-start; flex-direction: column; } }

/* Keep authenticated screens on the same theme contract as the public site. */
body.admin-page[data-theme="dark"], html[data-theme="dark"] body.admin-page {
    --bs-body-color: #e7edf5;
    --bs-body-bg: #111827;
    --bs-border-color: #334155;
    background: #111827;
    color: #e7edf5;
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sticky-footer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { background-color: #1f2937; color: #e7edf5; border-color: #475569; }
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .table thead { background-color: #273449; color: #dbeafe; }
html[data-theme="dark"] .table { --bs-table-bg: #1f2937; --bs-table-color: #e7edf5; --bs-table-border-color: #475569; }
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .copyright,
html[data-theme="dark"] .dropdown-item { color: #dbeafe !important; }
html[data-theme="dark"] a { color: #93c5fd; }
html[data-theme="dark"] .dropdown-item:hover { background-color: #334155; color: #fff !important; }
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: #475569; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .cookie-notice { background: #1f2937; color: #e7edf5; border-color: #475569; }
html[data-theme="dark"] .cookie-notice p { color: #cbd5e1; }
html[data-theme="dark"] .cookie-notice .btn { color: #102a43; }
html[data-theme="dark"] .toast { background-color: #1f2937 !important; color: #f8fafc; border-color: #64748b !important; }
html[data-theme="dark"] .toast-header { background-color: #273449; color: #f8fafc; border-bottom-color: #475569; }
html[data-theme="dark"] .toast-body { color: #e2e8f0; }
html[data-theme="dark"] .toast .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .toast .btn-close { opacity: 1; }
.app-theme-picker { position: relative; }
.auth-theme-picker { position: fixed; top: 1rem; left: 1rem; z-index: 1100; }
.app-theme-picker .theme-toggle { border: 0; background: transparent; color: #102a43; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer; }
html[data-theme="dark"] .app-theme-picker .theme-toggle { color: #f8fafc; }
.app-theme-picker .theme-toggle:hover, .app-theme-picker .theme-toggle:focus-visible { background: rgba(78,115,223,.12); }
.app-theme-picker .theme-icon { display: block; position: relative; width: 1.2rem; height: 1.2rem; color: currentColor; }
.app-theme-picker .theme-icon::before, .app-theme-picker .theme-icon::after { display: none !important; }
.app-theme-picker .theme-icon i { display: block; line-height: 1.2rem; font-size: 1.05rem; }
.app-theme-picker .theme-icon::before, .app-theme-picker .theme-icon::after { content: ""; position: absolute; display: block; }
.app-theme-picker .theme-icon[data-theme-icon="dark"]::before { inset: .12rem; border: 2px solid currentColor; border-radius: 50%; }
.app-theme-picker .theme-icon[data-theme-icon="dark"]::after { width: .58rem; height: .58rem; top: -.08rem; right: -.08rem; border-radius: 50%; background: #fff; }
html[data-theme="dark"] .app-theme-picker .theme-icon[data-theme-icon="dark"]::after { background: #1f2937; }
.app-theme-picker .theme-icon[data-theme-icon="light"]::before { inset: .28rem; border: 2px solid currentColor; border-radius: 50%; box-shadow: 0 -.42rem 0 -.08rem currentColor, 0 .42rem 0 -.08rem currentColor, .42rem 0 0 -.08rem currentColor, -.42rem 0 0 -.08rem currentColor, .3rem .3rem 0 -.08rem currentColor, -.3rem -.3rem 0 -.08rem currentColor, .3rem -.3rem 0 -.08rem currentColor, -.3rem .3rem 0 -.08rem currentColor; }
.app-theme-picker .theme-icon[data-theme-icon="system"]::before { left: .08rem; right: .08rem; top: .12rem; height: .72rem; border: 2px solid currentColor; border-radius: .12rem; }
.app-theme-picker .theme-icon[data-theme-icon="system"]::after { left: .32rem; bottom: .08rem; width: .56rem; height: 2px; border-radius: 2px; background: currentColor; box-shadow: -.18rem .18rem 0 -.02rem currentColor, .18rem .18rem 0 -.02rem currentColor; }
.app-theme-picker .theme-menu { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 1100; min-width: 9rem; padding: .35rem; border: 1px solid #d7dce5; border-radius: .7rem; background: #fff; box-shadow: 0 .8rem 2rem rgba(16,42,67,.18); }
.app-theme-picker .theme-menu button { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 0; border-radius: .4rem; background: transparent; color: #102a43; text-align: left; font-weight: 700; cursor: pointer; }
.app-theme-picker .theme-menu button i { width: 1rem; text-align: center; font-size: .85rem; }
.app-theme-picker .theme-menu button:hover, .app-theme-picker .theme-menu button:focus-visible { background: #f0f4f8; }
html[data-theme="dark"] .app-theme-picker .theme-menu { background: #181818; border-color: #3b3b3b; }
html[data-theme="dark"] .app-theme-picker .theme-menu button { color: #f5f5f5; }
html[data-theme="dark"] .app-theme-picker .theme-menu button:hover, html[data-theme="dark"] .app-theme-picker .theme-menu button:focus-visible { background: #2a2a2a; }
