/* Dark palette covers existing cards, forms, menus and status colors. */
html[data-theme="dark"]{color-scheme:dark;--blue:#54b9e8;--blue-dark:#79cdf2;--blue-soft:#173747;--ink:#e3edf5;--muted:#a3b4c3;--line:#334353;--border:#334353;--surface:#18232f;--bg:#101821;--green:#78d5af;--orange:#edbc73}
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"] .sidebar{background:#18232f}
html[data-theme="dark"] .brand-mark{color:#f3f6fa}
html[data-theme="dark"] .workspace{background:#19283e}
html[data-theme="dark"] .workspace-icon{background:#1a2b3c}
html[data-theme="dark"] .nav-label{color:#a5b1bb}
html[data-theme="dark"] .sidebar nav button{color:#a3afbc}
html[data-theme="dark"] .sidebar nav button:hover{background:#192b3e}
html[data-theme="dark"] .count{background:#19313e}
html[data-theme="dark"] .bot-dot{background:#ddb666}
html[data-theme="dark"] .sidebar-footer{color:#a4b0bc}
html[data-theme="dark"] .environment-bar{background:#3e3019;color:#e8cb9c}
html[data-theme="dark"] .topbar{background:#18232f}
html[data-theme="dark"] .breadcrumb{color:#a6b0ba}
html[data-theme="dark"] .breadcrumb span{color:#a2b2be}
html[data-theme="dark"] .preview-user{color:#a4b1bb}
html[data-theme="dark"] .preview-user select{background:#18232f}
html[data-theme="dark"] .button{background:#18232f}
html[data-theme="dark"] .button:hover{border-color:#324d5d;background:#192b3e}
html[data-theme="dark"] .button.primary{color:#f3f6fa}
html[data-theme="dark"] .button.danger{color:#d09093;border-color:#5d3234}
html[data-theme="dark"] .stat{background:#18232f}
html[data-theme="dark"] .stat-label{color:#a6b1ba}
html[data-theme="dark"] .stat-note{color:#a5b2bb}
html[data-theme="dark"] .panel{background:#18232f}
html[data-theme="dark"] .tabs button{color:#a5b0bb}
html[data-theme="dark"] .tabs .tab-count{background:#1e2d39;color:#a5b1bb}
html[data-theme="dark"] .search>span{color:#a1b2be}
html[data-theme="dark"] .toolbar .result-count{color:#a4b0bc}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border:1px solid #334a5c;background:#18232f}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#a2b2bd}
html[data-theme="dark"] input[readonly]{background:#1a2b3d;color:#a4b0bc}
html[data-theme="dark"] label.field{color:#a5b1bb}
html[data-theme="dark"] .field.required>span::after{color:#cf9090}
html[data-theme="dark"] th{background:#1a2b3d;color:#a4b1bb}
html[data-theme="dark"] td{border-bottom:1px solid #33475c}
html[data-theme="dark"] tbody tr.clickable:hover{background:#192e3e}
html[data-theme="dark"] .cell-sub{color:#a4b0bc}
html[data-theme="dark"] .badge{background:#1e2d39;color:#a5b0bb}
html[data-theme="dark"] .badge.draft{background:#1d2b3a;color:#a3afbd}
html[data-theme="dark"] .badge.issued,html[data-theme="dark"] .badge.approved{background:#193e2a;color:#a3e1c6}
html[data-theme="dark"] .badge.pending,html[data-theme="dark"] .badge.partial{background:#3e3119;color:#e8c99c}
html[data-theme="dark"] .badge.void,html[data-theme="dark"] .badge.rejected{background:#3e1919;color:#c99797}
html[data-theme="dark"] .badge.stale{background:#27193e;color:#b09ac6}
html[data-theme="dark"] .entity{border:1px solid #324d5d;color:#9ab8c6}
html[data-theme="dark"] .entity.tonnam{color:#afa0c0;border-color:#44345b}
html[data-theme="dark"] .empty{color:#a4b1bb}
html[data-theme="dark"] .empty-icon{border:1px solid #324d5d;color:#97b6c9;background:#19303e}
html[data-theme="dark"] .empty h3{color:#a1b3bf}
html[data-theme="dark"] .footer-count{color:#a4b1bc}
html[data-theme="dark"] .notice{background:#192e3e;color:#9eb2c2;border:1px solid #324b5d}
html[data-theme="dark"] .notice.warning{background:#3e3219;color:#d2b98e;border-color:#5d4f32}
html[data-theme="dark"] .customer-summary{color:#a5b1bb}
html[data-theme="dark"] .customer-summary strong{color:#9eb3c2}
html[data-theme="dark"] .items-table th{background:#50a9d0;color:#f3f6fa}
html[data-theme="dark"] .items-table textarea{background:#19253e}
html[data-theme="dark"] .remove-item{color:#a3b2bd}
html[data-theme="dark"] .total-row{color:#a3b1bc}
html[data-theme="dark"] .total-row.net{background:#19313e}
html[data-theme="dark"] .calculation-error{color:#d09090}
html[data-theme="dark"] .editor-footer small{color:#a4b1bb}
html[data-theme="dark"] .approval-card{background:#18232f}
html[data-theme="dark"] .approval-card pre{background:#1a2b3d}
html[data-theme="dark"] .job-card{background:#18232f}
html[data-theme="dark"] .job-card:hover{border-color:#324f5d;box-shadow:0 3px 15px #1c739c08}
html[data-theme="dark"] .job-card footer span{color:#a4b2bc}
html[data-theme="dark"] #toast{background:#243a4a;color:#f3f6fa;box-shadow:0 7px 25px #172f4930}
html[data-theme="dark"] #toast.error{background:#a65555}
html[data-theme="dark"] dialog{box-shadow:0 15px 80px #18385030}
html[data-theme="dark"] dialog::backdrop{background:#1b2d4366}
html[data-theme="dark"] .icon-button{color:#a3b1bd}
html[data-theme="dark"] .error-page h2{color:#c79999}
html[data-theme="dark"] .pill-icon{background:#19313e}
html[data-theme="dark"] .sidebar{box-shadow:10px 0 40px #1a355522}
html[data-theme="dark"] tr.clickable:hover td{background:#19303e}
html[data-theme="dark"] .customer-entry{background:#192f3e}
html[data-theme="dark"] .dashboard-card{background:#18232f;border-top:3px solid #394b56}
html[data-theme="dark"] .dashboard-card-label{color:#a5b1bb}
html[data-theme="dark"] .chart-legend .sales,html[data-theme="dark"] .chart-bar.sales{background:#1d2f3a}
html[data-theme="dark"] .chart-legend .cash,html[data-theme="dark"] .chart-bar.cash{background:#138ac1}
html[data-theme="dark"] .chart-pair{border-bottom:1px solid #334a5c}
html[data-theme="dark"] .chart-month-label{color:#a1b3bf}
html[data-theme="dark"] .chart-month-values{color:#a5b1bb}
html[data-theme="dark"] .chart-month-values small{color:#94d3f0}
html[data-theme="dark"] .dashboard-overdue{background:#3e2f19;color:#e6c89d}
html[data-theme="dark"] .dashboard-document:hover{background:#192d3e}
html[data-theme="dark"] .dashboard-progress{background:#1a2d3c}
html[data-theme="dark"] .dashboard-progress i{background:#64b2d3}
html[data-theme="dark"] .dashboard-rank{background:#19313e;color:#a2d0e1}
html[data-theme="dark"] .tabs button[data-kind="quotation"]{color:#f0c294}
html[data-theme="dark"] .tabs button[data-kind="invoice_delivery"]{color:#b693cd}
html[data-theme="dark"] .tabs button[data-kind="receipt_tax"],html[data-theme="dark"] .tabs button[data-kind="receipt"]{color:#94bcf0}
html[data-theme="dark"] .reference-document{border-left:3px solid #32455d;background:#192a3e}
html[data-theme="dark"] .reference-document[data-kind="quotation"]{border-color:#5d4732;background:#3e2d19}
html[data-theme="dark"] .reference-document[data-kind="invoice_delivery"],html[data-theme="dark"] .reference-document[data-kind="delivery"]{border-color:#4c325d;background:#31193e}
html[data-theme="dark"] .tabs button[data-kind="cash_invoice"]{color:#98ebd0}
html[data-theme="dark"] .cash-sale-payment{background:#193e2b;border:1px solid #325d49}
html[data-theme="dark"] .cash-sale-payment h3{color:#98ebd0}
html[data-theme="dark"] .signature-options{background:#192b3e}
html[data-theme="dark"] .signature-options small{color:#a3b1bd}
html[data-theme="dark"] .document-row-menu{background:#18232f;box-shadow:0 5px 20px #24384b26}
html[data-theme="dark"] .document-row-menu button{background:#18232f}
html[data-theme="dark"] .badge.job-quotation{background:#3e2e19;color:#f0c294}
html[data-theme="dark"] .badge.job-approved{background:#192d3e;color:#95c5ef}
html[data-theme="dark"] .badge.job-working{background:#20193e;color:#a68ed2}
html[data-theme="dark"] .badge.job-delivered{background:#193e3c;color:#98ebe6}
html[data-theme="dark"] .badge.job-invoiced{background:#19213e;color:#8d9ad3}
html[data-theme="dark"] .badge.job-awaiting-payment{background:#3e3719;color:#f0d994}
html[data-theme="dark"] .badge.job-paid{background:#193e20;color:#a3e0b2}
html[data-theme="dark"] .badge.job-rejected{background:#3e1927;color:#e2a2bb}
html[data-theme="dark"] .badge.job-cancelled{background:#3e1e19;color:#e5a79f}
html[data-theme="dark"] .document-delete-item{color:#d38d8d!important}
html[data-theme="dark"] .document-table thead tr{background:#192b3e}
html[data-theme="dark"] .customer-results{background:#18232f;box-shadow:0 8px 22px #18385015}
html[data-theme="dark"] .customer-results button{background:#18232f}
html[data-theme="dark"] .badge.job-awaiting-approval{background:#3e3819;color:#f0d994}
html[data-theme="dark"] .expense-filter-panel summary{border:1px solid var(--border,#32495d)}
html[data-theme="dark"] .expense-filter-panel[open] .form-grid{background:#18232f;border:1px solid #32495d;box-shadow:0 8px 25px #20304020}
html[data-theme="dark"] .expense-panel .badge.paid{background:#193e20;color:#a3e0b2}
html[data-theme="dark"] .expense-panel .badge.unpaid{background:#3e2e19;color:#f0c294}
html[data-theme="dark"] .expense-panel .badge.partial{background:#19213e;color:#8d9ad3}
html[data-theme="dark"] .expense-panel .badge.pending{background:#20193e;color:#a68ed2}
html[data-theme="dark"] .expense-panel .badge.void{background:#3e1e19;color:#e5a79f}
html[data-theme="dark"] .monthly-jobs-table tfoot{background:#19303e}
html[data-theme="dark"] .job-profit-positive{color:#9fe4d2}
html[data-theme="dark"] .job-profit-negative{color:#d28e8e}
html[data-theme="dark"] .supply-offer{border:1px solid var(--border,#324a5d);background:#18232f}
html[data-theme="dark"] .supply-offer:hover{background:#19333e}
html[data-theme="dark"] .supply-offer small{color:#a2b3be}
html[data-theme="dark"] .expense-slip{border:1px solid #32475d;background:#1d283a;color:#a0b2c0}
html[data-theme="dark"] .button.primary{background:#136c96;border-color:#287fa5;color:#f3f6fa}
html[data-theme="dark"] .button.primary:hover{background:#197da9}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border-color:var(--line);background:#121d28;color:var(--ink)}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#8b9faf}
html[data-theme="dark"] dialog::backdrop{background:rgba(0,0,0,.7)}
#theme-toggle{white-space:nowrap}
@media(max-width:650px){.topbar-right{gap:8px}#theme-toggle{padding:8px;font-size:11px}}
html[data-theme="dark"] .chart-legend .sales,html[data-theme="dark"] .chart-bar.sales{background:#759db8}
html[data-theme="dark"] .chart-legend .cash,html[data-theme="dark"] .chart-bar.cash{background:#28a1d4}
