/* Hamad Law Office — Emerald & Gold UI. Visual-only overrides, no ledger changes. */
:root{
  color-scheme: light;
  --green:#113c31;--green2:#206550;--gold:#b89747;
  --gold-bright:#d8b96b;--bg:#f4f7f4;--paper:#fff;
  --text:#1b342d;--muted:#71847c;--line:#e3ece6;
  --shadow:0 15px 35px rgba(18,61,44,.055);
  --surface-soft:#f7faf8;--tint:#eaf3ef;--shadow-strong:0 22px 65px rgba(8,43,31,.16);
}
html{scroll-behavior:smooth}
body{font-size:14px;letter-spacing:0;min-width:320px}
button,input,textarea,select{transition:background-color .18s,border-color .18s,box-shadow .18s,transform .18s}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(189,154,76,.35);outline-offset:2px}
button:not(:disabled):active{transform:translateY(1px)}
.shell{grid-template-columns:272px minmax(0,1fr)}
.sidebar{background:linear-gradient(165deg,#10392f 0%,#0b2c26 70%,#09241f 100%);padding:23px 17px 18px;box-shadow:inset -1px 0 rgba(216,185,107,.16);scrollbar-width:thin;scrollbar-color:#416c5c transparent}
.sidebar::before{content:"";display:block;height:3px;background:linear-gradient(90deg,transparent,#e8c975,#bd9842,transparent);border-radius:6px;margin:0 5px 20px}
.office-sidebar-brand{display:flex;align-items:center;gap:12px;padding:0 7px 19px;border-bottom:1px solid rgba(255,255,255,.13);margin-bottom:17px}
.brand-icon-frame{width:67px;height:67px;flex:none;border-radius:16px;background:white;border:1px solid rgba(210,179,106,.42);padding:7px;display:grid;place-items:center;box-shadow:0 8px 22px rgba(0,0,0,.13)}
.brand-icon-frame img{display:block;width:100%;height:100%;object-fit:contain}
.office-sidebar-brand h2{font-size:15px;line-height:1.6;font-weight:700;color:#fff;margin:0 0 2px}
.office-sidebar-brand p{font-size:10px;line-height:1.6;color:#bfd1c6;margin:0}
.sidebar #nav{display:grid;gap:4px}
.sidebar .nav{margin:0;border:1px solid transparent;border-radius:12px;padding:11px 12px;color:#dbeae1;min-height:44px;font-weight:500;line-height:1.4}
.sidebar .nav .ico{font-size:17px;width:26px;display:grid;place-items:center;color:#d5bf7b}
.sidebar .nav:hover{background:rgba(255,255,255,.075);border-color:rgba(255,255,255,.07)}
.sidebar .nav.active{background:linear-gradient(95deg,rgba(244,229,177,.17),rgba(255,255,255,.075));border-color:rgba(219,186,103,.27);color:#fff;box-shadow:inset 3px 0 #d9b867}
.sidebar #sessionEmail{margin-top:22px;border-top:1px solid rgba(255,255,255,.1);padding-top:16px;overflow-wrap:anywhere}
.sidebar #logout{margin-top:10px}
.content{padding:35px clamp(20px,3vw,52px) 85px;max-width:1780px;width:100%;margin:0 auto}
.toolbar{padding-bottom:23px;border-bottom:1px solid var(--line);margin-bottom:24px;align-items:flex-start}
.toolbar h1{font-size:clamp(23px,2vw,28px);letter-spacing:-.45px;font-weight:700}
.toolbar .subtext{margin-top:7px;font-size:12px}
.actions .btn,.actions select{min-height:43px}
.btn{border-radius:12px;padding:10px 16px;box-shadow:none}
.btn:hover{box-shadow:0 5px 14px rgba(14,57,44,.10)}
.btn.secondary{background:var(--paper);border-color:var(--line);color:var(--text)}
.btn.secondary:hover{background:var(--surface-soft)}
.btn.gold{background:var(--gold-bright);color:#1e2e25}
.btn.tiny{border-radius:9px}
.panel{border-radius:20px;border:1px solid var(--line);padding:22px;box-shadow:var(--shadow);margin-bottom:16px}
.panel h2,.panel h3{letter-spacing:-.2px;color:var(--text)}
.panel .head{margin-bottom:16px}
.kpi{min-height:124px;border-radius:20px;padding:20px 21px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi:before{content:"";position:absolute;right:0;top:24px;bottom:24px;width:3px;background:var(--gold);border-radius:3px}
.kpi small{font-size:12px;line-height:1.7}
.kpi strong{font-size:clamp(23px,2.15vw,31px);letter-spacing:-.7px;margin-top:9px;font-variant-numeric:tabular-nums}
.grid{gap:16px}.grid.two{gap:16px}
#dashboardStats{grid-template-columns:repeat(2,minmax(0,1fr))}
#dashboardStats .kpi:nth-child(n+3){display:none}
#dashboardStats .kpi:first-child{background:linear-gradient(120deg,var(--paper),var(--surface-soft))}
#dashboardStats .kpi:nth-child(2){background:var(--paper)}
#dashboardStats .kpi:first-child:before{background:#3a916b}
#dashboard .panel{margin-bottom:0}
#dashboard .mt{margin-top:18px}
#dashboard .dash-section-gap{margin-top:18px}
#dashboard .quick-box{border:1px solid rgba(190,157,80,.19)}
#dashboard .quick-box .head{align-items:center}
#dashboard .quick-box h3{font-size:16px}
#dashboard .quick-entry{margin-top:16px}
#dashboard .quick-entry .btn{background:var(--green)}
#homeNotepad .panel{height:100%}
#fastBreakfast .panel{height:100%}
#homeNotepad textarea{background:var(--surface-soft);min-height:105px}
input,select,textarea{background:var(--paper);border-color:#d4e2d8;border-radius:11px;padding:11px 12px;min-height:43px}
input:focus,select:focus,textarea:focus{border-color:var(--gold)}
input::placeholder,textarea::placeholder{color:#8ea198}
label{color:var(--text)}
.tablewrap{border:1px solid var(--line);border-radius:14px;overflow:auto}
table{font-size:12px;line-height:1.6}
th,td{padding:13px 12px}
th{background:var(--surface-soft);color:var(--muted);border-bottom-color:var(--line)}
tr:hover td{background:var(--surface-soft)}
.pill{padding:4px 10px;border-radius:100px;background:var(--tint);color:var(--green2)}
.alert{background:#fffbf1;border-color:#eddaa8;border-radius:14px;padding:13px 16px}
.infobox{background:#fffdf6;border-radius:12px;border-inline-start:3px solid var(--gold)}
.auth{background:radial-gradient(circle at 65% 5%,#e0eee6,transparent 54%),linear-gradient(130deg,#edf3ee,#f9faf6)}
.authcard{border:1px solid #e3e8dc;border-radius:24px;padding:34px;box-shadow:var(--shadow-strong)}
.authcard h1{text-align:center;font-size:20px;margin:22px 0 7px}
.authcard #authExplain{text-align:center;font-size:12px;line-height:1.8;margin-bottom:25px}
.authcard img{max-height:190px;max-width:370px;object-fit:contain}
.loginlogo{border-bottom:1px solid var(--line)}
.modal-layer{background:rgba(8,29,23,.65);backdrop-filter:blur(5px)}
.modalbox{border-radius:22px;box-shadow:var(--shadow-strong);background:var(--paper)}
#dashboard .dashboard-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;min-height:164px;padding:26px 29px;margin-bottom:20px;background:linear-gradient(118deg,#164a3a 0%,#0e352d 70%,#0a2924 100%);color:#fff;border-radius:24px;position:relative;overflow:hidden;isolation:isolate;box-shadow:0 18px 40px rgba(15,58,44,.13)}
#dashboard .dashboard-hero:before,#dashboard .dashboard-hero:after{content:"";position:absolute;border-radius:50%;border:1px solid rgba(218,187,110,.12);z-index:-1}
#dashboard .dashboard-hero:before{width:460px;height:460px;left:-90px;top:-300px}
#dashboard .dashboard-hero:after{width:310px;height:310px;left:80px;bottom:-260px}
.hero-overline{display:flex;align-items:center;gap:9px;letter-spacing:.6px;font-size:11px;color:#dfc17b;font-weight:700;margin-bottom:10px}
.hero-overline:before{content:"";height:2px;width:23px;background:#dfc17b}
.dashboard-hero h2{font-size:clamp(22px,2.8vw,32px);color:white;margin:0 0 9px;line-height:1.45}
.dashboard-hero p{margin:0;color:#d4e4db;font-size:13px;line-height:1.9}
.hero-emblem{width:97px;height:97px;border:1px solid rgba(222,191,117,.5);border-radius:26px;background:#fff;display:grid;place-items:center;transform:rotate(-3deg);box-shadow:0 12px 28px rgba(0,0,0,.2);padding:15px}
.hero-emblem img{width:100%;height:100%;object-fit:contain;transform:rotate(3deg)}
.dashboard-section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:18px 2px 13px}
.dashboard-section-title h2{font-size:16px;margin:0;line-height:1.6}
.dashboard-section-title p{font-size:11px;color:var(--muted);margin:2px 0 0}
.dashboard-section-title .minor-link{color:var(--green2);font-size:12px;font-weight:600;text-decoration:none}
.dashboard-section-title .minor-link:hover{text-decoration:underline}
.dashboard-bento{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:16px;align-items:stretch}
.dashboard-bento > .bento-metrics{min-width:0}
.dashboard-bento > .bento-cash{min-width:0}
.cash-monitor{background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:20px 22px;box-shadow:var(--shadow);height:100%;position:relative;overflow:hidden}
.cash-monitor:before{content:"";position:absolute;inset-inline-end:-50px;bottom:-100px;width:230px;height:230px;border-radius:50%;background:radial-gradient(circle,rgba(205,174,96,.08),transparent 70%);pointer-events:none}
.cash-monitor .cash-caption{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cash-monitor h3{font-size:16px;margin:0 0 3px}
.cash-monitor small{font-size:11px;color:var(--muted)}
.cash-tabs{display:flex;gap:5px;padding:5px;border-radius:13px;background:var(--surface-soft);margin:16px 0;border:1px solid var(--line)}
.cash-tabs button{border:0;background:transparent;border-radius:9px;padding:9px 7px;font-weight:600;color:var(--muted);flex:1;font-size:12px;cursor:pointer}
.cash-tabs button[aria-selected="true"]{background:var(--paper);color:var(--green2);box-shadow:0 3px 10px rgba(10,60,36,.08)}
.cash-amount{font-weight:800;font-size:clamp(27px,3vw,37px);font-variant-numeric:tabular-nums;letter-spacing:-.8px;color:var(--text);line-height:1.4}
.cash-amount span{font-size:13px;color:var(--muted);font-weight:500;margin-inline-start:5px}
.cash-info{color:var(--muted);font-size:12px;line-height:1.8;margin:6px 0 10px}
.cash-footer{border-top:1px solid var(--line);padding-top:12px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.cash-footer button{background:transparent;border:0;padding:6px;color:var(--green2);font-weight:700;font-size:12px}
.cash-chip{font-size:11px;border:1px solid var(--line);border-radius:50px;padding:6px 9px;color:var(--muted)}
.dashboard-duo{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:stretch}
.dashboard-duo > *{min-width:0}
.dashboard-bottom{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:16px;align-items:stretch}
.dashboard-bottom .panel{height:100%}
.dashboard-bottom .panel h3{margin-bottom:14px}
.theme-toggle{width:42px;min-width:42px;min-height:43px;display:grid;place-items:center;font-size:19px;padding:0!important}
.quick-fab{position:fixed;left:25px;bottom:26px;z-index:22;direction:rtl;display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.quick-fab-main{width:58px;height:58px;border-radius:19px;border:1px solid rgba(214,179,96,.7);background:linear-gradient(150deg,#214f3c,#0c342b);color:#fff;box-shadow:0 13px 32px rgba(14,53,39,.3);font-weight:500;font-size:26px;display:grid;place-items:center}
.quick-fab-main:hover{transform:translateY(-2px);box-shadow:0 16px 38px rgba(14,53,39,.35)}
.quick-fab-items{display:flex;flex-direction:column;gap:8px;min-width:204px;padding:10px;background:var(--paper);border:1px solid var(--line);border-radius:17px;box-shadow:var(--shadow-strong)}
.quick-fab-items button{display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:var(--text);padding:10px 12px;border-radius:10px;text-align:right;font-weight:600}
.quick-fab-items button:hover{background:var(--tint)}
.quick-fab-items button span{font-size:19px;color:var(--gold)}
.quiet-footer{text-align:center;margin:30px 0 0;color:var(--muted);font-size:11px;letter-spacing:.2px}
/* Dark mode keeps the printed voucher and all accounting logic unchanged. */
html[data-theme="dark"]{color-scheme:dark;--bg:#111d19;--paper:#192822;--text:#ebf2ed;--muted:#a5b8aa;--line:#30453a;--green:#1e6148;--green2:#b5d5bf;--gold:#c5a256;--gold-bright:#cbaa61;--surface-soft:#1f3229;--tint:#213e30;--shadow:0 12px 32px rgba(0,0,0,.15);--shadow-strong:0 18px 50px rgba(0,0,0,.42)}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .content{background:var(--bg)}
html[data-theme="dark"] .btn:not(.secondary):not(.danger):not(.gold){background:#1e664c;border-color:#1e664c}
html[data-theme="dark"] .btn.secondary{background:#1d342a;color:var(--text);border-color:var(--line)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#192a22;color:var(--text);border-color:var(--line)}
html[data-theme="dark"] th{background:#20352a;color:var(--muted)}
html[data-theme="dark"] tr:hover td{background:var(--surface-soft)}
html[data-theme="dark"] .kpi{background:var(--paper)}
html[data-theme="dark"] #dashboardStats .kpi:first-child{background:var(--paper)}
html[data-theme="dark"] .alert{background:#352b1b;border-color:#5d472b;color:#ecd49b}
html[data-theme="dark"] .infobox{background:#2b2b1d;color:#e1d8af}
html[data-theme="dark"] .auth{background:linear-gradient(130deg,#10221b,#18251f)}
html[data-theme="dark"] .authcard{background:var(--paper);border-color:var(--line)}
html[data-theme="dark"] .cash-tabs button[aria-selected="true"]{background:#294435;color:#e6efea}
html[data-theme="dark"] .cash-monitor{background:var(--paper)}
html[data-theme="dark"] .modalbox{background:var(--paper)}
html[data-theme="dark"] .contract-card{background:var(--paper);border-color:var(--line)}
html[data-theme="dark"] .contract-open{background:var(--surface-soft);color:var(--text)}
html[data-theme="dark"] .details-grid>div,html[data-theme="dark"] .reportcards>div{background:var(--surface-soft);border-color:var(--line)}
html[data-theme="dark"] .connection-status{color:#d0e3d5}
@media(max-width:1100px){.shell{grid-template-columns:238px minmax(0,1fr)}.content{padding:27px 20px 76px}.office-sidebar-brand{flex-direction:column;align-items:flex-start}.brand-icon-frame{width:59px;height:59px}.dashboard-bento{grid-template-columns:1fr}.dashboard-duo{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.shell{display:block}.sidebar{position:fixed;inset:0 auto 0 0;width:min(300px,87vw);transform:translateX(-100%);z-index:35;height:100vh;box-shadow:0 20px 50px #0004}.sidebar.open{transform:none;left:0;right:auto}.office-sidebar-brand{flex-direction:row;align-items:center}.content{padding:18px 14px 94px}.toolbar{gap:14px;padding-bottom:16px;margin-bottom:14px}.toolbar h1{font-size:22px}.toolbar .actions{width:100%}.toolbar .actions select{flex:1;min-width:125px!important}.toolbar .actions .btn{padding:9px 11px}.dashboard-hero{min-height:136px!important;padding:21px 20px!important;border-radius:18px!important;grid-template-columns:minmax(0,1fr) 52px!important}.dashboard-hero h2{font-size:21px!important}.hero-emblem{width:55px;height:55px;border-radius:15px;padding:8px}.dashboard-duo,.dashboard-bottom{grid-template-columns:1fr}.grid.two,#dashboardStats{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi{min-height:109px;padding:15px}.kpi strong{font-size:23px}.quick-fab{left:16px;bottom:18px}.quick-fab-main{width:55px;height:55px}.panel{padding:17px;border-radius:16px}.dashboard-bento{gap:11px}}
@media(max-width:460px){#dashboardStats{grid-template-columns:1fr}.toolbar .actions #addEntryTop{display:none}.toolbar .actions #refresh{display:none}.toolbar .actions select{width:calc(100% - 65px);min-width:0!important}.dashboard-hero p{font-size:11px}.dashboard-hero h2{font-size:19px!important}.kpi{min-height:103px}.cash-monitor{padding:17px}}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}
@media print{html[data-theme="dark"]{color-scheme:light}html[data-theme="dark"] body{background:#fff!important;color:#111!important}.quick-fab{display:none!important}}
/* Prevent wide report tables from expanding the mobile dashboard. */
.dashboard-bento>*,.dashboard-duo>*,.dashboard-bottom>*,.dashboard-bottom .panel{min-width:0;max-width:100%}
.dashboard-bottom .tablewrap{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
@media(max-width:760px){html,body{overflow-x:clip}.dashboard-bottom{width:100%;min-width:0}.dashboard-bottom .panel{min-width:0}.dashboard-bottom .tablewrap table{min-width:650px}}
