/* Reference-inspired light navigation; logical spacing preserves RTL. */
.app-layout{display:block;padding-inline-start:296px;min-height:100dvh}
.app-layout>.app-sidebar{position:fixed;inset-block:16px;inset-inline-start:16px;width:264px;height:calc(100dvh - 32px);padding:28px 18px;gap:30px;background:#fff;color:#20242c;border:1px solid #edf0ec;border-radius:24px;box-shadow:0 8px 30px #17251c05;overflow-y:auto;overscroll-behavior:contain;z-index:40;scrollbar-width:thin;scrollbar-color:#d9dfd5 transparent}
.app-sidebar .sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 6px}
.app-sidebar .brand{font-size:1.2rem;gap:12px;line-height:1.6;color:#171c22}
.app-sidebar .mark{flex-shrink:0;width:46px;height:46px;border-radius:14px;background:#b9eb8b;color:#203c23;font-size:28px}
.app-sidebar .sidebar-nav{display:grid;gap:10px;overflow:visible;padding:0}
.app-sidebar .nav-caption{margin:0 12px 6px;color:#626971;font-size:.72rem;font-weight:600;line-height:1.8}
.app-sidebar .sidebar-nav a,.app-sidebar summary,.app-sidebar .sidebar-foot a{display:flex;align-items:center;gap:12px;padding:12px;border:0;border-radius:12px;min-height:46px;font-size:.88rem;text-decoration:none;color:#292e35;line-height:1.65}
.app-sidebar summary{list-style:none;cursor:pointer;font-weight:500;user-select:none}
.app-sidebar summary::-webkit-details-marker{display:none}
.app-sidebar .sidebar-nav a:hover,.app-sidebar summary:hover,.app-sidebar .sidebar-foot a:hover{background:#f4f7f0;color:#17251b}
.app-sidebar :is(a,summary,button):focus-visible{outline:2px solid #548034;outline-offset:3px}
.app-sidebar .nav-group{margin:0;border:0;border-radius:12px;background:transparent}
.app-sidebar .nav-group[open]>summary{color:#18251c}
.app-sidebar svg,.sidebar-toggle svg{width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.app-sidebar .nav-chevron{margin-inline-start:auto;width:17px;transition:transform .18s}
.app-sidebar details[open]>summary .nav-chevron{transform:rotate(180deg)}
.app-sidebar .nav-children{display:grid;gap:5px;margin:5px 0 10px;margin-inline-start:22px;padding:0;padding-inline-start:12px;border-inline-start:1px solid #e1e5dd}
.app-sidebar details:not([open])>.nav-children{display:none}
.app-sidebar .nav-children a{position:relative;padding:9px 11px;min-height:40px;font-size:.83rem;color:#41474d}
.app-sidebar .nav-children a::before{content:"";position:absolute;inset-inline-start:-12px;inset-block-start:50%;width:8px;border-top:1px solid #e1e5dd}
.app-sidebar .nav-dot{display:none}
.app-sidebar .sidebar-nav a.selected{color:#23351c;border:0;background:#eaffd5;font-weight:600}
.app-sidebar .sidebar-nav a.selected:hover{background:#def7c3}
.app-sidebar .sidebar-foot{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:auto;padding-top:20px;border-top:1px solid #edf0e9;font-size:.83rem}
.sidebar-toggle,.sidebar-close,.sidebar-backdrop{display:none}
.app-layout .topbar-identity{display:flex;align-items:center;gap:12px;min-width:0}
.app-layout .topbar .identity{max-width:none}
.app-layout .metric strong{max-width:100%;overflow-x:auto}
input[data-number]{direction:ltr;text-align:start;font-variant-numeric:tabular-nums}
.language-picker{position:relative;flex-shrink:0}
.language-trigger{display:flex;align-items:center;justify-content:center;gap:7px;direction:ltr;min-width:76px;height:54px;padding:0 15px;border:1px solid var(--line);border-radius:999px;background:#fff;color:#344258;font-size:.88rem;font-weight:600;line-height:1}
.language-trigger svg,.language-option svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.language-trigger:hover,.language-trigger[aria-expanded="true"]{border-color:#bbcfc9;background:#fff}
.language-menu{position:absolute;inset-block-start:calc(100% + 10px);inset-inline-end:0;z-index:50;width:200px;max-width:calc(100vw - 32px);padding:8px 10px;border:1px solid var(--line);border-radius:28px;background:#fff;box-shadow:0 12px 32px #102f3812}
.language-menu[hidden]{display:none}
.language-option{display:flex;align-items:center;justify-content:space-between;gap:16px;direction:rtl;width:100%;min-height:50px;padding:10px 12px;border:0;border-radius:18px;background:transparent;color:#263349;text-align:start;font-size:1rem;line-height:1.5}
.language-option[aria-checked="true"]{color:#096b62;font-weight:700}
.language-option svg{width:18px;height:18px}
.language-option:hover,.language-option:focus-visible{background:#edf6f3}
.language-trigger:focus-visible,.language-option:focus-visible{outline:2px solid #096b62;outline-offset:3px}
.login-area>.language-picker{position:absolute;inset-block-start:30px;inset-inline-end:30px}
@media(max-width:900px){
  .app-layout{padding-inline-start:0}
  .app-layout>.app-sidebar{inset-block:10px;inset-inline-start:10px;height:calc(100dvh - 20px);width:min(290px,86vw);transform:translateX(calc(100% + 12px));visibility:hidden;transition:transform .2s,visibility .2s}
  .app-layout.sidebar-open>.app-sidebar{transform:translateX(0);visibility:visible}
  .sidebar-toggle,.sidebar-close{display:inline-flex;align-items:center;justify-content:center;width:42px;min-width:42px;height:42px;border:1px solid var(--line);border-radius:9px}
  .sidebar-close{color:#353d32;background:#f6f8f3;border-color:#e1e7db;font-size:1.6rem;flex-shrink:0}
  .app-sidebar .sidebar-heading{padding:0}
  .sidebar-open>.sidebar-backdrop{display:block;position:fixed;inset:0;background:#0b202b88;z-index:35;backdrop-filter:blur(2px)}
  .app-layout .topbar{gap:10px}
}
@media(max-width:700px){.login-area>.language-picker{inset-block-start:22px;inset-inline-end:24px}.language-trigger{height:46px;min-width:72px}}
@media(prefers-reduced-motion:reduce){.app-layout>.app-sidebar,.app-sidebar .nav-chevron{transition:none}}
@media print{.app-layout{padding:0;display:block}.app-sidebar,.sidebar-backdrop,.sidebar-toggle{display:none!important}}
/* Sun/moon switch: physical left/right positions intentionally match the reference. */
.app-sidebar .sidebar-foot a{flex:1;min-width:0;gap:7px;padding:8px 2px;font-size:.78rem}
.app-sidebar .theme-control{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:60px;min-height:44px;padding:0;border-radius:999px;color:inherit}
.theme-track{position:relative;display:block;direction:ltr;width:60px;height:32px;flex-shrink:0;border-radius:999px;background:#171a19;color:#fff}
.app-sidebar .theme-track svg{position:absolute;top:7px;width:18px;height:18px;stroke-width:2}
.theme-track .theme-sun{left:6px}.theme-track .theme-moon{right:6px;opacity:0}
.theme-track .theme-moon path{fill:currentColor;stroke:none}
.theme-thumb{position:absolute;top:4px;left:32px;width:24px;height:24px;border-radius:50%;background:#fff;transition:transform .22s ease}
.theme-control[aria-checked="true"] .theme-track{background:#f7f9f6;color:#111612}
.theme-control[aria-checked="true"] .theme-thumb{background:#111612;transform:translateX(-28px)}
.theme-control[aria-checked="true"] .theme-sun{opacity:0}
.theme-control[aria-checked="true"] .theme-moon{opacity:1}
@media(prefers-reduced-motion:reduce){.theme-thumb{transition:none}}
/* Dark colors apply only on screen: printed reports retain the light palette. */
@media screen{
 :root[data-theme="dark"]{color-scheme:dark;color:#e3e9e5;background:#111714;--ink:#e3e9e5;--teal:#8ed9bd;--muted:#a6b5ad;--line:#36443c;--gold:#dfbb78}
 [data-theme="dark"] :is(.topbar,.panel,.metric,.quick-card,.table-wrap,.empty-state,.secondary,.language-menu,.language-trigger,.skip,.delivery code){background:#1c2520;color:#e3e9e5;border-color:var(--line);box-shadow:none}
 [data-theme="dark"] :is(input,select,textarea,.identity-panel input[type=file]){background:#151e18;color:#e3e9e5;border-color:#4c5e52}
 [data-theme="dark"] .identity-panel input[type=file]::file-selector-button{background:#2b3b30;color:#c6e7d5}
 [data-theme="dark"] :is(th,.metric-icon){background:#26342b;color:#b6c9be}
 [data-theme="dark"] :is(td,.policy-row,.pending-grid){border-color:var(--line)}
 [data-theme="dark"] .primary{background:#9cdbb6;color:#14261b}
 [data-theme="dark"] .primary:hover{background:#b7eacb}
 [data-theme="dark"] .secondary:hover{background:#2c3c31}
 [data-theme="dark"] :is(.notice,.badge.active){background:#203b30;color:#afe5ca;border-color:#416552}
 [data-theme="dark"] :is(.notice.error,.danger,input[aria-invalid=true]){background:#402624;color:#ffbeb4;border-color:#81514b}
 [data-theme="dark"] :is(.notice.warning,.badge.pending,.dev-strip,.accounting){background:#342e20;color:#e9d2a3;border-color:#655735}
 [data-theme="dark"] .accounting p{color:#d9c7a5}
 [data-theme="dark"] .accounting-symbol{background:#4c4029;color:#efcf91}
 [data-theme="dark"] .login-area{background:#151e18}
 [data-theme="dark"] .login-story{background:#1c3027}
 [data-theme="dark"] .language-option{color:#e3e9e5}
 [data-theme="dark"] .language-option[aria-checked="true"]{color:#a9e3c5}
 [data-theme="dark"] :is(.language-option:hover,.language-option:focus-visible,.language-trigger:hover,.language-trigger[aria-expanded="true"]){background:#2b3b30}
 [data-theme="dark"] .app-layout>.app-sidebar{background:#1b231e;color:#e3e9e5;border-color:#303c33;box-shadow:none}
 [data-theme="dark"] .app-sidebar :is(.brand,summary,.sidebar-nav a,.sidebar-foot a){color:#e3e9e5}
 [data-theme="dark"] .app-sidebar .nav-caption{color:#a6b5ad}
 [data-theme="dark"] .app-sidebar :is(summary:hover,.sidebar-nav a:hover,.sidebar-foot a:hover){background:#2b382e;color:#eff8ed}
 [data-theme="dark"] .app-sidebar .sidebar-nav a.selected{background:#354b2a;color:#d9f7be}
 [data-theme="dark"] .app-sidebar :is(.nav-children,.nav-children a::before,.sidebar-foot){border-color:#3b493e}
 [data-theme="dark"] .sidebar-close{color:#e3e9e5;background:#29372d;border-color:#46554a}
 [data-theme="dark"] :is(.sidebar-toggle,.language-trigger,.language-option,.app-sidebar a,.app-sidebar summary,.app-sidebar button):focus-visible{outline-color:#b9eb8b}
 [data-theme="dark"] .ledger-content .report-sheet{background:#1c2520;color:#e3e9e5;border-color:#536259;box-shadow:none}
 [data-theme="dark"] .ledger-content .report-table caption{background:#36463b;color:#ecf3ee;border-color:#66776b}
 [data-theme="dark"] .ledger-content .report-table :is(th,tfoot){background:#2e3c32;color:#e3e9e5}
 [data-theme="dark"] .ledger-content .report-table :is(th,td){border-color:#58695d}
 [data-theme="dark"] .ledger-content .report-table tbody tr:nth-child(even){background:#222e26}
 [data-theme="dark"] .ledger-content .report-table tbody tr:hover{background:#2e3f33}
 [data-theme="dark"] :is(.report-header,.report-note){border-color:#66776b}
 [data-theme="dark"] .ledger-content .negative{color:#ffb4aa}
 [data-theme="dark"] .ledger-content .positive{color:#9ee0be}
}
