:root{color-scheme:light;--surface:#fff;--surface-soft:#f4f8f1;--field-bg:#fff;--field-border:#dfe6dd;--label:#6e7d71;--muted-new:#89998b;--positive:#427b50;--positive-bg:#edf5e9;--negative:#ba6557}
[hidden]{display:none!important}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:8px 10px;font-size:10px;color:var(--label);min-height:34px;white-space:nowrap;flex-shrink:0}.theme-toggle:hover{border-color:#91ae97;background:var(--surface-soft)}.login-brand-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.login-brand-row .brand{padding:0}.top-right{gap:15px}
.period-panel{background:var(--surface);border:1px solid var(--line);padding:14px 18px 12px;border-radius:10px;margin-bottom:19px}.period-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.period-caption{display:flex;align-items:center;gap:10px;color:var(--label)}.period-caption b{display:block;font-size:11px;color:var(--ink);font-weight:650}.period-caption small{display:block;font-size:9px;margin-top:4px;color:var(--muted-new)}.period-note{color:var(--muted-new);font-size:9px;margin:10px 0 0;line-height:1.7}.date-range{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;padding-top:15px;margin-top:12px;border-top:1px solid var(--line)}.date-range label{display:block;font-size:9px;font-weight:600;color:var(--label);margin-bottom:6px}.date-range input{background:var(--field-bg);border:1px solid var(--field-border);color:var(--ink);padding:8px 10px;border-radius:6px;height:36px;font-size:11px;min-width:145px}.date-range .btn{padding:10px 15px;height:36px}.date-error{width:100%;margin:0;font-size:10px;color:var(--negative)}.date-error:empty{display:none}
.card-bundles{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:9px;color:var(--label);margin-top:10px;padding:8px 9px;border-radius:6px;background:var(--positive-bg)}.card-bundles b{font-size:15px;color:var(--positive);font-variant-numeric:tabular-nums;font-weight:750}.card-loose{font-size:8px;color:var(--muted-new);margin-top:6px;text-align:right;line-height:1.5}.stock-line{margin-top:10px}
.quantity-editor{border:1px solid var(--line);border-radius:9px;padding:14px;margin:0 0 17px;background:var(--surface-soft)}.quantity-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}.quantity-heading label{font-size:10px;font-weight:650;color:var(--label)}.quantity-heading select{border:1px solid var(--field-border);border-radius:6px;background:var(--field-bg);color:var(--ink);padding:8px;font-size:10px;max-width:190px}.quantity-editor .form-field{margin-bottom:9px}.quantity-total{font-size:11px;font-weight:650;color:var(--positive);line-height:1.7}.quantity-total.invalid{color:var(--negative)}
/* Dark surfaces, readable controls, and clear status colors on every page. */
:root[data-theme=dark]{color-scheme:dark;--bg:#171220;--paper:#211a2b;--ink:#ece5f5;--muted:#a99bb9;--line:#3c304c;--green:#b79bd8;--soft:#342544;--surface:#211a2b;--surface-soft:#2a2035;--field-bg:#1c1525;--field-border:#4c395e;--label:#cbbadb;--muted-new:#a99bb9;--positive:#c9aae9;--positive-bg:#362647;--negative:#f1a193}
[data-theme=dark] body{background:var(--bg);color:var(--ink)}
[data-theme=dark] .sidebar,[data-theme=dark] .stat,[data-theme=dark] .product-card,[data-theme=dark] .panel,[data-theme=dark] .modal,[data-theme=dark] .login-page,[data-theme=dark] .login-form-side,[data-theme=dark] .empty{background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] .topbar{background:#1c1626f2;border-color:var(--line)}
[data-theme=dark] .workspace,[data-theme=dark] .server-note,[data-theme=dark] .product-preview,[data-theme=dark] .stat-icon,[data-theme=dark] .td-product .tile{background:var(--surface-soft);border-color:var(--line)}
[data-theme=dark] .workspace-icon,[data-theme=dark] .avatar,[data-theme=dark] .player-avatar{background:#312a37;color:#c3b8d4;border-color:#3e3447}
[data-theme=dark] .brand-name small{color:#b2a5bf}
[data-theme=dark] .workspace small,[data-theme=dark] .server-note p,[data-theme=dark] .profile small,[data-theme=dark] .nav-label,[data-theme=dark] .stat-top,[data-theme=dark] .stat-unit,[data-theme=dark] .stat-foot,[data-theme=dark] .subtitle,[data-theme=dark] .category-label,[data-theme=dark] .card-stock,[data-theme=dark] .price-unit,[data-theme=dark] .card-price small,[data-theme=dark] .panel-title small,[data-theme=dark] .td-product small,[data-theme=dark] .crumb,[data-theme=dark] .top-right,[data-theme=dark] .list-footer,[data-theme=dark] .page-footer,[data-theme=dark] .results-note,[data-theme=dark] .activity-row small,[data-theme=dark] .modal-desc,[data-theme=dark] .form-field small,[data-theme=dark] .product-preview small,[data-theme=dark] .login-content p,[data-theme=dark] .login-copyright,[data-theme=dark] .picker-heading>span,[data-theme=dark] .picker-result-note,[data-theme=dark] .picker-item small,[data-theme=dark] .selected-item small{color:var(--muted-new)}
[data-theme=dark] .crumb b,[data-theme=dark] .card-stock b,[data-theme=dark] .form-field label,[data-theme=dark] .picker-heading label,[data-theme=dark] .sale-total{color:var(--label)}
[data-theme=dark] .nav-link{color:#b0a7b9}[data-theme=dark] .nav-link.active{background:#32253e;color:#c5b2db}[data-theme=dark] .nav-link:hover{background:#2d2138}[data-theme=dark] .nav-count{background:#443554;color:#d0c3e0}
[data-theme=dark] .demo-pill{background:#2b2436;border-color:#3b314b;color:#b8a7d5}
[data-theme=dark] input,[data-theme=dark] select,[data-theme=dark] .form-field input,[data-theme=dark] .form-field select,[data-theme=dark] .search input,[data-theme=dark] .select{background:var(--field-bg);border-color:var(--field-border);color:var(--ink)}
[data-theme=dark] input::placeholder{color:#8c8197}[data-theme=dark] .search svg{color:#a59bb1}
[data-theme=dark] .btn.primary{background:#7853a3;color:#faf5ff}[data-theme=dark] .btn.primary:hover{background:#8b64b7}
[data-theme=dark] .btn.secondary,[data-theme=dark] .icon-button{background:#291f32;border-color:#443a4f;color:#c4b9d1}[data-theme=dark] .btn.secondary:hover,[data-theme=dark] .icon-button:hover{background:#362943}
[data-theme=dark] .btn.text{color:#bca7d9}[data-theme=dark] .btn.danger{background:#492b28;color:#f2b2a5}
[data-theme=dark] .tabs{background:#241b2d}[data-theme=dark] .tab{color:#a095ac}[data-theme=dark] .tab.active{background:#3f324d;color:#e5deee}[data-theme=dark] .tab span{background:#4d3f5c;color:#d7cde6}
[data-theme=dark] .product-picture{background:#2b2233}[data-theme=dark] .product-picture:after{background:#0003}[data-theme=dark] .card-more{color:#b9b0c4}[data-theme=dark] .card-more:hover{background:#3e3349}
[data-theme=dark] .stock-badge,[data-theme=dark] .chip{background:#3b2c4a;color:#c5b3da}[data-theme=dark] .stock-badge.low,[data-theme=dark] .chip.amber{background:#4a3d23;color:#e7c77f}[data-theme=dark] .stock-badge.out{background:#492d29;color:#e7aa9c}[data-theme=dark] .chip.gray{background:#352f3c;color:#b8b0c0}
[data-theme=dark] .stock-line{background:#392f43}[data-theme=dark] .stock-line span{background:#a689c5}[data-theme=dark] .stock-line.low span{background:#c7ac6a}[data-theme=dark] .card-bottom .btn{background:#362a43;color:#cbbbdf;border-color:#463954}
[data-theme=dark] .stat-foot.green,[data-theme=dark] .activity-price,[data-theme=dark] .sale-total b{color:#b7a3d2}[data-theme=dark] .stat-foot.amber{color:#d7bc7a}
[data-theme=dark] th{background:#1b1421;color:#b2a8bd;border-color:var(--line)}[data-theme=dark] td,[data-theme=dark] .activity-row{border-color:var(--line)}[data-theme=dark] .donut-inner{background:var(--surface)}[data-theme=dark] .donut-inner small{color:var(--muted-new)}
[data-theme=dark] .modal-backdrop{background:#09050db3}[data-theme=dark] .close{color:#bdb2c9}[data-theme=dark] .form-error{background:#4c2b27;color:#ffc1b2}
[data-theme=dark] .radio-card{border-color:#43394d}[data-theme=dark] .radio-card:has(input:checked){background:#362a43;border-color:#8973a7}[data-theme=dark] .radio-card small{color:#a99dba}
[data-theme=dark] .info-box,[data-theme=dark] .pricing-block{background:#2c2137;border-color:#423751;color:#b9a9d2}[data-theme=dark] .pricing-title{color:#b2a1cb}[data-theme=dark] .price-summary{color:#b9a5d7}
[data-theme=dark] .selected-item{background:#2c2137;border-color:#493a60}[data-theme=dark] .selected-item>span{color:#bba7da}
[data-theme=dark] .picker-item{background:#231a2c;border-color:#3f364c}[data-theme=dark] .picker-item:hover{background:#352941;border-color:#866fa9}[data-theme=dark] .picker-item.selected{background:#3c2f4d;border-color:#9379bf;box-shadow:0 0 0 1px #9379bf}[data-theme=dark] .picker-more{background:#352a41;color:#c2b2db}
[data-theme=dark] .product-editor .modal-footer{background:linear-gradient(#1e1824ee,#211a2b)}
[data-theme=dark] .sale-total,[data-theme=dark] .page-footer{border-color:var(--line)}
[data-theme=dark] .list-footer .kbd{background:#2e2538;border-color:#493f56;color:#ccc3d8}[data-theme=dark] .mode-warning{background:#3b3522;border-color:#5a5030;color:#d7c997}[data-theme=dark] .login-note{color:#a297af!important}
[data-theme=dark] .load-screen{color:#b9a6d3}[data-theme=dark] #toast{background:#49355e}
[data-theme=dark] [style*="color:#9"],[data-theme=dark] [style*="color:#8"]{color:var(--muted-new)!important}[data-theme=dark] [style*="color:#5d4479"]{color:#b9a4d7!important}
@media(max-width:800px){.theme-toggle span{display:none}.theme-toggle{width:34px;padding:8px}.top-right{gap:9px}.period-panel{padding:13px 14px}.date-range>div{flex:1}.date-range input{width:100%}.login-brand-row .theme-toggle span{display:none}}
@media(max-width:480px){.period-panel{padding:12px}.period-caption b{font-size:10px}.period-caption small{font-size:8px}.period-note{font-size:8px}.period-heading{gap:8px}.period-heading .select{width:131px;font-size:9px}.date-range{gap:8px}.date-range>div{flex-basis:calc(50% - 8px);min-width:0}.date-range input{min-width:0;font-size:10px;padding:8px 5px}.date-range .btn{width:100%}.card-bundles{font-size:8px;padding:6px;gap:4px}.card-bundles b{font-size:13px}.card-loose{font-size:7px}.quantity-editor{padding:12px}.quantity-heading{gap:8px}.quantity-heading label{font-size:9px}.quantity-heading select{font-size:9px;max-width:160px}.quantity-total{font-size:10px}.login-brand-row .brand-name{font-size:23px}}

.delete-product{color:var(--negative)}.delete-product:hover{border-color:#d59b92;background:#fff0ed}.delete-warning{background:#fff3ef;border-color:#eed2c9;color:#a66654}.delete-confirm .modal-footer .primary{background:#b35f55}.delete-confirm .modal-footer .primary:hover{background:#9b4c43}
[data-theme=dark] button:focus-visible,[data-theme=dark] a:focus-visible{outline-color:#b49ad4}[data-theme=dark] input:focus,[data-theme=dark] select:focus{border-color:#b49ad4!important;box-shadow:0 0 0 3px #b49ad41c}[data-theme=dark] .delete-product:hover{background:#482b37;border-color:#b37483}[data-theme=dark] .delete-warning{background:#3e2732;border-color:#65404b;color:#f0b5b6}[data-theme=dark] .delete-confirm .modal-footer .primary{background:#a35867}[data-theme=dark] .delete-confirm .modal-footer .primary:hover{background:#b86b7a}
.sale-actions{justify-content:flex-end}.sale-record-preview{padding:14px;border:1px solid var(--line);border-radius:8px;background:var(--surface-soft);margin-bottom:18px}.sale-record-preview>div{display:flex;align-items:baseline;justify-content:space-between;gap:18px;margin:9px 0}.sale-record-preview span{color:var(--muted-new);font-size:10px}.sale-record-preview b{font-size:11px;text-align:right;overflow-wrap:anywhere}.sale-correction-note{margin-bottom:18px}.correction-price-note{display:inline-block;margin-top:6px;font-size:9px;opacity:.8}

/* Violet chart colors stay distinct from either theme's panel background. */
:root{--chart-1:#7645bd;--chart-2:#a26ac8;--chart-3:#5e3b86;--chart-4:#9470bd;--chart-5:#9b56ab;--chart-empty:#e4dcee;--chart-edge:#d9cbe9}
:root[data-theme=dark]{--chart-1:#b18aed;--chart-2:#ceacf6;--chart-3:#9061d3;--chart-4:#e4cdfa;--chart-5:#ac73c5;--chart-empty:#4a365e;--chart-edge:#6b5286}
.donut,.donut-inner{box-shadow:0 0 0 1px var(--chart-edge)}
