/* Dark-only surface hierarchy. Geometry and light-theme styles remain shared. */
:root[data-theme=dark]{--bg:#121311;--card:#22231f;--surface:#2b2c25;--input:#181a17;--line:#665a40;--text:#f2eee5;--muted:#c8bfad;--gold:#e4c785;--gold2:#c5a15b;--shadow:0 12px 28px #00000024;--control-line:#948362}
:root[data-theme=dark] body{background:radial-gradient(ellipse at 95% 0,#b5903d0d,transparent 48%),var(--bg)}
:root[data-theme=dark] .topbar{background:#1d1f1b;border-bottom-color:#75613d;box-shadow:0 1px 0 #d7b36612,0 6px 22px #00000020}
:root[data-theme=dark] .sidebar{background:linear-gradient(180deg,#1b1c18,#131512);border-inline-end-color:#75613d}
:root[data-theme=dark] :is(.card,.dash-panel,.cash-account-card,.login-shell){background:linear-gradient(150deg,#bfa3610b,transparent 45%),var(--card);border-color:var(--line);box-shadow:inset 0 1px 0 #ead09b16,0 0 20px #b8923e08,0 10px 26px #00000022}
:root[data-theme=dark] :is(.stat,.dash-hero){background:linear-gradient(135deg,#c6a45f12,transparent 65%),var(--card);border-color:var(--line);border-top-color:var(--gold2);box-shadow:inset 0 1px 0 #e4c78512,0 8px 22px #00000020}
:root[data-theme=dark] :is(.people-record,.portal-user,.dash-detail,.dash-estimate){background:#272923;border-color:#706044;box-shadow:inset 0 1px 0 #e4c7850d}
:root[data-theme=dark] :is(.people-details,.portal-user-editor){background:#1e211c;border-top-color:#897047}
:root[data-theme=dark] :is(.people-summary:hover,.people-record[open]>.people-summary,.portal-user[open]>.portal-user-summary){background:#303127}
:root[data-theme=dark] .card .card{background:#282a23;box-shadow:inset 0 1px 0 #e4c78512}
:root[data-theme=dark] .table-wrap{border-color:#756342;background:var(--card)}
:root[data-theme=dark] table.data th{background:#333328;color:#ded0ae;border-bottom-color:#897047}
:root[data-theme=dark] table.data td{border-bottom-color:#564d39}
:root[data-theme=dark] table.data tr:hover td{background:#2d3027}
:root[data-theme=dark] :is(.field input,.field select,.field textarea,input[type=month],input[type=datetime-local]){background:var(--input);border-color:var(--control-line)}
:root[data-theme=dark] :is(input,select,textarea):focus{border-color:#e4c785;box-shadow:0 0 0 3px #e4c78524;outline:2px solid transparent}
:root[data-theme=dark] :is(.btn.secondary,.tabs a:not(.active),.people-expand,.portal-user-toggle,.theme-toggle,.mobile-nav summary){background:#303127;border-color:var(--control-line);color:#eddfbf}
:root[data-theme=dark] .btn:not(.gold):not(.red){border-color:var(--control-line)}
:root[data-theme=dark] :is(.btn.secondary:hover,.tabs a:not(.active):hover,.people-expand:hover){background:#3a3b2e;border-color:#d3b477}
:root[data-theme=dark] :is(.people-record-actions,.portal-user-editor .account-actions,.cash-edit){border-color:#756342}
:root[data-theme=dark] .dash-quick{background:var(--card);border-color:var(--line);box-shadow:inset 0 1px 0 #e4c78512}
:root[data-theme=dark] :is(.sidebar a:hover,.sidebar summary:hover){background-color:#bda05e16}
@media(forced-colors:active){:root[data-theme=dark] :is(.card,.stat,.people-record,.cash-account-card){box-shadow:none;border-color:CanvasText}}

/* 2.1.2: embedded reports keep email colors in outgoing mail, use portal colors on screen. */
@media screen{
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report,.employee-report,.report-preview-shell){color:var(--text)}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) :is(td,th,p,span,strong,div,h1,h2,h3,h4,li){color:var(--report-ink,var(--text))!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) a{color:#f2d691!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) [style*="#15803d"],:root[data-theme=dark] .content .success{color:#80efb1!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) [style*="#b91c1c"],:root[data-theme=dark] .content .danger{color:#ffaaa3!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) [style*="#8a6116"]{color:#f2d691!important}
:root[data-theme=dark] .content :is(input,textarea,select){color:var(--text);background-color:var(--input);color-scheme:dark}
:root[data-theme=dark] .content ::placeholder{color:#c8bfad;opacity:1}
:root[data-theme=dark] .content :is(.muted,.help,small){color:var(--muted)}
:root[data-theme=dark] .content :is(.list-controls,.field,.data) :is(label,td,th,option){color:var(--text)}
}

@media screen{
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) [style*="background"]{background:var(--surface)!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) :is([style*="#15803d"],[style*="#166534"],[style*="#16a34a"]){--report-ink:#80efb1;color:var(--report-ink)!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) :is([style*="#b91c1c"],[style*="#dc2626"],[style*="#991b1b"]){--report-ink:#ffaaa3;color:var(--report-ink)!important}
:root[data-theme=dark] .content :is(.email-preview-inline,.preview-report) [style*="#8a6116"]{--report-ink:#f2d691;color:var(--report-ink)!important}
}
