/* Layout: app shell — sidebar nav + main column; POS = product grid + receipt-style ticket */
:root {
  --bg: #f2f4f1; --surface: #ffffff; --surface-2: #eaeee9; --line: #dbe1da; --ink: #121a16; --ink-2: #4a5650; --muted: #7f8a84;
  --accent: #1f47c7; --accent-ink: #ffffff; --accent-soft: #e5eafb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #8a5a00; --crit: #d03b3b;
  --grid: #e1e0d9; --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(18,26,22,.06), 0 10px 30px rgba(18,26,22,.07);
  --f-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --f-body: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  --r: 12px; --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1210; --surface: #161b18; --surface-2: #1d231f; --line: #29302c; --ink: #edf2ee; --ink-2: #b3bdb7; --muted: #7d8882;
    --accent: #7d9bff; --accent-ink: #0b1020; --accent-soft: #1c2440;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --good-ink: #3ccf3c; --warn-ink: #fab219; --grid: #2c2c2a; --axis: #383835;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body, #root { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--bg); }

/* auth */
.auth { height: 100%; display: grid; place-items: center; padding: 24px; animation: viewIn .4s var(--ease); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 22px; padding: 0; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card p { color: var(--ink-2); margin: 0 0 20px; }
.auth-card form { display: grid; gap: 14px; }
.auth-err { color: var(--crit); font-size: 14px; min-height: 20px; }

/* shell */
.app { display: grid; grid-template-columns: 232px minmax(0,1fr); height: 100%; }
.side { height: 100%; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 700 16px var(--f-display); }
.brand b { display: block; font: 700 17px/1.1 var(--f-display); }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer; text-align: left; font-weight: 600; transition: background .2s, color .2s; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button.on { background: var(--accent-soft); color: var(--accent); }
.nav kbd { margin-left: auto; font: 11px var(--f-mono); color: var(--muted); }
.me { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: grid; gap: 8px; }
.me b { display: block; font-weight: 650; }
.me .row { display: flex; gap: 6px; flex-wrap: wrap; }
.main { min-width: 0; overflow-y: auto; padding: 22px 28px 48px; scroll-behavior: smooth; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.top h1 { font-size: 30px; font-weight: 700; }
.top .date { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.view { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* primitives */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card h2 { font-size: 18px; font-weight: 700; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; transition: transform .15s var(--ease), background .2s, border-color .2s, filter .2s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; border-radius: 8px; }
.btn.danger { color: var(--crit); }
.btn.armed { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); transition: background .2s, color .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.f input, .f select { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 15px; color: var(--ink); padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); width: 100%; transition: border-color .2s; }
.f input:focus, .f select:focus { border-color: var(--accent); outline: none; }
.f small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .wide { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-agotado, .lv-critico { color: var(--crit); } .lv-bajo { color: var(--warn-ink); } .lv-ok { color: var(--good-ink); }
.m-efectivo i { background: var(--s1); } .m-tarjeta i { background: var(--s2); } .m-transferencia i { background: var(--s3); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--f-display); font-size: 17px; margin-bottom: 4px; }
.tbl-wrap { overflow-x: auto; margin-inline: -18px; padding-inline: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.think { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 14px; }
.think::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 22px; align-items: start; }
.pos-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; border: 0; background: none; padding: 13px 0; font-size: 16px; outline: none; min-width: 0; }
.search .ic { color: var(--muted); }
.search kbd { font: 11px var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.cats button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink-2); transition: all .2s; }
.cats button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.tile { position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 13px 13px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 118px; transition: transform .18s var(--ease), border-color .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--ink-2); box-shadow: var(--shadow); }
.tile:active { transform: scale(.97); }
.tile .nm { font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .pr { font: 600 17px var(--f-mono); margin-top: auto; }
.tile .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.tile .meta .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .stk { font-family: var(--f-mono); white-space: nowrap; }
.tile.low .stk { color: var(--warn-ink); font-weight: 600; }
.tile.out { opacity: .72; }
.tile.out .stk { color: var(--crit); font-weight: 600; }
.tile.flash { animation: flash .45s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.ticket { position: sticky; top: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 120px); overflow: hidden; border: 1px solid var(--line); }
.t-head { padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px dashed var(--line); }
.t-head h2 { font-size: 18px; }
.t-lines { overflow-y: auto; padding: 6px 10px; flex: 1; min-height: 80px; scroll-behavior: smooth; }
.line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; animation: lineIn .3s var(--ease); }
.line:hover { background: var(--surface-2); }
@keyframes lineIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.line .nm { font-weight: 600; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.line .unit { font: 12px var(--f-mono); color: var(--muted); }
.line .tot { font: 600 14px var(--f-mono); text-align: right; min-width: 76px; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 8px; }
.stepper button { border: 0; background: none; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 8px; color: var(--ink-2); }
.stepper button:hover { background: var(--line); color: var(--ink); }
.stepper .ic { width: 15px; height: 15px; }
.stepper span { min-width: 28px; text-align: center; font: 600 13px var(--f-mono); }
.t-foot { padding: 14px 18px 18px; border-top: 1.5px dashed var(--line); display: flex; flex-direction: column; gap: 12px; }
.t-total { display: flex; justify-content: space-between; align-items: baseline; }
.t-total span { color: var(--ink-2); font-weight: 600; }
.t-total b { font: 700 30px var(--f-mono); letter-spacing: -.02em; }
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pay button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 4px; cursor: pointer; font-weight: 650; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all .2s; color: var(--ink-2); }
.pay button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cash { display: grid; gap: 8px; }
.cash input { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font: 600 16px var(--f-mono); }
.cash input:focus { border-color: var(--accent); outline: none; }
.cash #payer-in { font-family: var(--f-body); font-weight: 600; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 5px 9px; font: 600 12px var(--f-mono); cursor: pointer; }
.quick button:hover { border-color: var(--ink-2); }
.change { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.change:empty { display: none; }
.change b { font-family: var(--f-mono); font-size: 24px; color: var(--accent); }
.change.neg { background: var(--surface-2); }
.change.neg b { color: var(--crit); }
.cta { width: 100%; padding: 15px; font-size: 17px; border-radius: 12px; }
.cta kbd { font: 11px var(--f-mono); opacity: .75; }
.last { margin: 0 18px 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; animation: lineIn .3s var(--ease); }

/* KPIs + charts */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font: 700 24px/1.25 var(--f-display); margin-top: 4px; }
.kpi small { color: var(--muted); font-size: 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.vb { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 6px; }
.vb-y { position: relative; height: 190px; }
.vb-y span { position: absolute; right: 0; transform: translateY(50%); font: 11px var(--f-mono); color: var(--muted); }
.vb-plot { position: relative; height: 190px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--axis); }
.gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); pointer-events: none; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; min-width: 0; }
.bar { width: min(72%, 30px); background: var(--s1); border-radius: 4px 4px 0 0; position: relative; transition: opacity .2s; animation: grow .7s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.vb-plot:hover .bar { opacity: .5; }
.vb-plot .col:hover .bar { opacity: 1; }
.peak-l { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font: 600 11px var(--f-mono); white-space: nowrap; color: var(--ink); }
.vb-x { display: flex; gap: 2px; margin-top: 6px; }
.vb-x span { flex: 1; text-align: center; font: 10.5px var(--f-mono); color: var(--muted); min-width: 0; white-space: nowrap; }
.hb { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(0,180px) minmax(0,1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.hb-track { height: 14px; display: flex; }
.hb-bar { background: var(--s1); border-radius: 0 4px 4px 0; height: 100%; animation: growx .7s var(--ease) both; transform-origin: left; }
@keyframes growx { from { transform: scaleX(0); } to { transform: none; } }
.hb-val { font: 600 12px var(--f-mono); min-width: 64px; text-align: right; }
.stackbar { display: flex; gap: 2px; height: 22px; margin: 4px 0 14px; }
.stackbar i { display: block; height: 100%; }
.stackbar i:first-child { border-radius: 4px 0 0 4px; }
.stackbar i:last-child { border-radius: 0 4px 4px 0; }
.legend { display: grid; gap: 8px; font-size: 14px; }
.legend div { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend small { color: var(--muted); font-family: var(--f-mono); min-width: 52px; text-align: right; }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .t { font: 12px var(--f-mono); color: var(--muted); min-width: 96px; }
.cash input::placeholder { font-family: var(--f-body); font-weight: 400; }
.li .what b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.li .what small { color: var(--muted); }
.li.void { opacity: .55; }
.li.void .amt { text-decoration: line-through; }
.li.click { cursor: pointer; border-radius: 8px; }
.li.click:hover { background: var(--surface-2); }
.amt { font: 600 14px var(--f-mono); text-align: right; white-space: nowrap; }
.amt.plus { color: var(--good-ink); } .amt.minus { color: var(--crit); }
.sumgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.alert { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
.alert b { font-weight: 650; }
.alert small { color: var(--muted); display: block; }
.ai-note { display: flex; gap: 6px; align-items: flex-start; color: var(--accent); font-size: 13px; margin-top: 4px; }
.ai-note .ic { width: 15px; height: 15px; margin-top: 2px; }
.ai-box { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; display: flex; gap: 10px; }
.ai-box .ic { color: var(--accent); margin-top: 1px; }
.formula { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.hist-d { padding: 4px 4px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; font-size: 13px; animation: viewIn .3s var(--ease); }
.hist-d div { background: var(--surface-2); border-radius: 9px; padding: 10px 12px; }
.hist-d span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.hist-d b { font-family: var(--f-mono); }
.close-sum { display: grid; font-size: 14px; }
.close-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.close-sum div:last-child { border-bottom: 0; }
.close-sum b { font-family: var(--f-mono); }
.close-sum .big { font-size: 17px; padding-top: 10px; }
.mg { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.mg b { font-family: var(--f-mono); color: var(--ink); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--accent-soft); animation: viewIn .25s var(--ease); }
.order { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.order h3 { font-size: 16px; }
select.btn { font-weight: 600; padding: 9px 12px; }
a.btn { text-decoration: none; color: inherit; }
td input[type=checkbox], th input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* modal / toast / tooltip */
.modal { position: fixed; inset: 0; background: rgba(10,14,12,.45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--surface); border-radius: 16px; padding: 22px; width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: up .3s var(--ease); }
@keyframes up { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet h2 { font-size: 22px; margin-bottom: 16px; }
.sheet.sheet-change { width: min(520px, 100%); padding: 34px 32px 28px; animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.change-pop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.change-pop span { font: 700 18px var(--f-display); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.change-pop b { font: 700 clamp(64px, 11vw, 112px)/1.05 var(--f-mono); color: var(--accent); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.change-pop p { margin: 4px 0 20px; color: var(--ink-2); font-size: 16px; }
.change-pop strong { font-family: var(--f-mono); color: var(--ink); }
.change-pop .cta kbd { font: 12px var(--f-mono); opacity: .75; margin-left: 6px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: up .3s var(--ease); max-width: 400px; }
.toast i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.toast.good i { background: var(--good); } .toast.warn i { background: var(--warn); } .toast.crit i { background: var(--crit); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
#tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); font: 600 12px/1.4 var(--f-mono); padding: 7px 10px; border-radius: 8px; white-space: pre; box-shadow: var(--shadow); }

.m-only { display: none; }
@media (max-width: 1180px) { .pos { grid-template-columns: minmax(0,1fr) 340px; } .two { grid-template-columns: 1fr; } }
/* Phone / tablet layout (web panel): bottom tab bar, single column */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 40; flex-direction: row; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .side .brand, .side .me { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 1 0 auto; flex-direction: column; gap: 3px; font-size: 10px; padding: 7px 2px; min-width: 50px; align-items: center; }
  .nav kbd { display: none; }
  .main { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 110px; }
  .top { align-items: flex-start; }
  .top h1 { font-size: 25px; }
  .m-only { display: inline-flex; }
  .form { grid-template-columns: 1fr; }
  .kpis, .sumgrid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi b { font-size: 19px; }
  .hb-row { grid-template-columns: minmax(0,110px) minmax(0,1fr) auto; }
  .li { grid-template-columns: minmax(0,1fr) auto auto; }
  .li .t { grid-column: 1 / -1; margin-bottom: -8px; }
  .card-h .search { max-width: none !important; min-width: 0; flex-basis: 100%; }
  .auth-card { padding: 24px; }
  #toasts { left: 16px; right: 16px; bottom: 90px; }
  .toast { max-width: none; }
  .sheet { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html, .main { scroll-behavior: auto; } }
