/* Deep charcoal theme, scoped to the existing per-user dark setting. */
:root[data-theme="dark"]{color-scheme:dark;--ink:#f4f6f8;--muted:#b8c0cb;--teal:#8cdeca;--teal-dark:#1f6f61;--mint:#19332e;--paper:#090b0d;--white:#16191d;--line:#30363e;--navy:#0e1013;--red:#ff9caa;--shadow:0 14px 38px #0004}
[data-theme="dark"] .topbar{background:#0e1013f5;border-color:#30363e}
[data-theme="dark"] :is(.panel,.metric-card,.person-card,.report-card,.summary-mini,.modal-card,.auth-card,.quick-action,.report-summary,.view-sort-bar,.page-last-activity){background:#16191d;color:#f4f6f8;border-color:#30363e}
[data-theme="dark"] :is(.page-heading h1,.panel-head h2,.person-card h3,.auth-card h1,.metric-value,.summary-mini strong,.report-card strong,.strong-cell,.balance-value-group,.activity-title){color:#f4f6f8}
[data-theme="dark"] :is(.panel-head,.person-card-head,.person-balance,.activity-row,.bank-balance-row){border-color:#30363e}
[data-theme="dark"] :is(.metric-label,.metric-foot,.form-help,.inline-note,.activity-sub,.muted,.report-card small,.summary-mini span,.page-heading p,.breadcrumb,.breadcrumb strong){color:#b8c0cb}
[data-theme="dark"] .data-table th{background:#20252b;color:#e4e8ec;border-color:#3d454f}
[data-theme="dark"] .data-table td{color:#f4f6f8;border-color:#30363e}
[data-theme="dark"] .data-table tbody tr:nth-child(even){background:#191d22}
[data-theme="dark"] :is(input,select,textarea,.field-control){background:#0d1013;color:#f4f6f8;border-color:#4b535e}
[data-theme="dark"] :is(.button.secondary,.button.ghost,.logout-button){background:#20252b;color:#f4f6f8;border-color:#4b535e}
[data-theme="dark"] .button.primary{background:#247f71;color:#fff}
[data-theme="dark"] .button.danger-soft{background:#352126;color:#ffbdc7;border-color:#72414c}
[data-theme="dark"] :is(.status-pill,.today-chip,.avatar,.metric-icon,.activity-icon){background:#19332e;color:#cbf0e3}
[data-theme="dark"] .status-pill.pending{background:#342b1e;color:#f0ce8a}
[data-theme="dark"] .positive{color:#a1e7c6}
[data-theme="dark"] .negative{color:#ff9caa}
[data-theme="dark"] .total-label-word{color:#c6f1dd!important;background:#233e34}
[data-theme="dark"] .data-table .statement-total-row>td{background:#1b2e26!important;color:#e3f7ec!important;border-color:#486f5c!important}
[data-theme="dark"] .wallet-reconciliation-table .statement-total-row>td:nth-last-child(-n+2){background:#222a34!important;color:#dceaff!important}
[data-theme="dark"] .statement-total-card{background:#1b2e26!important;border-color:#4d7360!important}
[data-theme="dark"] .statement-total-card strong{color:#e3f7ec!important}
[data-theme="dark"] :is(.floating-table-scroll,.floating-table-scroll button){background:#20252b;color:#f4f6f8;border-color:#515d61}
[data-theme="dark"] *{scrollbar-color:#66727c #15191e}
[data-theme="dark"] *::-webkit-scrollbar-track{background:#15191e}
[data-theme="dark"] *::-webkit-scrollbar-thumb{background:#66727c;border-color:#15191e}
[data-theme="dark"] .statement-sequenced td,[data-theme="dark"] .statement-sequenced th{border-inline-end-color:#465650}
[data-theme="dark"] .statement-sequenced.wallet-reconciliation-table .statement-total-row>td:nth-last-child(-n+3){background:#222a34!important}
[data-theme="dark"] :is(.team-presence,.team-person,.page-search-bar,.search-result-button,.search-empty){background:#16191d;color:#f4f6f8;border-color:#30363e}
[data-theme="dark"] :is(.team-presence summary,.team-person strong,.page-search-label,.search-result-button strong){color:#eef3f0}
[data-theme="dark"] :is(.team-presence summary b,.team-account-notice){background:#1b302c;color:#d2eee5;border-color:#3d6156}
[data-theme="dark"] .team-account-notice.warning{background:#342b1e;color:#f0ce8a;border-color:#8e7245}
[data-theme="dark"] :is(.team-help,.team-presence summary small,.team-person small,#page-search-status,.page-last-activity small,.page-last-activity time){color:#b8c0cb}
/* Dark surfaces must accompany light text, including unclassified report footers. */
[data-theme="dark"] .wallet-reconciliation-groups th:first-child{background:#1b2e26;color:#e3f7ec}
[data-theme="dark"] .wallet-reconciliation-groups th:last-child{background:#222a34;color:#dceaff}
[data-theme="dark"] .data-table tfoot{background:#1b2e26;color:#e3f7ec}
[data-theme="dark"] .data-table tfoot tr:not(.statement-total-row)>td{background:#1b2e26;color:#e3f7ec;border-color:#486f5c}
[data-theme="dark"] .wallet-reconciliation-table tfoot tr:not(.statement-total-row):not(.wallet-reconciliation-verdict)>td:nth-last-child(-n+2){background:#222a34;color:#dceaff}
[data-theme="dark"] .statement-sequenced.wallet-reconciliation-table tfoot tr:not(.statement-total-row):not(.wallet-reconciliation-verdict)>td:nth-last-child(-n+3){background:#222a34;color:#dceaff}
[data-theme="dark"] .wallet-reconciliation-table .wallet-reconciliation-verdict>td{background:#1b2e26;color:#e3f7ec;border-color:#486f5c}
[data-theme="dark"] :is(.bulk-toolbar,.calculation-expression,.saved-expression-area,.calculated-field,.batch-entry,.report-text,.team-page-members){background:#1c2025;color:#f0f5f2;border-color:#4b535e}
[data-theme="dark"] :is(.calculated-field strong,.saved-expression-area strong,.saved-expression-area code,.person-balance strong,.bank-balance-row strong,.small-total strong,.report-summary strong,.quick-action span:last-child){color:#e3f7ec}
[data-theme="dark"] :is(.report-summary span,.person-balance,.bank-balance-row,.small-total,.metric-currency,.panel-head p,.modal-head p,.saved-expression-area small){color:#b8c0cb}
[data-theme="dark"] :is(.badge,.person-avatar,.home-version,.close-button,.mobile-menu-button){background:#19332e;color:#d4f3e7;border-color:#416250}
[data-theme="dark"] .report-refresh-status{color:#cbf0e3}
[data-theme="dark"] .data-table tr:has(.bulk-row-select:checked){background:#342b1e}
[data-theme="dark"] .statement-total-card :is(small,span){color:#cee8dc}
[data-theme="dark"] .report-summary strong.positive{color:#a1e7c6}
[data-theme="dark"] .report-summary strong.negative{color:#ff9caa}
html[data-theme="dark"] .bank-account-balance{background:#1a2b27;border-color:#4a6c60}
html[data-theme="dark"] .bank-account-balance strong,html[data-theme="dark"] .bank-account-balance span{color:#e1f7eb}
html[data-theme="dark"] .private-executor-summary .report-card{background:#1b2d27;border-color:#4a6c60}
[data-theme="dark"] .report-center-card{background:#16191d;color:#f4f6f8;border-color:#3d454f}
[data-theme="dark"] .report-center-card.active{background:#19332e;border-color:#83cdb7}
[data-theme="dark"] .report-center-card small{color:#b8c0cb}
[data-theme="dark"] .report-center-icon{background:#203d32;color:#d1eee2}
[data-theme="dark"] .report-center-heading{border-color:#3d454f;background:linear-gradient(120deg,#1b2824,#16191d)}
[data-theme="dark"] .notification-panel{background:#16191d;color:#f4f6f8;border-color:#3d454f}
[data-theme="dark"] .notification-panel>header{border-color:#30363e}
[data-theme="dark"] .notification-item{border-color:#30363e}
[data-theme="dark"] .notification-item.unread{background:#1b3029}
[data-theme="dark"] .notification-item:hover{background:#242a31}
[data-theme="dark"] .notification-item small{color:#b8c0cb}
[data-theme="dark"] .workflow-notices,[data-theme="dark"] .workflow-form-warning{background:#342b1e;color:#ffe0a0}
[data-theme="dark"] .workflow-footer{background:#16191d}
[data-theme="dark"] .custody-closing-bank{background:#16191d;border-color:#3d454f}
[data-theme="dark"] .custody-closing-bank>header{border-color:#3d454f}
[data-theme="dark"] .custody-closing-total,[data-theme="dark"] .custody-closing-bank-footer,[data-theme="dark"] .custody-closing-grid tfoot td,[data-theme="dark"] .custody-closing-grid tfoot th{background:#1b2e26;color:#e3f7ec;border-color:#486f5c}
[data-theme="dark"] .custody-deposit{color:#a6cbff!important}
[data-theme="dark"] .custody-withdraw{color:#ffb3bc!important}
[data-theme="dark"] .tabular-statement-grid th{background:#1e2a23;color:#e3f7ec}
[data-theme="dark"] .tabular-statement-grid td,[data-theme="dark"] .tabular-statement-grid th{border-color:#46544e}
[data-theme="dark"] .tabular-statement-grid .tabular-balance-row td{background:#1e3328;color:#e3f7ec}
[data-theme="dark"] .tabular-statement-grid .tabular-egp{color:#a4cbff}
[data-theme="dark"] .tabular-statement-grid .tabular-paid{color:#ffb2bf}
[data-theme="dark"] .tabular-statement-grid .tabular-running{color:#b9e8ce}
[data-theme="dark"] .sidebar-close{background:#19332e;color:#e3f7ec;border-color:#416250}
[data-theme="dark"] .team-chat-panel{background:#16191d;color:#f4f6f8;border-color:#3d454f}
[data-theme="dark"] :is(.team-chat-tabs button,.team-chat-people button){background:#20252b;color:#e3e8e5;border-color:#3d454f}
[data-theme="dark"] :is(.team-chat-tabs button.active,.team-chat-people button.active){background:#247f71;color:#fff}
[data-theme="dark"] .team-chat-room{border-color:#30363e}
[data-theme="dark"] .team-chat-history{background:#0d1013}
[data-theme="dark"] .team-chat-message{background:#22272e;color:#f4f6f8}
[data-theme="dark"] .team-chat-message.mine{background:#1b4033}
[data-theme="dark"] .team-chat-message strong{color:#b0e8d0}
[data-theme="dark"] :is(.team-chat-message small,.team-chat-empty){color:#b8c0cb}
[data-theme="dark"] .team-chat-error{color:#ffc6a6}

/* The account setting controls the whole app; exported files keep their own appearance. */
:root[data-theme="dark"]{--surface:var(--white);--text:var(--ink);--border:var(--line);--background:var(--paper);--dark-primary:#247f71;--dark-positive:#a1e7c6;--dark-negative:#ff9caa;font-family:Tahoma,Arial,sans-serif;color:var(--ink);text-rendering:optimizeLegibility}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink);font-family:Tahoma,Arial,sans-serif}
html[data-theme="dark"] :is(.sidebar,.topbar){background:var(--navy);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .sidebar :is(.brand strong,.mobile-brand){color:var(--ink)}
html[data-theme="dark"] .sidebar :is(.brand small,.sidebar-label,.nav-separator,.secure-note,.nav-icon){color:var(--muted)}
html[data-theme="dark"] .sidebar .nav-item{color:#d7dee5}
html[data-theme="dark"] .sidebar .nav-item:hover{background:#1c2025;color:var(--ink)}
html[data-theme="dark"] .sidebar .nav-item.active{background:var(--mint);color:#e7fff6;box-shadow:inset -3px 0 #83cdb7;font-weight:700}
html[data-theme="dark"] :is(.brand-mark,.person-avatar){background:var(--mint);color:#c6f1dd}
html[data-theme="dark"] :is(.sidebar-close,.close-button,.mobile-menu-button){background:#20252b;color:var(--ink);border-color:#4b535e}
html[data-theme="dark"] :is(.sidebar-bottom,.modal-head,.modal-foot,.panel-foot,.table-wrap,.report-grid){border-color:var(--line)}
html[data-theme="dark"] .modal-backdrop{background:#000b;backdrop-filter:blur(5px)}
html[data-theme="dark"] :is(.modal-card,.modal-body,.modal-head){background:var(--white);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.form-grid label,.form-stack label,.report-layout-control,.form-label){color:var(--muted)}
html[data-theme="dark"] :is(input,select,textarea,.field-control){background:#0d1013;color:var(--ink);border-color:#4b535e;caret-color:#b4eddf}
html[data-theme="dark"] ::placeholder{color:#a2adb8;opacity:1}
html[data-theme="dark"] :is(input,select,textarea):disabled{color:var(--muted);background:#1c2025;opacity:1}
html[data-theme="dark"] :is(button,input,select,textarea):focus-visible{outline:3px solid #83cdb7;outline-offset:2px}
html[data-theme="dark"] .button.primary{background:var(--dark-primary);color:#fff;border-color:var(--dark-primary)}
html[data-theme="dark"] .button.primary:hover{background:#1f6f61;border-color:#1f6f61}
html[data-theme="dark"] :is(.button.secondary,.button.ghost,.logout-button){background:#20252b;color:var(--ink);border-color:#4b535e}
html[data-theme="dark"] :is(.button.secondary,.button.ghost,.logout-button):hover{background:#2a3038;color:#fff;border-color:#66727c}
html[data-theme="dark"] :is(.positive,.report-summary strong.positive){color:var(--dark-positive)}
html[data-theme="dark"] :is(.negative,.report-summary strong.negative){color:var(--dark-negative)}
html[data-theme="dark"] :is(.calculated-field,.batch-entry,.workflow-request,.bank-import-row,.day-close-bank,.bank-action-group){background:#1c2025;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.calculated-field strong,.request-batch-summary strong,.report-grid strong){color:var(--ink)}
html[data-theme="dark"] :is(.team-help,.page-last-activity time,.movement-actor,.movement-actor time,.movement-actor small,.team-person small,.form-help,.inline-note,.panel-head p,.modal-head p,.metric-foot,.activity-sub,.bank-route-badge){color:var(--muted)}
html[data-theme="dark"] .data-table tbody tr:not(.statement-total-row):not(.tabular-balance-row):hover{background:#23292f}
html[data-theme="dark"] .data-table tr:has(.bulk-row-select:checked){background:#342b1e}
html[data-theme="dark"] :is(.report-center-heading,.report-review-pane){background:var(--white);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(.report-center-card,.quick-action){background:var(--white);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(.report-center-card.active,.quick-action:hover){background:var(--mint);border-color:#83cdb7}
html[data-theme="dark"] :is(.notification-panel,.team-chat-panel){background:var(--white);color:var(--ink);border-color:#4b535e;box-shadow:0 16px 55px #0008}
html[data-theme="dark"] :is(.notification-panel>header,.team-chat-head){background:var(--navy);color:var(--ink);border-bottom:1px solid var(--line)}
html[data-theme="dark"] :is(.team-chat-composer,.team-chat-tabs,.team-chat-people,.team-chat-room){background:var(--white);border-color:var(--line)}
html[data-theme="dark"] .team-chat-history{background:var(--paper)}
html[data-theme="dark"] .team-chat-message{background:#22272e;color:var(--ink)}
html[data-theme="dark"] .team-chat-message.mine{background:#1b4033;color:#f0fff7}
html[data-theme="dark"] .team-chat-message strong{color:#b0e8d0}
html[data-theme="dark"] :is(.team-chat-message small,.team-chat-empty,.team-chat-room span,.notification-item small){color:var(--muted)}
html[data-theme="dark"] .team-chat-composer textarea{background:#0d1013;border-color:#4b535e}
html[data-theme="dark"] :is(.team-chat-tabs button,.team-chat-people button){background:#20252b;color:var(--ink);border-color:#4b535e}
html[data-theme="dark"] :is(.team-chat-tabs button.active,.team-chat-people button.active){background:var(--dark-primary);color:#fff;border-color:#509b8d}
html[data-theme="dark"] mark{background:#34452d;color:#f0f6ec}
html[data-theme="dark"] *{scrollbar-color:#66727c #15191e}
html[data-theme="dark"] *::-webkit-scrollbar-track{background:#15191e}
html[data-theme="dark"] *::-webkit-scrollbar-thumb{background:#66727c;border-color:#15191e}
