/* Screen preferences never recolor receipts, labels or other printed pages. */
:root{color-scheme:light}
.scanner-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:17px}
.scanner-heading>strong{font-size:.9rem}
.scanner-heading .text-button{display:inline-flex;align-items:center;gap:9px}
.scanner-heading kbd{padding:3px 5px;border:1px solid var(--border);border-bottom-width:2px;border-radius:4px;background:#faf7ef;color:var(--ink);font:10px ui-monospace,monospace}
#scan-pending{margin-top:12px}
#family-choice{margin:17px 0 0}
#family-choice p{margin:0 0 7px;font-size:.83rem}
#family-choice .text-button{padding:5px 0;color:inherit;text-decoration:underline;text-underline-offset:3px}
#scan-errors{margin:17px 0 0}
#scan-errors p{font-size:.83rem;margin:6px 0}
.scan-error-item{border-top:1px solid currentColor;padding:12px 0 0;margin-top:12px}
.scan-error-item>strong{overflow-wrap:anywhere}
.scan-error-actions{display:flex;flex-wrap:wrap;gap:10px 20px}
.scan-error-actions .text-button{color:inherit;text-decoration:underline;text-underline-offset:3px;padding:5px 0}
.topbar-actions{display:flex;align-items:center;gap:18px;min-width:0}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;min-height:36px;padding:8px 11px;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--ink);font-size:.76rem;font-weight:600;white-space:nowrap}
.theme-toggle:hover{background:#f4ecd8}
.theme-toggle .icon{width:17px;height:17px}
.theme-toggle:focus-visible,a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid #ac812d;outline-offset:3px}
.theme-sun{display:none}
[data-theme=dark] .theme-moon{display:none}
[data-theme=dark] .theme-sun{display:block}
.auth-theme-controls{display:flex;justify-content:flex-end;max-width:1000px;margin:0 auto 15px}

@media screen{
  :root[data-theme=dark]{color-scheme:dark;--ink:#f0ece3;--muted:#b5b0a5;--navy:#171715;--emerald:#e3be6a;--emerald-dark:#eed18a;--cream:#121210;--border:#403d35;--soft:#302e27;--white:#211f1b;--danger:#ffaaa4;--shadow:0 7px 28px #0002;background:#121210;color:#f0ece3}
  [data-theme=dark] body:not(.print-body){background:#121210;color:var(--ink)}
  [data-theme=dark] .sidebar{background:#171715;border-right:1px solid #322e25;color:#d6cdbd}
  [data-theme=dark] .sidebar-bottom small{color:#b6aa92}
  [data-theme=dark] .topbar{background:#1d1c18}
  [data-theme=dark] .topbar-context span{color:#878174}
  [data-theme=dark] .panel,[data-theme=dark] .metric-card,[data-theme=dark] .sale-meta,[data-theme=dark] .auth-card{background:#211f1b}
  [data-theme=dark] .metric-featured{background:#2d271a;border-color:#69562c}
  [data-theme=dark] .metric-featured strong{color:#f4d48e}
  [data-theme=dark] .metric-card small{color:#b4ad9d}
  [data-theme=dark] .accent-panel,[data-theme=dark] .filter-bar{background:#27231a;border-color:#50452e}
  [data-theme=dark] .filter-bar label{color:#c5bba7}
  [data-theme=dark] .shortcut-list>a{border-color:#50452e}
  [data-theme=dark] input,[data-theme=dark] select,[data-theme=dark] textarea{background:#181714;border-color:#595348;color:var(--ink)}
  [data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder{color:#aaa293;opacity:1}
  [data-theme=dark] input:focus,[data-theme=dark] select:focus,[data-theme=dark] textarea:focus{border-color:#e3be6a;box-shadow:0 0 0 3px #e3be6a24}
  [data-theme=dark] .button-primary{background:#e3be6a;color:#241c0c;box-shadow:none}
  [data-theme=dark] .button-primary:hover{background:#eed18a}
  [data-theme=dark] .button-secondary,[data-theme=dark] .icon-button,[data-theme=dark] .theme-toggle,[data-theme=dark] .quantity-control button{background:#29261f;color:var(--ink);border-color:#595348}
  [data-theme=dark] .button-secondary:hover,[data-theme=dark] .icon-button:hover,[data-theme=dark] .theme-toggle:hover{background:#3a3325;color:#f8dfaa}
  [data-theme=dark] .avatar{background:#393020;color:#f2d18c}
  [data-theme=dark] th{background:#29261f;color:#bdb5a5}
  [data-theme=dark] th,[data-theme=dark] td{border-color:#3c382f}
  [data-theme=dark] .table-search input{background:#181714}
  [data-theme=dark] .empty-state,[data-theme=dark] .cart-empty{color:#b5ac9c}
  [data-theme=dark] .count-pill,[data-theme=dark] .badge{background:#343128;color:#d5cbbb}
  [data-theme=dark] .badge-success,[data-theme=dark] .session-pill{background:#203a2c;border-color:#446a51;color:#b7e9c6}
  [data-theme=dark] .badge-warning,[data-theme=dark] .stock-low{background:#463719;color:#f5d684}
  [data-theme=dark] .badge-muted{background:#34312b;color:#c4beaf}
  [data-theme=dark] .stock-quantity{background:#3d321c;color:#f1d58f}
  [data-theme=dark] .stock-quantity.stock-low{background:#463719;color:#f5d684}
  [data-theme=dark] .stock-period-summary span{color:#beb49f}
  [data-theme=dark] .stock-period-summary strong{color:#f3e5bd}
  [data-theme=dark] .notice-error{background:#432522;color:#ffd0cb;border-color:#804039}
  [data-theme=dark] .notice-success{background:#203a2c;color:#c3edd0;border-color:#41654d}
  [data-theme=dark] .notice-info{background:#233449;color:#c2dbfc;border-color:#425d80}
  [data-theme=dark] .user-edit-form,[data-theme=dark] .return-form{background:#29261f}
  [data-theme=dark] .opening-illustration{background:#393020;color:#f2d18c}
  [data-theme=dark] .product-card{background:#27241f;border-color:#504a3e}
  [data-theme=dark] .product-card:hover{background:#332d21;border-color:#d7b875}
  [data-theme=dark] .product-bottom{border-color:#464034}
  [data-theme=dark] .product-bottom small{color:#c1b8a4}
  [data-theme=dark] .input-icon,[data-theme=dark] .table-search .icon{color:#bdb19a}
  [data-theme=dark] .scanner-heading kbd{background:#302a1f}
  [data-theme=dark] .cart-total{background:#36301f}
  [data-theme=dark] .cart-total span{color:#dfc68f}
  [data-theme=dark] .auth-shell{background:radial-gradient(ellipse at top left,#393020,transparent 60%),#121210!important}
  [data-theme=dark] .auth-brand{color:#f5dfac}
  [data-theme=dark] .auth-brand small{color:#d1b775}
  [data-theme=dark] .secure-note,[data-theme=dark] .auth-footer,[data-theme=dark] .app-footer{color:#b0a691}
  [data-theme=dark] .theme-toggle:focus-visible,[data-theme=dark] a:focus-visible,[data-theme=dark] button:focus-visible,[data-theme=dark] summary:focus-visible{outline-color:#f0cf82}
}

@media(max-width:900px){.topbar-actions{margin-left:auto;gap:13px}.topbar-context{display:none}.topbar{gap:13px}}
@media(max-width:680px){.theme-toggle{width:36px;height:36px;padding:8px}.theme-toggle [data-theme-label]{display:none}.auth-theme-controls .theme-toggle{width:auto;min-width:110px}.auth-theme-controls [data-theme-label]{display:inline}.topbar-actions{gap:9px}.user-chip{gap:7px}.user-chip strong{max-width:135px}.user-chip form{margin-left:2px}}
@media(max-width:380px){.user-chip .avatar{display:none}.user-chip strong{max-width:125px}}
@media print{:root,html,body{color-scheme:light;background:#fff;color:#111}.theme-toggle,.auth-theme-controls{display:none!important}}
