:root{
  --bg:#f5f7f6;--surface:#fff;--surface-2:#f0f5f2;--text:#17211b;--muted:#6f7d75;
  --primary:#0f6b45;--primary-dark:#0a4f33;--accent:#f28a2e;--border:#dfe7e2;
  --danger:#c0392b;--success:#18794e;--shadow:0 12px 35px rgba(17,38,27,.08);--radius:16px;
}
*{box-sizing:border-box}html{overflow-x:hidden;scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text);overflow-x:hidden}button,input,select{font:inherit}.app{display:flex;min-height:100vh}
.sidebar{width:220px;background:linear-gradient(180deg,#0b4e34 0%,#083b29 100%);color:#fff;padding:22px 14px;position:fixed;inset:0 auto 0 0;z-index:20;box-shadow:8px 0 28px rgba(4,35,22,.12)}
.logo{font-size:22px;font-weight:850;padding:8px 12px 28px;letter-spacing:-.4px}.logo span{font-weight:500;display:block;font-size:10px;letter-spacing:2.2px;text-transform:uppercase;opacity:.7;margin-top:5px}.sidebar nav a,.side-bottom a,.logout-link{display:flex;align-items:center;gap:10px;color:#dcebe3;text-decoration:none;padding:12px 14px;border-radius:11px;margin:5px 0;font-weight:600;transition:.2s}.sidebar nav a:hover,.side-bottom a:hover,.logout-link:hover{background:rgba(255,255,255,.1);color:#fff;transform:translateX(2px)}.side-bottom{position:absolute;bottom:18px;left:14px;right:14px}.user-badge{font-size:.8rem;color:#b9d0c3;padding:11px 12px;border-top:1px solid rgba(255,255,255,.12);margin-top:12px}.branch-badge{margin:.35rem 0 0;font-size:.86rem}.branch-badge strong{font-weight:750;color:#fff}
.main{margin-left:220px;width:calc(100% - 220px);min-width:0;padding:30px;max-width:1600px}.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.topbar h1{margin:0 0 6px;font-size:30px;letter-spacing:-.7px}.muted{color:var(--muted);margin:0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;border:0;padding:11px 17px;border-radius:11px;font-weight:750;cursor:pointer;transition:.2s;line-height:1}.btn:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(17,38,27,.12)}.primary{background:linear-gradient(135deg,var(--accent),#e56d16);color:#fff}.secondary{background:#e9efeb;color:#254035}.danger{background:#fff0ef;color:#a92f25;border:1px solid #f2c5c0}.full{width:100%}
.cards{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;margin-bottom:22px}.stat{background:var(--surface);border:1px solid rgba(20,70,48,.06);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);position:relative;overflow:hidden}.stat:after{content:"";position:absolute;right:-20px;top:-25px;width:85px;height:85px;border-radius:50%;background:rgba(15,107,69,.07)}.stat span{display:block;color:var(--muted);font-size:13px;font-weight:650}.stat strong{display:block;font-size:22px;margin:10px 0;letter-spacing:-.4px}.stat small{color:#8a9790}
.panel{background:var(--surface);border:1px solid rgba(20,70,48,.06);border-radius:var(--radius);padding:22px;margin-bottom:22px;box-shadow:var(--shadow)}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:17px}.panel h2{margin:0;font-size:19px;letter-spacing:-.2px}.summary-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:13px}.summary-grid>div{background:var(--surface-2);border:1px solid #e5eee8;border-radius:12px;padding:16px}.summary-grid b,.summary-grid span{display:block}.summary-grid span{font-size:18px;margin-top:7px;font-weight:750}.summary-grid .grand{background:linear-gradient(135deg,#0d6844,#0a4d33);color:#fff;border-color:transparent}
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:12px}table{width:100%;border-collapse:separate;border-spacing:0;min-width:950px}th,td{padding:13px 14px;border-bottom:1px solid #edf1ef;text-align:right;white-space:nowrap}th{background:#0d5c3d;color:#fff;font-size:12px;text-transform:uppercase;letter-spacing:.4px}th:first-child,td:first-child,th:nth-child(2),td:nth-child(2),th:nth-child(3),td:nth-child(3){text-align:left}tr:last-child td{border-bottom:0}tbody tr:hover{background:#f8fbf9}.center{text-align:center!important}
.entry-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-top:16px}.form-panel label{display:block;font-weight:750;font-size:12px;margin:0 0 7px;color:#33463c;text-transform:uppercase;letter-spacing:.35px}input,select{width:100%;padding:12px 13px;border:1px solid #d6e0da;border-radius:11px;font-size:15px;background:#fff;color:var(--text);transition:.18s;box-shadow:0 1px 2px rgba(0,0,0,.02)}input::placeholder{color:#a0aaa5}input:focus,select:focus{outline:none;border-color:#79a992;box-shadow:0 0 0 4px rgba(15,107,69,.10)}.big-total{margin:22px 0;padding:19px 20px;border-radius:13px;background:linear-gradient(135deg,#edf8f1,#f7fbf8);border:1px solid #d9ebe0;font-size:18px;display:flex;justify-content:space-between;align-items:center}.big-total strong{font-size:25px;color:var(--primary-dark)}.actions{display:flex;gap:10px}.alert{padding:13px 15px;border-radius:11px;margin-bottom:16px;border:1px solid transparent}.success{background:#e8f7ef;color:#17653f;border-color:#ccebd9}.danger{background:#fff0ef;color:#9d2b22;border-color:#f3c9c5}.filters{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.filters input,.filters select{min-width:170px}.date-range{display:none;gap:10px;align-items:end}.date-range label{display:flex;flex-direction:column;gap:5px;font-size:.85rem}
/* Login */
.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:radial-gradient(circle at 15% 20%,rgba(242,138,46,.22),transparent 28%),radial-gradient(circle at 85% 80%,rgba(15,107,69,.35),transparent 34%),linear-gradient(135deg,#063d29,#0d5d3f 55%,#092f21)}.auth:before{content:"";position:fixed;inset:0;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:34px 34px;pointer-events:none}.auth-card{position:relative;width:430px;max-width:100%;padding:38px;background:rgba(255,255,255,.97);border:1px solid rgba(255,255,255,.5);border-radius:24px;box-shadow:0 28px 70px rgba(0,0,0,.28);backdrop-filter:blur(10px)}.auth-card:before{content:"";display:block;width:48px;height:5px;border-radius:99px;background:var(--accent);margin-bottom:22px}.auth-card h1{margin:0 0 8px;font-size:30px;letter-spacing:-.8px;color:#12392a}.auth-card:after{content:"Secure cashbook management";display:block;color:#7b8982;font-size:13px;margin-bottom:25px}.auth-card form{display:grid;gap:9px}.auth-card label{font-size:13px;font-weight:750;color:#30443a;margin-top:6px}.auth-card .btn{width:100%;padding:14px;margin-top:8px;font-size:15px}.auth-card .alert{margin-bottom:7px}
.inline-form{display:inline;margin-left:6px}
html{overflow-x:hidden}body{overflow-x:hidden}.main{min-width:0}.sidebar nav,.side-bottom{overflow:hidden}.panel{min-width:0}
@media(max-width:1100px){.cards{grid-template-columns:repeat(3,1fr)}.summary-grid{grid-template-columns:repeat(3,1fr)}.entry-grid{grid-template-columns:repeat(2,1fr)}}
 .nav-icon{width:20px;height:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center}.nav-icon svg{width:19px;height:19px;fill:currentColor}.logout-link{width:100%;background:transparent;border:0;font:inherit;text-align:left;cursor:pointer;color:#dcebe3;text-decoration:none;padding:12px 14px;border-radius:11px;margin:5px 0;font-weight:600;transition:.2s}.logout-link:hover{color:#fff;transform:translateX(2px);background:rgba(255,255,255,.1)}
@media(max-width:750px){.sidebar{width:70px;padding:15px 8px}.logo{font-size:0;text-align:center;padding:8px 0 24px}.logo:first-letter{font-size:22px}.sidebar nav a,.side-bottom a,.logout-link{font-size:0;justify-content:center;padding:12px 8px}.nav-icon{margin:0}.user-badge{font-size:0;text-align:center;padding:10px 0}.main{margin-left:70px;width:calc(100% - 70px);padding:18px}.topbar{align-items:flex-start;gap:10px}.topbar h1{font-size:24px}.cards{grid-template-columns:repeat(2,1fr)}.summary-grid{grid-template-columns:repeat(2,1fr)}.panel-head{flex-direction:column;align-items:flex-start}.panel-head .btn{width:100%}.filters{width:100%;display:grid;grid-template-columns:1fr;gap:10px}.filters>*{min-width:0!important;width:100%}.entry-grid{gap:10px}.actions{flex-direction:column}.actions .btn{width:100%}.table-wrap{-webkit-overflow-scrolling:touch}.table-wrap table{min-width:900px}.date-range{flex-direction:column;align-items:stretch}}
@media(max-width:500px){.cards,.summary-grid,.entry-grid{grid-template-columns:1fr}.main{padding:12px}.topbar{flex-direction:column}.topbar h1{font-size:22px}.topbar .btn{width:100%}.panel{padding:16px}.stat{padding:15px}.stat strong{font-size:19px}.big-total{padding:15px}.big-total strong{font-size:22px}.auth{padding:15px}.auth-card{padding:28px 22px;border-radius:20px}.auth-card h1{font-size:27px}input,select{padding:11px}}

.export-actions{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}.action-select{min-width:110px;padding:9px 10px;border:1px solid #d6e0da;border-radius:9px;background:#fff;color:var(--text);font-weight:650}.action-select:focus{outline:none;border-color:#79a992;box-shadow:0 0 0 3px rgba(15,107,69,.10)}
 .nav-icon{width:20px;height:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center}.nav-icon svg{width:19px;height:19px;fill:currentColor}.logout-link{width:100%;background:transparent;border:0;font:inherit;text-align:left;cursor:pointer;color:#dcebe3;text-decoration:none;padding:12px 14px;border-radius:11px;margin:5px 0;font-weight:600;transition:.2s}.logout-link:hover{color:#fff;transform:translateX(2px);background:rgba(255,255,255,.1)}
@media(max-width:750px){.export-actions{display:grid;grid-template-columns:repeat(3,1fr);width:100%}.export-actions .btn{width:100%}.action-select{min-width:100px}}
@media(max-width:500px){.export-actions{grid-template-columns:1fr}.export-actions .btn{width:100%}}

/* Transactions pagination and bulk actions */
.bulk-actions{display:flex;align-items:center;gap:12px;justify-content:flex-end;margin:14px 0;flex-wrap:wrap}
.show-control{display:inline-flex;align-items:center;gap:7px;font-size:14px;font-weight:600}
.show-control select{min-width:78px}
.btn.danger{background:#b42318;color:#fff;border:1px solid #b42318}
.btn.danger:disabled{opacity:.5;cursor:not-allowed}
.pagination-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;flex-wrap:wrap}
.pagination{display:flex;gap:5px;flex-wrap:wrap}
.page-link{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 9px;border:1px solid #d7dde7;border-radius:8px;text-decoration:none;color:inherit;background:#fff}
.page-link.active{font-weight:700;background:#1f7a4d;color:#fff;border-color:#1f7a4d}
.bulk-select-col{width:42px;text-align:center}
.bulk-select-col input{width:16px;height:16px}
@media (max-width:700px){
 .bulk-actions{justify-content:space-between}
 .pagination-bar{align-items:flex-start;flex-direction:column}
}

/* Transactions toolbar and precise column alignment */
.list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;flex-wrap:wrap}
.bulk-delete-form{margin:0}
.transactions-table{table-layout:auto}
.transactions-table th,.transactions-table td{vertical-align:middle}
.transactions-table .actions-col{text-align:center;min-width:118px}
.transactions-table .sn-col{text-align:center;min-width:58px}
.transactions-table .select-col{text-align:center;width:48px;min-width:48px}
.transactions-table .select-col input{display:block;width:17px;height:17px;margin:0 auto;cursor:pointer}
.transactions-table .datetime-col{text-align:left;min-width:145px}
.transactions-table .branch-col,.transactions-table .invoice-col{text-align:left}
.transactions-table .description-col{text-align:left;white-space:normal;min-width:180px;max-width:330px}
.transactions-table .amount-col{text-align:right;min-width:115px;font-variant-numeric:tabular-nums}
.transactions-table th.amount-col{text-align:right}
.transactions-table th.actions-col,.transactions-table th.sn-col,.transactions-table th.select-col{text-align:center}
.show-control{white-space:nowrap}
.show-control select{width:auto;min-width:78px}
 .nav-icon{width:20px;height:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center}.nav-icon svg{width:19px;height:19px;fill:currentColor}.logout-link{width:100%;background:transparent;border:0;font:inherit;text-align:left;cursor:pointer;color:#dcebe3;text-decoration:none;padding:12px 14px;border-radius:11px;margin:5px 0;font-weight:600;transition:.2s}.logout-link:hover{color:#fff;transform:translateX(2px);background:rgba(255,255,255,.1)}
@media(max-width:750px){.list-toolbar{align-items:stretch}.list-toolbar .show-control,.list-toolbar .bulk-delete-form{width:auto}.transactions-table{min-width:1250px}}
@media(max-width:500px){.list-toolbar{flex-direction:column;align-items:stretch}.list-toolbar .show-control{justify-content:flex-start}.list-toolbar .bulk-delete-form,.list-toolbar .bulk-delete-form .btn{width:100%}}

.transactions-table tfoot .totals-row { font-weight:700; border-top:2px solid currentColor; }
.transactions-table tfoot .totals-row td { padding-top:10px; padding-bottom:10px; }

/* Modern sidebar refresh */
.sidebar{width:220px;padding:18px 12px;background:linear-gradient(180deg,#0b5136 0%,#073d2a 58%,#062f22 100%);box-shadow:10px 0 35px rgba(3,30,20,.14);border-right:1px solid rgba(255,255,255,.06);overflow:hidden}
.sidebar:before{content:"";position:absolute;left:-70px;top:-80px;width:190px;height:190px;border-radius:50%;background:rgba(255,255,255,.055);pointer-events:none}
.sidebar-brand{height:66px;display:flex;align-items:center;gap:10px;padding:2px 8px 10px;position:relative}
.brand-mark{width:38px;height:38px;flex:0 0 38px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(145deg,#f5a14c,#e97822);color:#fff;font-weight:900;font-size:19px;box-shadow:0 8px 18px rgba(0,0,0,.16);border:1px solid rgba(255,255,255,.16)}
.brand-copy .logo{padding:0;font-size:18px;line-height:1;letter-spacing:-.35px}.brand-copy .logo span{font-size:8px;letter-spacing:1.9px;margin-top:5px}
.nav-label{padding:13px 11px 6px;color:rgba(221,240,230,.48);font-size:9px;font-weight:800;letter-spacing:1.35px}.nav-label-admin{margin-top:8px}
.sidebar nav a,.side-bottom a,.logout-link{position:relative;gap:12px;color:#cfe2d8;padding:11px 12px;border-radius:12px;margin:3px 0;font-size:13.5px;font-weight:650;transition:background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease}
.sidebar nav a:after{content:"";position:absolute;right:9px;top:50%;width:4px;height:4px;border-radius:50%;background:transparent;transform:translateY(-50%);transition:.18s}
.sidebar nav a:hover,.side-bottom a:hover,.logout-link:hover{background:rgba(255,255,255,.075);color:#fff;transform:translateX(2px)}
.sidebar nav a.active{background:linear-gradient(90deg,rgba(255,255,255,.15),rgba(255,255,255,.07));color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.055),0 6px 18px rgba(0,0,0,.08)}
.sidebar nav a.active:before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 5px 5px 0;background:#f28a2e;box-shadow:0 0 12px rgba(242,138,46,.45)}
.sidebar nav a.active:after{background:#f28a2e;box-shadow:0 0 8px rgba(242,138,46,.5)}
.nav-icon{width:19px;height:19px;min-width:19px;opacity:.86;transition:.18s}.nav-icon svg{width:18px;height:18px;fill:currentColor}.sidebar nav a.active .nav-icon{color:#fff;opacity:1}.sidebar nav a:hover .nav-icon,.logout-link:hover .nav-icon{transform:scale(1.07);color:#fff}
.side-bottom{left:12px;right:12px;bottom:14px;padding-top:10px;border-top:1px solid rgba(255,255,255,.09)}
.sidebar-account{display:flex;align-items:center;gap:10px;padding:9px 9px 8px;margin-bottom:5px;border-radius:13px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.055)}
.account-avatar{width:32px;height:32px;min-width:32px;border-radius:10px;display:grid;place-items:center;background:rgba(255,255,255,.14);color:#fff;font-size:12px;font-weight:850}.account-info{min-width:0;display:flex;flex-direction:column;gap:2px}.account-info strong{font-size:11.5px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-info span{font-size:9.5px;color:#9fc0af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.logout-link{width:100%;background:transparent;border:0;text-align:left;cursor:pointer;color:#b9d1c4}.logout-link:hover{background:rgba(192,57,43,.14);color:#ffd7d2}
@media(max-width:750px){.sidebar{width:70px;padding:14px 8px}.sidebar-brand{height:57px;justify-content:center;padding:2px 0 10px}.brand-mark{width:38px;height:38px}.brand-copy{display:none}.nav-label{display:none}.sidebar nav a,.side-bottom a,.logout-link{font-size:0;justify-content:center;padding:12px 8px;gap:0}.sidebar nav a:after{display:none}.sidebar nav a.active:before{left:0;top:9px;bottom:9px}.side-bottom{left:8px;right:8px;bottom:10px}.sidebar-account{justify-content:center;padding:7px 5px}.account-info{display:none}.account-avatar{width:32px;height:32px;min-width:32px}.logout-link{margin-top:5px}.logout-link .nav-icon{margin:0}}

/* Theme color switcher */
:root{--sidebar-start:#0b5136;--sidebar-mid:#073d2a;--sidebar-end:#062f22;--theme-accent:#f28a2e;--theme-primary:#0f6b45;--theme-primary-dark:#0a4f33;--theme-soft:#edf8f1}
body.theme-blue{--sidebar-start:#164e78;--sidebar-mid:#123b5c;--sidebar-end:#0d2940;--theme-accent:#4aa3df;--theme-primary:#1769aa;--theme-primary-dark:#0e4e82;--theme-soft:#edf6fc}
body.theme-purple{--sidebar-start:#513b78;--sidebar-mid:#3d2d5e;--sidebar-end:#2b203f;--theme-accent:#b78cff;--theme-primary:#6d4bb3;--theme-primary-dark:#4e3487;--theme-soft:#f5f0ff}
body.theme-slate{--sidebar-start:#344454;--sidebar-mid:#283541;--sidebar-end:#1c252e;--theme-accent:#8aa4b8;--theme-primary:#526b7d;--theme-primary-dark:#394d5c;--theme-soft:#eef3f6}
body.theme-teal{--sidebar-start:#075e63;--sidebar-mid:#06484c;--sidebar-end:#043438;--theme-accent:#42c6bd;--theme-primary:#0b817a;--theme-primary-dark:#075e5a;--theme-soft:#edfafa}
.sidebar{background:linear-gradient(180deg,var(--sidebar-start) 0%,var(--sidebar-mid) 58%,var(--sidebar-end) 100%)}
.sidebar nav a.active:before{background:var(--theme-accent);box-shadow:0 0 12px color-mix(in srgb,var(--theme-accent),transparent 55%)}
.sidebar nav a.active:after{background:var(--theme-accent);box-shadow:0 0 8px color-mix(in srgb,var(--theme-accent),transparent 50%)}
.brand-mark{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-accent),white 10%),var(--theme-accent))}
.theme-switcher{position:relative}
.theme-toggle{position:relative;width:100%;display:flex;align-items:center;gap:12px;color:#b9d1c4;background:transparent;border:0;text-align:left;cursor:pointer;padding:11px 12px;border-radius:12px;margin:3px 0;font-size:13px;font-weight:650;transition:.18s}
.theme-toggle:hover{background:rgba(255,255,255,.075);color:#fff}
.theme-current{margin-left:auto;width:12px;height:12px;border-radius:50%;background:var(--theme-accent);box-shadow:0 0 0 3px rgba(255,255,255,.08)}
.theme-menu{position:absolute;left:0;bottom:calc(100% + 7px);width:100%;padding:6px;background:rgba(6,36,27,.98);border:1px solid rgba(255,255,255,.1);border-radius:13px;box-shadow:0 15px 35px rgba(0,0,0,.25);opacity:0;visibility:hidden;transform:translateY(6px);transition:.18s;z-index:30}
.theme-switcher.open .theme-menu{opacity:1;visibility:visible;transform:translateY(0)}
.theme-menu button{width:100%;display:flex;align-items:center;gap:9px;border:0;background:transparent;color:#d7e7df;padding:8px 9px;border-radius:9px;cursor:pointer;font-size:11.5px;text-align:left}
.theme-menu button:hover,.theme-menu button.selected{background:rgba(255,255,255,.09);color:#fff}
.theme-menu i{width:12px;height:12px;border-radius:50%;display:block;background:var(--swatch);box-shadow:0 0 0 2px rgba(255,255,255,.12)}
.theme-menu button[data-theme="green"] i{--swatch:#f28a2e}.theme-menu button[data-theme="blue"] i{--swatch:#4aa3df}.theme-menu button[data-theme="purple"] i{--swatch:#b78cff}.theme-menu button[data-theme="slate"] i{--swatch:#8aa4b8}.theme-menu button[data-theme="teal"] i{--swatch:#42c6bd}
@media(max-width:750px){.theme-toggle{font-size:0;justify-content:center;padding:12px 8px;gap:0}.theme-current{position:absolute;right:5px;top:9px;width:8px;height:8px}.theme-menu{left:48px;bottom:0;width:135px}}

/* Database-backed application themes */
:root{--theme-sidebar-start:#0b5136;--theme-sidebar-mid:#073d2a;--theme-sidebar-end:#062f22;--theme-accent:#f28a2e;--theme-primary:#0f6b45;--theme-primary-dark:#0a4f33;--theme-soft:#edf8f1;--theme-soft-2:#f7fbf8;--theme-table:#0d5c3d;--theme-focus:rgba(15,107,69,.12)}
body.theme-ocean{--theme-sidebar-start:#155b8a;--theme-sidebar-mid:#12476d;--theme-sidebar-end:#0b304a;--theme-accent:#38a8ff;--theme-primary:#1676b7;--theme-primary-dark:#0d5688;--theme-soft:#edf7ff;--theme-soft-2:#f7fbff;--theme-table:#145d8d;--theme-focus:rgba(56,168,255,.14)}
body.theme-royal{--theme-sidebar-start:#3448a4;--theme-sidebar-mid:#28377f;--theme-sidebar-end:#1b2454;--theme-accent:#6d7cff;--theme-primary:#4c5fd0;--theme-primary-dark:#34459f;--theme-soft:#f0f2ff;--theme-soft-2:#fafaff;--theme-table:#3f4fae;--theme-focus:rgba(109,124,255,.14)}
body.theme-violet{--theme-sidebar-start:#60408c;--theme-sidebar-mid:#472f6d;--theme-sidebar-end:#302049;--theme-accent:#b06cff;--theme-primary:#7c4cc3;--theme-primary-dark:#59338e;--theme-soft:#f6f0ff;--theme-soft-2:#fcfaff;--theme-table:#68409f;--theme-focus:rgba(176,108,255,.14)}
body.theme-rose{--theme-sidebar-start:#9b3e5b;--theme-sidebar-mid:#7b3048;--theme-sidebar-end:#4e1f2e;--theme-accent:#ff6f91;--theme-primary:#c34e70;--theme-primary-dark:#8f3450;--theme-soft:#fff0f4;--theme-soft-2:#fff9fb;--theme-table:#a83f60;--theme-focus:rgba(255,111,145,.14)}
body.theme-ruby{--theme-sidebar-start:#8e2e35;--theme-sidebar-mid:#70252b;--theme-sidebar-end:#47171b;--theme-accent:#ff5b61;--theme-primary:#bd3e46;--theme-primary-dark:#8c2930;--theme-soft:#fff0f1;--theme-soft-2:#fff9f9;--theme-table:#9e3038;--theme-focus:rgba(255,91,97,.14)}
body.theme-amber{--theme-sidebar-start:#8b5a12;--theme-sidebar-mid:#6e470d;--theme-sidebar-end:#442b08;--theme-accent:#ffc247;--theme-primary:#bd7b12;--theme-primary-dark:#8c5808;--theme-soft:#fff8e8;--theme-soft-2:#fffdf7;--theme-table:#9b6810;--theme-focus:rgba(255,194,71,.18)}
body.theme-teal{--theme-sidebar-start:#075e63;--theme-sidebar-mid:#06484c;--theme-sidebar-end:#043438;--theme-accent:#42c6bd;--theme-primary:#0b817a;--theme-primary-dark:#075e5a;--theme-soft:#edfafa;--theme-soft-2:#f8fefe;--theme-table:#08706f;--theme-focus:rgba(66,198,189,.14)}
body.theme-indigo{--theme-sidebar-start:#314d91;--theme-sidebar-mid:#253b70;--theme-sidebar-end:#172546;--theme-accent:#5b8cff;--theme-primary:#416cc5;--theme-primary-dark:#2d4f98;--theme-soft:#eff4ff;--theme-soft-2:#fafcff;--theme-table:#355da7;--theme-focus:rgba(91,140,255,.14)}
body.theme-slate{--theme-sidebar-start:#344454;--theme-sidebar-mid:#283541;--theme-sidebar-end:#1c252e;--theme-accent:#8aa4b8;--theme-primary:#526b7d;--theme-primary-dark:#394d5c;--theme-soft:#eef3f6;--theme-soft-2:#fafcfd;--theme-table:#425969;--theme-focus:rgba(138,164,184,.14)}
body.theme-forest{--theme-sidebar-start:#17603e;--theme-sidebar-mid:#104b31;--theme-sidebar-end:#0a3020;--theme-accent:#63d49a;--theme-primary:#188354;--theme-primary-dark:#0e5b39;--theme-soft:#edfbf3;--theme-soft-2:#f9fefa;--theme-table:#176e48;--theme-focus:rgba(99,212,154,.14)}
body.theme-plum{--theme-sidebar-start:#713b79;--theme-sidebar-mid:#572e5f;--theme-sidebar-end:#351c3a;--theme-accent:#d07bff;--theme-primary:#8e4fa0;--theme-primary-dark:#653575;--theme-soft:#faf0ff;--theme-soft-2:#fdfaff;--theme-table:#754182;--theme-focus:rgba(208,123,255,.14)}
body:not(.theme-blue):not(.theme-purple):not(.theme-slate):not(.theme-teal){--sidebar-start:var(--theme-sidebar-start);--sidebar-mid:var(--theme-sidebar-mid);--sidebar-end:var(--theme-sidebar-end)}
body{--primary:var(--theme-primary);--primary-dark:var(--theme-primary-dark)}
.sidebar{background:linear-gradient(180deg,var(--theme-sidebar-start),var(--theme-sidebar-mid) 58%,var(--theme-sidebar-end));}
.sidebar nav a.active:before,.sidebar nav a.active:after{background:var(--theme-accent);}
.brand-mark{background:linear-gradient(145deg,var(--theme-accent),var(--theme-primary));}
.btn.primary{background:linear-gradient(135deg,var(--theme-accent),var(--theme-primary));}
th{background:var(--theme-table);}
.summary-grid .grand{background:linear-gradient(135deg,var(--theme-primary),var(--theme-primary-dark));}
.big-total{background:linear-gradient(135deg,var(--theme-soft),var(--theme-soft-2));border-color:color-mix(in srgb,var(--theme-primary),white 78%)}
.big-total strong{color:var(--theme-primary-dark)}
input:focus,select:focus{border-color:var(--theme-primary);box-shadow:0 0 0 4px var(--theme-focus)}
.stat:after{background:color-mix(in srgb,var(--theme-primary),transparent 90%)}
.theme-menu-title{font-size:10px;text-transform:uppercase;letter-spacing:.55px;color:#9fb8ad;padding:6px 9px 7px;font-weight:800}
.theme-menu{max-height:420px;overflow:auto}
.theme-location{padding:9px;border-top:1px solid rgba(255,255,255,.08);margin-top:5px}.theme-location label{display:block;font-size:9px;color:#a9c0b5;text-transform:uppercase;letter-spacing:.4px;font-weight:800;margin-bottom:5px}.theme-location select{width:100%;padding:7px 8px;border:1px solid rgba(255,255,255,.13);border-radius:8px;background:#173a2e;color:#fff;font-size:10px}.theme-note{font-size:9px;line-height:1.35;color:#91aa9e;padding:7px 9px 4px}.theme-status{font-size:9px;min-height:12px;padding:4px 9px 2px}.theme-status.ok{color:#8de2b0}.theme-status.error{color:#ffaaa7}.theme-menu i{width:13px;height:13px;flex:none}.theme-menu button[data-theme="emerald"] i{--swatch:#f28a2e}.theme-menu button[data-theme="ocean"] i{--swatch:#38a8ff}.theme-menu button[data-theme="royal"] i{--swatch:#6d7cff}.theme-menu button[data-theme="violet"] i{--swatch:#b06cff}.theme-menu button[data-theme="rose"] i{--swatch:#ff6f91}.theme-menu button[data-theme="ruby"] i{--swatch:#ff5b61}.theme-menu button[data-theme="amber"] i{--swatch:#ffc247}.theme-menu button[data-theme="teal"] i{--swatch:#42c6bd}.theme-menu button[data-theme="indigo"] i{--swatch:#5b8cff}.theme-menu button[data-theme="slate"] i{--swatch:#8aa4b8}.theme-menu button[data-theme="forest"] i{--swatch:#63d49a}.theme-menu button[data-theme="plum"] i{--swatch:#d07bff}
.theme-options-grid{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:2px 3px}.theme-options-grid button{min-height:34px}.theme-step-title{padding-top:9px}.theme-save{justify-content:center!important;background:var(--theme-primary)!important;color:#fff!important;font-weight:800!important;margin:8px 3px 3px!important;border:1px solid color-mix(in srgb,var(--theme-primary),white 12%)!important}.theme-save:hover{background:var(--theme-primary-dark)!important}.theme-save:disabled{opacity:.6;cursor:wait}.theme-location select{cursor:pointer}@media(max-width:750px){.theme-menu{width:190px}.theme-options-grid{grid-template-columns:1fr 1fr}}

/* Theme color modal + clickable location picker */
.theme-switcher{position:relative}
.theme-modal{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:20px}
.theme-modal.open{display:flex}
.theme-modal-backdrop{position:absolute;inset:0;background:rgba(3,18,13,.62);backdrop-filter:blur(4px)}
.theme-modal-card{position:relative;width:min(520px,calc(100vw - 32px));max-height:min(720px,calc(100vh - 40px));overflow:auto;background:#fff;border:1px solid rgba(13,92,61,.14);border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.28);padding:22px;color:#183027}
.theme-modal-header{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}
.theme-modal-kicker,.theme-color-heading{font-size:10px;text-transform:uppercase;letter-spacing:1px;font-weight:800;color:var(--theme-primary);margin-bottom:5px}
.theme-modal-header h3{margin:0;font-size:21px;color:#183027}
.theme-modal-header p{margin:5px 0 0;color:#718078;font-size:12px}
.theme-modal-close{width:38px!important;height:38px!important;min-height:38px!important;display:grid!important;place-items:center!important;border-radius:10px!important;background:#f2f5f3!important;color:#52625a!important;font-size:24px!important;padding:0!important}
.theme-modal-close:hover{background:#e8eeeb!important;color:#183027!important}
.theme-location-picker{position:relative;margin-bottom:17px}
.theme-location-picker label{display:block;font-size:11px;font-weight:800;color:#56655e;margin-bottom:6px}
.theme-location-trigger{width:100%!important;min-height:48px!important;display:flex!important;align-items:center!important;gap:10px!important;background:#f7faf8!important;border:1px solid #d9e4de!important;color:#183027!important;padding:10px 12px!important;border-radius:12px!important;font-size:13px!important;text-align:left!important}
.theme-location-trigger:hover{background:#f0f6f2!important;border-color:var(--theme-primary)!important}
.location-pin{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;background:var(--theme-soft);color:var(--theme-primary);font-size:17px}
.location-chevron{margin-left:auto;font-size:17px;color:#73827b}
.theme-location-list{display:none;position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:15;background:#fff;border:1px solid #dbe6e0;border-radius:13px;box-shadow:0 15px 35px rgba(0,0,0,.16);padding:6px;max-height:250px;overflow:auto}
.theme-location-list.open{display:block}
.theme-location-item{width:100%!important;min-height:52px!important;display:flex!important;align-items:center!important;gap:10px!important;background:#fff!important;border:0!important;color:#26352e!important;padding:8px 10px!important;border-radius:9px!important;text-align:left!important}
.theme-location-item:hover,.theme-location-item.selected{background:var(--theme-soft)!important}
.location-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:#eef3f0;color:var(--theme-primary);font-size:16px;flex:none}
.theme-location-item strong{display:block;font-size:12px;font-weight:800}
.theme-location-item small{display:block;margin-top:2px;color:#7a8981;font-size:10px}
.location-check{margin-left:auto;color:var(--theme-primary);font-weight:900;opacity:0}
.theme-location-item.selected .location-check{opacity:1}
.theme-color-heading{margin:0 0 7px}
.theme-modal-colors{grid-template-columns:repeat(3,1fr);gap:6px;padding:0}
.theme-modal-colors button{min-height:48px!important;border:1px solid #e0e7e3!important;background:#fafcfb!important;color:#405149!important;font-size:11px!important;padding:8px 9px!important}
.theme-modal-colors button:hover,.theme-modal-colors button.selected{background:var(--theme-soft)!important;border-color:var(--theme-primary)!important;color:var(--theme-primary-dark)!important}
.theme-modal-colors button.selected{box-shadow:inset 0 0 0 1px var(--theme-primary)}
.theme-modal-colors i{width:18px;height:18px!important}
.theme-modal .theme-save{min-height:48px!important;margin:17px 0 0!important;border-radius:12px!important;font-size:13px!important}
.theme-modal .theme-note{font-size:10px;line-height:1.4;color:#78867f;padding:8px 2px 0}
.theme-modal .theme-status{font-size:11px;min-height:16px;padding:7px 2px 0}
@media(max-width:600px){
  .theme-modal{padding:10px;align-items:flex-end}
  .theme-modal-card{width:100%;max-height:calc(100vh - 20px);border-radius:18px;padding:18px}
  .theme-modal-colors{grid-template-columns:1fr 1fr}
}


/* Login branch/location identity */
.sidebar-location-title{display:flex;align-items:center;gap:7px;margin-top:5px;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--muted,#9aa7b7);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px;}
.sidebar-location-title .location-dot{width:7px;height:7px;border-radius:50%;background:var(--theme-accent,#f28a2e);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent,#f28a2e) 16%,transparent);flex:0 0 7px;}
.page-location-title{font-size:.58em;font-weight:700;color:var(--theme-accent,#f28a2e);white-space:nowrap;}
@media (max-width:700px){.page-location-title{display:block;margin-top:3px;font-size:.65em;}.sidebar-location-title{max-width:120px;}}
.chart-filter-panel .filters{align-items:flex-end}.chart-panel{overflow:hidden}.chart-wrap{position:relative;width:100%;height:420px;padding:10px 0}.chart-wrap canvas{display:block;width:100%;height:100%;min-height:320px}.chart-empty{padding:120px 20px;color:var(--muted)}

/* Modern Chart Report */
.chart-report-shell{display:grid;gap:18px}
.chart-filter-panel{border:1px solid var(--border);background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,250,252,.96));box-shadow:0 12px 32px rgba(15,23,42,.06);border-radius:18px}
.chart-filter-panel .filters{align-items:end;gap:14px}
.chart-filter-panel label{font-weight:700;color:var(--text);font-size:.84rem}
.chart-filter-panel select,.chart-filter-panel input{min-height:44px;border-radius:12px;border:1px solid var(--border);background:var(--surface,#fff);padding:10px 12px;font-size:.92rem}
.chart-filter-panel select:focus,.chart-filter-panel input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 14%,transparent);outline:0}
.chart-quick-periods{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.chart-quick-periods a{border:1px solid var(--border);border-radius:999px;padding:8px 13px;text-decoration:none;color:var(--muted);font-size:.78rem;font-weight:700;background:var(--surface,#fff);transition:.18s ease}
.chart-quick-periods a:hover,.chart-quick-periods a.active{color:var(--primary);border-color:color-mix(in srgb,var(--primary) 35%,var(--border));background:color-mix(in srgb,var(--primary) 8%,white);transform:translateY(-1px)}
.chart-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.chart-summary .stat{min-height:94px;border-radius:16px;padding:17px 18px;background:var(--surface,#fff);border:1px solid var(--border);box-shadow:0 8px 22px rgba(15,23,42,.045)}
.chart-summary .stat span{display:block;color:var(--muted);font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px}
.chart-summary .stat strong{display:block;font-size:1.02rem;line-height:1.3;color:var(--text)}
.chart-panel{border-radius:20px;overflow:hidden;border:1px solid var(--border);box-shadow:0 16px 40px rgba(15,23,42,.07);background:var(--surface,#fff)}
.chart-panel .panel-head{padding:20px 22px 10px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.chart-panel .panel-head h2{margin:0;font-size:1.12rem}
.chart-panel .panel-head p{margin:5px 0 0}
.chart-wrap{position:relative;height:440px;padding:8px 18px 20px}
.chart-empty{padding:80px 20px;color:var(--muted)}
.chart-hint{font-size:.76rem;color:var(--muted);padding:0 22px 18px}
@media(max-width:800px){.chart-summary{grid-template-columns:1fr}.chart-wrap{height:360px;padding:5px 8px 16px}.chart-panel .panel-head{padding:16px}.chart-filter-panel .filters{display:grid;grid-template-columns:1fr}.chart-filter-panel .filters>*{width:100%}}
.role-settings-table input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent,#f28a2e);cursor:pointer}.role-settings-table input[type=checkbox]:disabled{opacity:.45;cursor:not-allowed}
