/* Deck Burger: one shared interface layer. Legacy module layout remains in style.css. */
:root {
  color-scheme: dark;
  --bg:#090a0c; --panel:#101215; --panel-2:#191c21; --field:#111419;
  --ink:#f1f2f4; --muted:#959aa5; --line:#252931; --line-strong:#3a404b;
  --brand:#f04444; --brand-strong:#ff5b58; --brand-ink:#fff; --brand-soft:#2c171b;
  --action:#ce2939; --action-hover:#c02535;
  --side:#0c0e11; --side-ink:#a6abb5; --side-group:#747a87;
  --ok:#64c7a3; --ok-bg:#132b24; --bad:#ff7979; --bad-bg:#321a20;
  --warn:#dfb669; --warn-bg:#302719; --info-bg:#1b2431; --info-ink:#9bbcf0;
  --row-hover:#191d24; --radius:6px; --shadow:0 12px 40px #0005;
  --head:"Aptos Display","Segoe UI",Arial,sans-serif;
}
:root[data-theme="claro"] {
  color-scheme:light; --bg:#f3f4f6; --panel:#fff; --panel-2:#eceef2; --field:#fff;
  --ink:#1a1f28; --muted:#626a78; --line:#dce0e6; --line-strong:#c0c6d0;
  --brand:#c22631; --brand-strong:#b21e24; --brand-ink:#fff; --brand-soft:#fbe8e9;
  --action:#c02535; --action-hover:#ad1e2c;
  --side:#0c0e11; --side-ink:#a6abb5; --row-hover:#f4f6f8;
  --ok:#217656; --ok-bg:#e6f4eb; --bad:#be2934; --bad-bg:#fce9eb;
  --warn:#8a610e; --warn-bg:#fcf3df; --info-bg:#e9effa; --info-ink:#365b95;
}
html,body { min-width:320px; background:var(--bg); }
body { font:13px/1.5 "Aptos","Segoe UI",Arial,sans-serif; -webkit-font-smoothing:antialiased; }
*,*::before,*::after { letter-spacing:0 !important; }
button,input,select,textarea { font-family:inherit; }
button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; }
h1,h2,h3 { text-transform:none; font-family:var(--head); }
h2 { font-size:16px; font-weight:600; }
h3 { font-size:14px; }
p { line-height:1.6; }
::selection { background:#f0444460; color:var(--ink); }
:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
[hidden] { display:none !important; }
.icon { width:18px; height:18px; flex:none; vertical-align:middle; }
.pos { color:var(--ok); } .neg { color:var(--bad); }

/* Authentication: deliberately no pitch, secondary content or scrolling hero. */
.login-page { min-height:100svh; display:grid; place-items:center; padding:28px 20px; background:#090a0c; color:#f1f2f4; color-scheme:dark; position:relative; }
.login-page::before { content:""; position:absolute; top:0; left:0; width:100%; height:3px; background:#f04444; }
.login-panel { width:100%; max-width:360px; padding:0; background:none; border:0; border-radius:0; box-shadow:none; margin:0; animation:login-enter .4s ease-out both; }
.login-brand { display:flex; align-items:center; justify-content:flex-start; gap:14px; margin:0 0 40px; }
.login-mark { width:48px; height:48px; border-radius:8px; background:#f04444; color:white; display:flex; align-items:center; justify-content:center; border:0; font:750 32px/1 var(--head); flex:none; box-shadow:0 5px 24px #f0444428; }
.login-mark span { color:#210c0e; }
.login-brand h1 { font-size:23px; font-weight:650; line-height:1.15; }
.login-brand h1 > span { display:block; font:400 12px/1.5 "Segoe UI",sans-serif; color:#959aa5; margin-top:4px; }
.login-panel label.field { margin:0 0 21px; }
.login-panel label.field > span:first-child { color:#c3c6ce; font-size:12px; margin-bottom:8px; }
.login-panel input { height:48px; border:1px solid #30353e; border-radius:6px; background:#111419; box-shadow:none; color:#f1f2f4; }
.login-panel input:focus { outline:none; border-color:#f04444; box-shadow:0 0 0 3px #f0444418; }
.password-field { display:block !important; position:relative; }
.password-field input { padding-right:45px; }
.password-field .icon-btn { position:absolute; right:7px; top:6px; width:36px; height:36px; color:#939aa8; }
.login-panel .login-submit { height:48px; width:100%; justify-content:center; gap:12px; margin-top:6px; background:var(--action); border-color:var(--action); color:white; }
.login-panel .login-submit:hover { background:var(--action-hover); box-shadow:0 5px 20px #f0444424; }

/* Workspace chrome */
.app { display:grid; grid-template-columns:232px minmax(0,1fr); min-height:100vh; }
.sidebar { position:sticky; top:0; margin:0; width:232px; height:100vh; height:100dvh; border:0; border-right:1px solid #252931; border-radius:0; background:#0c0e11; color:#a6abb5; overflow:hidden; }
.brand { display:flex; align-items:center; gap:10px; min-height:82px; padding:20px; color:#f1f2f4; font-weight:600; }
.brand .mark { width:34px; height:34px; border-radius:6px; display:flex; justify-content:center; align-items:center; background:#f04444; color:white; border:0; font:750 24px/1 var(--head); flex:none; }
.brand .mark > span { color:#210c0e; }
.brand .name { text-transform:none; font-size:16px; color:#f1f2f4; font-weight:650; }
.brand small { text-transform:none; font-size:10px; color:#858b98; margin-top:2px; }
.workspace-switch { display:grid; grid-template-columns:1fr 1fr; gap:3px; padding:3px; margin:0 14px 16px; border:1px solid #252931; border-radius:5px; background:#090a0c; }
.workspace-switch a { text-align:center; font-size:10px; padding:7px 4px; color:#8c93a0; border-radius:3px; }
.workspace-switch a.selected { color:white; background:#24272e; }
.nav { flex:1; overflow-y:auto; padding:0 10px 18px; scrollbar-width:thin; scrollbar-color:#303640 transparent; }
.nav-section { margin-bottom:8px; }
.nav-section summary { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:9px 12px 6px; color:#737b8b; font-size:10px; font-weight:500; }
.nav-section summary::-webkit-details-marker { display:none; }
.nav-section summary::after { content:'›'; transform:rotate(0); color:#666e7c; }
.nav-section[open] summary::after { transform:rotate(90deg); }
.nav-items { display:grid; gap:2px; }
.nav a { position:relative; display:flex; align-items:center; gap:10px; min-height:36px; padding:8px 12px; border-radius:5px; border:0; color:#a6abb5; font-size:11px; font-weight:450; transition:background .15s,color .15s; }
.nav a:hover { color:#f1f2f4; background:#1b1f26; }
.nav a.active { background:#f0444418; color:#ff7974; font-weight:600; }
.nav a.active::after { content:""; position:absolute; left:0; top:10px; bottom:10px; width:2px; background:#f04444; border-radius:2px; }
.nav .ico { width:18px; display:flex; } .nav .icon { width:16px; height:16px; }
.userbox { border-top:1px solid #252931; padding:14px; display:flex; flex-wrap:wrap; gap:11px; background:#0c0e11; }
.user-profile { display:flex; align-items:center; gap:9px; min-width:0; flex:1; }
.user-profile .avatar { width:32px; height:32px; display:grid; place-items:center; border-radius:6px; background:#232934; border:1px solid #353d49; color:#bcc4d3; font-weight:600; }
.user-profile b { color:#f1f2f4; font-size:11px; display:block; overflow-wrap:anywhere; }
.user-profile div > span { color:#7e8797; display:block; font-size:10px; }
.userbox .links { display:flex; width:100%; gap:5px; margin:0; }
.userbox .links .icon-btn { width:32px; height:28px; color:#929aa9; background:#15191f; border:1px solid #252931; }
.main { min-width:0; padding:0; }
.topbar { position:sticky; top:0; z-index:12; height:62px; padding:0 30px; display:flex; gap:16px; border-bottom:1px solid var(--line); background:var(--bg); }
.breadcrumb { display:flex; align-items:center; gap:11px; font-size:11px; min-width:0; }
.breadcrumb > span { color:var(--muted); } .breadcrumb strong { font-weight:500; white-space:nowrap; }
.breadcrumb .icon { width:12px; height:12px; color:#5e6472; }
.command-trigger { margin-left:auto; display:flex; align-items:center; gap:9px; min-height:32px; padding:6px 12px; background:var(--panel); color:var(--muted); border:1px solid var(--line); border-radius:5px; cursor:pointer; font-size:11px; }
.command-trigger .icon { width:14px; height:14px; }
.command-trigger:hover { border-color:var(--line-strong); color:var(--ink); }
.topbar-date { font-size:10px; color:var(--muted); white-space:nowrap; }
.menu-btn { display:none; align-items:center; padding:8px; color:var(--ink); }
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:27px 30px 22px; }
.page-heading h1 { font-size:27px; font-weight:600; line-height:1.2; }
.page-heading .eyebrow { display:none; }
.heading-action { flex:none; }
.view { max-width:1600px; padding:0 30px 50px; }

/* Shared controls */
.btn { min-height:36px; padding:7px 12px; gap:7px; border-radius:5px; border:1px solid var(--line-strong); background:var(--panel-2); color:var(--ink); font-size:11px; line-height:1.3; font-weight:500; box-shadow:none; transition:background .16s,border-color .16s,box-shadow .16s; white-space:normal; }
.btn:hover { background:var(--row-hover); border-color:#727a89; }
.btn.primary { background:var(--action); border-color:var(--action); color:#fff; }
.btn.primary:hover { background:var(--action-hover); border-color:var(--action-hover); }
.btn .icon { width:15px; height:15px; }
.btn.sm { font-size:10px; min-height:29px; padding:5px 9px; }
.btn.lg { font-size:13px; min-height:44px; }
.btn.ghost { background:transparent; border-color:transparent; }
.btn.danger { background:var(--bad-bg); border-color:var(--bad); color:var(--bad); }
:root[data-theme="claro"] .btn.danger { color:var(--bad); }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; flex:none; width:34px; height:34px; min-height:0; border:0; background:transparent; color:var(--muted); border-radius:5px; cursor:pointer; padding:7px; }
.icon-btn:hover { color:var(--ink); background:var(--panel-2); }
.icon-btn .icon { width:17px; height:17px; }
.badge { font-size:10px; font-weight:500; border-radius:4px; padding:3px 6px; background:var(--panel-2); border:0; }
.alert { border:0; border-left:2px solid var(--line-strong); border-radius:0; padding:10px 13px; font-size:12px; }
.alert.warn { background:var(--warn-bg); border-left-color:var(--warn); }
.alert.bad { background:var(--bad-bg); border-left-color:var(--bad); }
.alert.info { background:var(--info-bg); border-left-color:var(--info-ink); }
.alert.ok { background:var(--ok-bg); border-left-color:var(--ok); }
input,select,textarea { min-height:38px; font-size:12px; border-radius:5px; padding:8px 10px; background:var(--field); border:1px solid var(--line-strong); color:var(--ink); box-shadow:none; transition:border-color .15s,box-shadow .15s; }
input:hover,select:hover,textarea:hover { border-color:#596272; }
input:focus,select:focus,textarea:focus { border-color:var(--brand); outline:0; box-shadow:0 0 0 3px #f0444412; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
input[type=checkbox] { accent-color:var(--brand); width:16px; height:16px; }
label.field > span { font-size:11px; font-weight:500; color:var(--muted); }
.check { font-size:11px; }
.filters { gap:12px; padding-bottom:16px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.filters label.field { min-width:140px; max-width:260px; }
.tabs { width:100%; max-width:100%; display:flex; gap:4px; padding:0; margin:0 0 24px; border:0; border-bottom:1px solid var(--line); background:transparent; border-radius:0; overflow:auto; scrollbar-width:thin; }
.tabs button { white-space:nowrap; flex:none; background:transparent; border:0; border-radius:0; border-bottom:2px solid transparent; padding:11px 15px; font-size:11px; color:var(--muted); cursor:pointer; }
.tabs button.active { background:transparent; border-bottom-color:var(--brand); color:var(--ink); box-shadow:none; }
.type-pick { gap:6px; }
.type-pick button { border-radius:5px; }
.steps span.now { background:var(--action); color:#fff; }

/* Operational pages: sections, not floating boxes within boxes. */
.card { background:transparent; border:0; border-radius:0; box-shadow:none; padding:0 0 22px; margin-bottom:22px; border-bottom:1px solid var(--line); min-width:0; }
.card .card { padding-top:12px; }
.purchase-suggestion { background:var(--panel); color:var(--ink); border-top:1px solid var(--line); padding:18px 0; }
.purchase-suggestion .card-head { padding:0 14px; }
.purchase-suggestion .card-head h3 { color:var(--ink); }
.embedded-form,.count-summary { background:var(--panel-2); color:var(--ink); border:1px solid var(--line); padding:16px; margin:14px 0; border-radius:5px; }
input[type=file]::file-selector-button { font:inherit; color:var(--ink); background:var(--panel-2); border:1px solid var(--line-strong); border-radius:4px; padding:6px 10px; margin-right:10px; cursor:pointer; }
option,optgroup { color:var(--ink); background:var(--field); }
.card-head { gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.card-head h2 { font-size:16px; font-weight:600; }
.table-wrap { margin:0; padding:0; border:1px solid var(--line); border-radius:6px; overflow:auto; scrollbar-color:var(--line-strong) transparent; }
table { font-size:12px; font-variant-numeric:tabular-nums; }
thead { background:var(--panel-2); }
th { font-size:10px; text-transform:none; padding:12px 14px; border-bottom:1px solid var(--line); color:var(--muted); font-weight:500; }
td { font-size:12px; padding:14px; border-bottom:1px solid var(--line); }
td.prod b { font-weight:550; }
td .sub { font-size:10px; }
td.acts .btn.primary { background:transparent; border-color:var(--line-strong); color:var(--ink); }
tr.row-bad td,tr.row-warn td,tr.row-ok td { background:transparent; }
tr.row-bad td:first-child { box-shadow:inset 2px 0 var(--bad); }
tr.row-warn td:first-child { box-shadow:inset 2px 0 var(--warn); }
tr.row-ok td:first-child { box-shadow:inset 2px 0 var(--ok); }
tr.cat-row td { text-transform:none; font-size:11px; background:var(--panel-2); color:var(--ink); }
.gauge { border-radius:2px; height:3px; background:var(--line); }
.gauge i { border-radius:2px; }
.kpis { gap:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin:0 0 25px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
.kpi { border:0; border-left:1px solid var(--line); border-radius:0; padding:20px; background:transparent; box-shadow:none; min-width:0; }
.kpi::before { display:none; }
.kpi:first-child { border-left:0; padding-left:0; }
.kpi .label { font-size:11px; color:var(--muted); }
.kpi .value { font:600 25px/1.3 var(--head); margin:8px 0; overflow-wrap:anywhere; }
.kpi .small { font-size:10px; }
.grid.cols-2 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.empty-state { border:0; background:transparent; padding:34px 12px; }
.empty-state p { font-size:12px; }
.freezer-card { background:var(--panel); border:1px solid var(--line); padding:20px; border-radius:6px; }

/* Analytics workspace */
.analytics-toolbar { display:flex; align-items:end; justify-content:space-between; gap:18px; flex-wrap:wrap; padding-bottom:22px; }
.period-presets { border:1px solid var(--line); border-radius:5px; background:var(--panel); padding:3px; display:flex; gap:3px; }
.period-chip { color:var(--muted); font-size:11px; padding:8px 13px; border-radius:3px; cursor:pointer; border:0; background:none; }
.period-chip.selected { background:var(--panel-2); color:var(--ink); }
.analytics-dates { display:flex; align-items:end; gap:8px; }
.analytics-dates label { font-size:10px; color:var(--muted); display:grid; gap:5px; }
.analytics-dates input { width:133px; min-height:34px; font-size:11px; }
.analytics-dates select { min-height:34px; font-size:11px; width:145px; }
.filter-apply { border:1px solid var(--line-strong); background:var(--panel-2); }
.data-warning { display:flex; gap:10px; align-items:center; padding:12px 0; border-top:1px solid var(--line); color:var(--muted); font-size:11px; }
.data-warning > span { flex:1; } .data-warning > .icon { color:var(--warn); }
.metric-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:6px; margin:0 0 26px; overflow:hidden; background:var(--panel); }
.metric { padding:19px 21px; min-width:0; border-left:1px solid var(--line); }
.metric:first-child { border:0; }
.metric-primary { position:relative; background:linear-gradient(120deg,#f0444410,transparent); }
.metric-primary::before { content:""; position:absolute; top:0; left:0; right:0; height:2px; background:var(--brand); }
.metric-label { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
.metric-label .icon { width:15px; height:15px; }
.metric > strong { display:block; margin:11px 0 9px; font:600 28px/1.2 var(--head); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.metric-caption { color:var(--muted); font-size:10px; }
.analytics-main { display:grid; grid-template-columns:minmax(0,1.85fr) minmax(260px,1fr); gap:28px; border-bottom:1px solid var(--line); padding-bottom:25px; }
.analytics-surface { min-width:0; padding:0; background:transparent; }
.analytics-main > :last-child { border-left:1px solid var(--line); padding-left:25px; }
.surface-heading { display:flex; justify-content:space-between; gap:10px; align-items:start; margin-bottom:22px; }
.surface-heading h2 { font-size:15px; font-weight:600; }
.surface-heading p { font-size:10px; color:var(--muted); margin:5px 0 0; }
.surface-heading > .icon { width:16px; height:16px; color:var(--muted); }
.chart-stage { width:100%; height:280px; position:relative; }
.chart-stage canvas { width:100% !important; height:100% !important; }
.donut-stage { height:185px; max-width:240px; margin:0 auto 17px; }
.short-stage { height:215px; }
.chart-switch { background:var(--panel); border:1px solid var(--line); border-radius:4px; padding:3px; }
.chart-switch button { font-size:10px; padding:5px 9px; border-radius:3px; }
.chart-switch button.active { background:var(--panel-2); color:var(--ink); }
.chart-legend { display:flex; justify-content:center; align-items:center; gap:20px; margin-top:16px; color:var(--muted); font-size:10px; flex-wrap:wrap; }
.chart-legend > span { display:flex; gap:6px; align-items:center; }
.chart-legend i { width:15px; height:2px; background:var(--swatch); }
.channel-list { display:grid; gap:10px; }
.channel-item { display:grid; grid-template-columns:6px minmax(0,1fr) auto auto; align-items:center; gap:9px; font-size:10px; }
.channel-item > i { width:6px; height:6px; border-radius:2px; }
.channel-item > small { color:var(--muted); min-width:65px; text-align:right; font-size:10px; }
.channel-item b { font-weight:500; }
.analytics-secondary { display:grid; grid-template-columns:1fr 1fr; gap:30px; padding:25px 0; border-bottom:1px solid var(--line); }
.analytics-secondary > :last-child { border-left:1px solid var(--line); padding-left:25px; }
.ranking-v2 { display:grid; gap:16px; }
.ranking-item { display:grid; grid-template-columns:22px minmax(0,1fr) auto; gap:12px; align-items:start; }
.rank-number { color:#6e7684; font-size:11px; padding-top:1px; }
.ranking-item b { font-size:11px; font-weight:500; display:block; }
.ranking-item small { font-size:9px; color:var(--muted); display:block; margin-top:3px; }
.ranking-item > strong { font-size:11px; font-weight:550; }
.rank-track { height:3px; margin-top:9px; background:var(--line); width:100%; }
.rank-track i { display:block; height:100%; background:var(--brand); width:var(--target); transform-origin:left; animation:bar-expand .8s cubic-bezier(.2,.8,.3,1) both; }
.ranking-item:nth-child(2) .rank-track i { animation-delay:.06s; background:#d25a64; }
.ranking-item:nth-child(3) .rank-track i { animation-delay:.12s; background:#ad6471; }
.ranking-item:nth-child(n+4) .rank-track i { animation-delay:.18s; background:#786877; }
.surface-foot { display:flex; justify-content:space-between; gap:15px; margin-top:17px; font-size:10px; color:var(--muted); }
.surface-foot b { color:var(--ink); margin-left:7px; font-weight:500; }
.chart-empty { height:235px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--muted); text-align:center; gap:12px; background:repeating-linear-gradient(0deg,transparent,transparent 47px,var(--line) 48px,transparent 49px); }
.chart-empty .icon { width:24px; height:24px; color:#687284; }
.chart-empty p { font-size:11px; max-width:220px; margin:0; padding:6px; background:var(--bg); }
.operation-band { padding:25px 0; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:15px; }
.section-heading h2 { font-size:15px; }
.operation-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.operation-metrics a { display:flex; gap:12px; padding:18px; background:var(--panel); color:var(--muted); font-size:10px; align-items:center; }
.operation-metrics strong { display:block; color:var(--ink); font-size:19px; margin-top:5px; font-weight:550; }
.operation-metrics a > .icon:last-child { margin-left:auto; width:14px; height:14px; }
.operation-metrics a:hover { background:var(--panel-2); }
.data-disclosure { font-size:11px; border-top:1px solid var(--line); padding-top:15px; color:var(--muted); }
.data-disclosure summary { cursor:pointer; }
.data-disclosure p { max-width:90ch; }
.stock-overview { display:grid; grid-template-columns:1fr 1fr; gap:30px; margin-bottom:28px; padding-bottom:25px; border-bottom:1px solid var(--line); }
.stock-overview .chart-stage { height:180px; }
.stock-metrics { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-content:center; }
.stock-stat { color:var(--muted); font-size:11px; }
.stock-stat strong { display:block; color:var(--ink); font-size:24px; font-weight:550; margin-top:7px; }
.mc-analytics { display:grid; grid-template-columns:1.3fr 1fr; gap:30px; padding:0 0 28px; margin-bottom:25px; border-bottom:1px solid var(--line); }
.mc-analytics .chart-stage { height:220px; }
.finance-charts { display:grid; grid-template-columns:1fr 1fr; gap:30px; margin:0 0 28px; padding-bottom:25px; border-bottom:1px solid var(--line); }
.finance-charts .chart-stage { height:250px; }

/* Menus, dialogs and transient states */
.modal-bg { background:#050609bb; backdrop-filter:blur(8px); padding:24px; align-items:center; }
.modal { border-radius:8px; background:var(--panel); border:1px solid var(--line-strong); box-shadow:0 30px 100px #0008; max-height:90dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; animation:dialog-enter .2s ease-out both; }
.modal-head { border-bottom:1px solid var(--line); padding:19px 22px; }
.modal-head h2 { font-size:17px; font-weight:600; }
.modal-body { padding:22px; min-height:0; overflow-y:auto; flex:0 1 auto; }
.modal-head,.modal-foot { flex:none; }
.modal-foot { border-top:1px solid var(--line); padding:15px 22px; background:var(--field); border-radius:0; }
.modal-body .card { margin-bottom:16px; }
.modal-body .table-wrap { margin:0; padding:0; max-width:100%; }
.menu-pop { border-radius:6px; background:var(--panel-2); border:1px solid var(--line-strong); padding:5px; box-shadow:var(--shadow); }
.menu-pop a,.menu-pop button { font-size:11px; border-radius:3px; }
.toast { border-radius:5px; padding:12px 16px; background:var(--panel-2); border:1px solid var(--line-strong); box-shadow:var(--shadow); font-size:12px; }
.toast.ok { background:var(--ok-bg); color:var(--ok); border-color:var(--ok); }
.toast.err { background:var(--bad-bg); color:var(--bad); border-color:var(--bad); }
:root[data-theme="claro"] .toast.err { color:var(--bad); }
.command-dialog { width:min(560px,calc(100vw - 30px)); margin:100px auto auto; padding:0; background:var(--panel); color:var(--ink); border:1px solid var(--line-strong); border-radius:8px; box-shadow:0 30px 100px #0008; animation:dialog-enter .2s ease-out; }
.command-dialog::backdrop { background:#0009; backdrop-filter:blur(6px); }
.command-input { display:flex; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); }
.command-input > input { border:0; background:transparent; min-width:0; box-shadow:none; }
.command-results { max-height:380px; overflow:auto; padding:7px; }
.command-results > a { display:flex; align-items:center; gap:13px; color:var(--ink); padding:10px 12px; border-radius:4px; }
.command-results > a:hover,.command-results > a:focus { background:var(--panel-2); }
.command-results > a > span { flex:1; }
.command-results small { display:block; font-size:10px; color:var(--muted); margin-top:2px; }
.command-results .icon { color:var(--muted); width:16px; height:16px; }
.loading-state { display:flex; align-items:center; justify-content:center; min-height:260px; gap:12px; color:var(--muted); font-size:12px; }
.loading-spinner { height:18px; width:18px; border:2px solid var(--line); border-top-color:var(--brand); border-radius:50%; }
@keyframes login-enter { from { opacity:0; transform:translateY(10px); } }
@keyframes bar-expand { from { transform:scaleX(0); } }
@keyframes dialog-enter { from { opacity:0; transform:translateY(5px) scale(.98); } }

@media(min-width:1600px) { .view { padding-left:40px; padding-right:40px; } .page-heading { padding-left:40px; padding-right:40px; } .chart-stage { height:320px; } .donut-stage { height:210px; } }
@media(max-width:1150px) {
  .app { grid-template-columns:210px minmax(0,1fr); } .sidebar { width:210px; }
  .view { padding:0 22px 40px; } .page-heading { padding:24px 22px 20px; } .topbar { padding:0 22px; }
  .metric { padding:16px 13px; } .metric > strong { font-size:24px; }
  .analytics-main { grid-template-columns:minmax(0,1.6fr) minmax(230px,1fr); gap:20px; }
  .analytics-dates input { width:120px; } .analytics-dates select { width:130px; }
}
@media(max-width:900px) {
  .app { grid-template-columns:minmax(0,1fr); }
  .sidebar { position:fixed; width:260px; left:0; top:0; bottom:0; transform:translateX(-100%); z-index:35; transition:transform .22s; }
  .app.nav-open .sidebar { transform:none; }
  .app.nav-open .backdrop { display:block; position:fixed; inset:0; background:#0009; backdrop-filter:blur(3px); z-index:30; }
  .menu-btn { display:inline-flex; }
  .breadcrumb > span { display:none; } .breadcrumb > .icon { display:none; }
  .topbar { height:56px; padding:0 16px; gap:10px; }
  .topbar-date { display:none; }
}
@media(max-width:640px) {
  .login-panel { max-width:340px; } .login-brand { margin-bottom:32px; }
  .page-heading { padding:22px 16px 20px; } .page-heading h1 { font-size:23px; }
  .page-heading .btn { font-size:10px; padding:7px 9px; }
  .view { padding:0 16px 35px; }
  .command-trigger { min-height:30px; padding:6px; border:0; background:transparent; } .command-trigger span { display:none; }
  .analytics-toolbar { align-items:start; gap:13px; padding-bottom:18px; }
  .analytics-dates { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 34px; width:100%; }
  .analytics-dates label { min-width:0; } .analytics-dates input,.analytics-dates select { width:100%; min-width:0; min-height:38px; }
  .analytics-dates label:nth-child(3) { grid-column:1 / 3; } .filter-apply { grid-column:3; grid-row:2; height:38px; width:34px; }
  .metric-strip { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:22px; }
  .metric { padding:16px; border-top:1px solid var(--line); } .metric:nth-child(2) { border-top:0; } .metric:nth-child(3) { border-left:0; }
  .metric > strong { font-size:24px; } .metric-caption { font-size:9px; } .metric-label { font-size:10px; gap:6px; }
  .data-warning { align-items:start; flex-wrap:wrap; } .data-warning .btn { margin-left:27px; }
  .analytics-main,.analytics-secondary,.mc-analytics,.stock-overview,.finance-charts { grid-template-columns:minmax(0,1fr); gap:24px; }
  .analytics-main > :last-child,.analytics-secondary > :last-child { border-left:0; padding-left:0; border-top:1px solid var(--line); padding-top:23px; }
  .chart-stage { height:240px; } .short-stage { height:200px; } .donut-stage { height:195px; }
  .channel-list { grid-template-columns:1fr; max-width:360px; margin:auto; }
  .surface-heading { margin-bottom:18px; } .surface-heading h2 { font-size:14px; }
  .surface-heading p { font-size:9px; }
  .chart-switch button { padding:5px 7px; font-size:9px; }
  .operation-metrics { grid-template-columns:1fr; }
  .operation-metrics a { padding:15px; }
  .grid.cols-2 { grid-template-columns:minmax(0,1fr); }
  .kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kpi { padding:16px 12px; } .kpi:nth-child(3) { border-left:0; border-top:1px solid var(--line); } .kpi:nth-child(4) { border-top:1px solid var(--line); }
  .kpi .value { font-size:23px; } .kpi:first-child { padding-left:12px; }
  .filters { gap:10px; } .filters label.field { min-width:120px; max-width:none; }
  .card { padding:0 0 20px; }
  .table-wrap { margin:0; padding:0; }
  table.cards tr { border-radius:0; border-bottom:1px solid var(--line); background:var(--panel); padding:14px; margin-bottom:0; }
  table.cards td { font-size:12px; padding:5px 0; } table.cards td:first-child { box-shadow:none; }
  table.cards tr.row-bad { border-left:2px solid var(--bad); } table.cards tr.row-warn { border-left:2px solid var(--warn); }
  td.prod { max-width:none; } td.prod b { font-size:13px; }
  .tabs { margin-bottom:20px; } .tabs button { padding:10px 12px; }
  .modal-bg { padding:12px; align-items:center; } .modal,.modal.wide { width:100%; min-height:0; max-height:94dvh; border-radius:7px; } .modal-body { padding:17px; flex:0 1 auto; } .modal-head,.modal-foot { padding:15px 17px; }
  .command-dialog { margin-top:50px; }
  .btn,.btn.sm { min-height:34px; }
  input,select,textarea { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
.notebook-person { padding:20px 0; border-bottom:1px solid var(--line); }
.notebook-person .card-head { flex-wrap:wrap; }
.notebook-description { white-space:pre-wrap; overflow-wrap:anywhere; min-width:160px; max-width:380px; }
.intake-photo-fields { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:16px 0 0; }
.intake-photo-fields .field { flex:1 1 220px; margin:0; }
.intake-photo-fields .btn { position:relative; cursor:pointer; }
.intake-camera { position:absolute; width:1px; height:1px; opacity:0; min-height:0; padding:0; border:0; }
.intake-history { margin-top:32px; padding-top:22px; border-top:1px solid var(--line); }
.intake-history table { min-width:720px; }
.intake-history td:first-child { white-space:nowrap; }
.intake-photo-fields .btn:focus-within { outline:2px solid var(--brand); outline-offset:3px; }
.ocr-reference { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(0,1fr); gap:18px; margin:16px 0; }
.ocr-reference img { width:100%; height:250px; object-fit:contain; background:#fff; }
.ocr-reference textarea { width:100%; margin:10px 0; }
.ocr-line { padding:16px 0; border-top:1px solid var(--line); }
.ocr-line > p { overflow-wrap:anywhere; }
.ocr-fields { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); gap:12px; }
.barrel-current { padding:18px 0; margin:16px 0; border-block:1px solid var(--line-strong); }
.barrel-current details { margin-top:18px; }
.mc-chart-main { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(0,1fr); gap:24px; padding:24px 0; border-bottom:1px solid var(--line); }
.mc-period-controls { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.mc-period-controls label { display:grid; gap:5px; width:180px; color:var(--muted); font-size:11px; }
.mc-period-controls input { width:100%; min-width:0; }
.mc-channel-legend { display:grid; gap:10px; margin-top:16px; }
.mc-channel-legend > span { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
.mc-channel-legend i { width:7px; height:7px; flex:none; }
.mc-channel-legend b { margin-left:auto; color:var(--ink); }
.mc-barrel-positions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:20px 0; border-bottom:1px solid var(--line); }
.mc-barrel-positions a { padding:14px 8px; display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); }
.mc-barrel-positions b { color:var(--ink); font-size:20px; }
.mc-results-strip .metric { min-width:0; }
.mc-results-strip .metric > span { color:var(--muted); font-size:11px; }
@media(max-width:700px) {
  .mc-period-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mc-period-controls label { width:auto; min-width:0; }
  .ocr-reference,.ocr-fields,.mc-chart-main { grid-template-columns:minmax(0,1fr); }
  .ocr-reference img { height:220px; }
  .mc-barrel-positions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
#receipt-items select { min-width:190px; }
#receipt-items input { min-width:100px; width:100%; }
#receipt-form .btns { margin:14px 0; }
.intake-metadata { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
@media(max-width:640px) {
  .intake-metadata { grid-template-columns:minmax(0,1fr); }
  #receipt-form .table-wrap table,#receipt-items { display:block; width:100%; }
  #receipt-form .table-wrap thead { display:none; }
  #receipt-items tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:14px; border-bottom:1px solid var(--line); }
  #receipt-items td { display:block; min-width:0; padding:0; border:0; }
  #receipt-items td:first-child,#receipt-items td:last-child { grid-column:1/-1; }
  #receipt-items td:last-child { justify-self:end; }
  #receipt-items td[data-label]::before { content:attr(data-label); display:block; font-size:10px; color:var(--muted); margin-bottom:6px; }
  #receipt-items select { min-width:0; width:100%; }
  #receipt-items input { min-width:0; }
}
