/* ==========================================================================
   Jumla Cuts — Butchery Console
   Calm canvas, vibrant status colour, big touch targets for gloved hands
   ========================================================================== */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/jakarta.woff2") format("woff2"); }

:root {
  --ink: #16120F; --ink-2: #4A4441; --ink-3: #85807C; --ink-4: #B8B2AE;
  --line: rgba(22, 18, 15, .08); --line-2: rgba(22, 18, 15, .14);
  --bg: #F5F1EC; --card: #fff; --side: #17110E;
  --red: #F0283C; --ember: #FF6A1A; --sun: #FFB800; --leaf: #17A957; --berry: #8B5CF6; --sky: #1E9BFF; --pink: #FF4F8B; --mpesa: #2FAE4E;
  --s-new: #1E9BFF; --s-confirmed: #8B5CF6; --s-preparing: #FF6A1A; --s-ready: #17A957; --s-road: #F0283C;
  --grad-hot: linear-gradient(135deg, #FF2D55 0%, #FF5A1F 48%, #FFB300 100%);
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(60, 25, 10, .05), 0 2px 8px rgba(60, 25, 10, .04);
  --sh-2: 0 1px 2px rgba(60, 25, 10, .06), 0 14px 34px -14px rgba(60, 25, 10, .3);
  --sh-3: 0 30px 70px -20px rgba(40, 10, 5, .45);
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --side-w: 248px;
  /* chart roles (validated categorical slots 1–2 + sequential blue) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --grid: #ECE8E3; --axis: #CFC9C3;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
:focus-visible { outline: 3px solid rgba(30, 155, 255, .5); outline-offset: 2px; border-radius: 8px; }

/* ── Shell ───────────────────────── */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: rgba(255, 255, 255, .72); display: flex; flex-direction: column; padding: 18px 14px; z-index: 30; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 8px; }
.side .brand img { height: 42px; }
.side .brand small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .45); font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav .grp { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .35); padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; font-weight: 700; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a .ni { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--c, #444); color: #fff; flex: none; }
.nav a .ni svg { width: 17px; height: 17px; }
.nav a .bdg { margin-left: auto; min-width: 22px; height: 22px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: grid; gap: 8px; }
.pos-pill { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.pos-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pos-pill.online i { background: var(--leaf); box-shadow: 0 0 0 4px rgba(23, 169, 87, .25); }
.pos-pill.offline i { background: var(--sun); box-shadow: 0 0 0 4px rgba(255, 184, 0, .25); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13.5px; }
.me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-hot); color: #fff; font-weight: 800; display: grid; place-items: center; }
.me b { color: #fff; display: block; font-size: 13.5px; }
.me small { font-size: 12px; text-transform: capitalize; }
.me a { margin-left: auto; opacity: .6; }
.me a:hover { opacity: 1; }
.me svg { width: 18px; height: 18px; }

.main { margin-left: var(--side-w); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 241, 236, .82); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); }
.top .in { display: flex; align-items: center; gap: 12px; padding: 14px 28px; min-height: 68px; }
.top h1 { font-size: 24px; }
.top .sub { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.top .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.content { padding: 22px 28px 60px; }
.mnav { display: none; }

/* ── Controls ───────────────────────── */
.btn { --b: var(--ink); --c: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; background: var(--b); color: var(--c); font-weight: 800; font-size: 14.5px; white-space: nowrap; transition: transform .15s var(--ease), filter .15s, box-shadow .2s; position: relative; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.96); }
.btn svg { width: 18px; height: 18px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-hot { background: var(--grad-hot); box-shadow: 0 10px 22px -10px rgba(240, 40, 60, .7); }
.btn-soft { --b: rgba(22, 18, 15, .06); --c: var(--ink); }
.btn-white { --b: #fff; --c: var(--ink); box-shadow: var(--sh-1); }
.btn-red { --b: var(--red); }
.btn-green { --b: var(--leaf); }
.btn-lg { height: 54px; font-size: 16px; border-radius: 16px; padding: 0 22px; }
.btn-sm { height: 34px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn-xs { height: 28px; font-size: 12px; padding: 0 10px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; position: absolute; }
.btn.loading > :not(.spin) { opacity: 0; }
.btn.loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff; box-shadow: var(--sh-1); position: relative; transition: transform .15s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.on { background: var(--ink); color: #fff; }

.inp, .sel, .ta { width: 100%; height: 44px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); padding: 0 14px; outline: 0; font-size: 14.5px; transition: box-shadow .15s; -webkit-appearance: none; appearance: none; }
.sel { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2385807C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.ta { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.inp:focus, .sel:focus, .ta:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.inp-sm { height: 36px; border-radius: 10px; font-size: 14px; }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label.f small { font-weight: 600; color: var(--ink-3); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; width: 48px; height: 29px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(22, 18, 15, .15); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--leaf); }
.switch input:checked + i::after { transform: translateX(19px); }
.row-sw { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 0; }
.row-sw + .row-sw { border-top: 1px solid var(--line); }
.row-sw b { display: block; font-size: 14.5px; }
.row-sw small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.seg { display: inline-flex; background: rgba(22, 18, 15, .06); border-radius: 12px; padding: 3px; gap: 2px; }
.seg a, .seg button { height: 34px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; color: var(--ink-2); }
.seg .on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }

.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px; }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-hd h3 { font-size: 17px; }
.card-hd p { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.card-hd .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }
.pill { --s: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 800; color: var(--s); background: color-mix(in srgb, var(--s) 12%, #fff); white-space: nowrap; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.solid { background: var(--s); color: #fff; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--a, var(--sky)) 10%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a, var(--sky)) 25%, transparent); font-size: 14px; }
.alert svg { width: 20px; height: 20px; color: var(--a, var(--sky)); flex: none; margin-top: 1px; }
.alert b { display: block; }

/* ── KPI tiles ───────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.kpi .lb { font-size: 13px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.kpi .lb i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--c); color: #fff; }
.kpi .lb i svg { width: 15px; height: 15px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; font-weight: 700; margin-top: 2px; color: var(--ink-3); }
.kpi .d.up { color: var(--leaf); }
.kpi .d.down { color: var(--red); }

/* ── Live board ───────────────────────── */
.board-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--leaf); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ping 2s infinite; }
.live-dot.stale { color: var(--sun); }
.live-dot.stale::before { animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(23, 169, 87, .5); } 80%, 100% { box-shadow: 0 0 0 8px rgba(23, 169, 87, 0); } }
.board { display: grid; grid-template-columns: repeat(5, minmax(222px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: rgba(22, 18, 15, .035); border-radius: 20px; padding: 10px; min-height: 200px; }
.col-hd { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; }
.col-hd i { width: 10px; height: 10px; border-radius: 50%; background: var(--s); }
.col-hd b { font-size: 14.5px; }
.col-hd .n { margin-left: auto; min-width: 26px; height: 24px; border-radius: 99px; background: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 8px; box-shadow: var(--sh-1); }
.col-body { display: grid; gap: 10px; }
.col-empty { text-align: center; color: var(--ink-4); font-weight: 700; font-size: 13px; padding: 26px 8px; border: 2px dashed rgba(22, 18, 15, .08); border-radius: 16px; }
.oc { background: #fff; border-radius: 16px; box-shadow: var(--sh-1); padding: 12px; cursor: pointer; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; border-left: 4px solid var(--s); animation: in .45s var(--spring) both; }
.oc:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.oc.fresh { animation: in .5s var(--spring) both, glow 2.2s ease-out 2; }
@keyframes in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(30, 155, 255, .6); } 100% { box-shadow: 0 0 0 14px rgba(30, 155, 255, 0); } }
.oc .t1 { display: flex; align-items: center; gap: 8px; }
.oc .num { font-weight: 800; font-size: 15px; }
.oc .age { margin-left: auto; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.oc .age svg { width: 13px; height: 13px; }
.oc .age.warn { color: var(--ember); }
.oc .age.late { color: var(--red); }
.oc .who { font-weight: 700; font-size: 14px; margin-top: 4px; }
.oc .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.oc .items { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.oc .items b { color: var(--ink); font-variant-numeric: tabular-nums; }
.oc .items .more { color: var(--ink-3); font-weight: 700; }
.oc .t3 { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.oc .t3 .tot { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc .t3 .btn { padding: 0 10px; }
.oc .t3 .btn { margin-left: auto; }
.oc.leaving { animation: out .35s var(--ease) forwards; }
@keyframes out { to { opacity: 0; transform: translateX(40px) scale(.95); } }

/* mobile board tabs */
.col-tabs { display: none; }

/* ── Drawer ───────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(20, 10, 5, .38); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); z-index: 61; transform: translateX(104%); transition: transform .45s cubic-bezier(.2, .9, .25, 1); display: flex; flex-direction: column; box-shadow: var(--sh-3); }
.drawer.show { transform: none; }
.drawer .d-hd { padding: 18px 20px 14px; background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .d-hd h2 { font-size: 24px; }
.drawer .d-hd .x { margin-left: auto; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: grid; gap: 14px; align-content: start; }
.drawer .d-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.drawer .d-foot .btn-lg { flex: 1; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 700; }
.kv dd { margin: 0; font-weight: 600; }
.lines { display: grid; gap: 10px; }
.ln { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.ln .ph { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: #EEE7E0; }
.ln .ph img { width: 100%; height: 100%; object-fit: cover; }
.ln b { display: block; font-size: 14.5px; }
.ln small { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.ln .w { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.ln .w input { width: 86px; height: 34px; text-align: right; }
.ev { display: grid; gap: 0; }
.ev div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); }
.ev div:first-child { border-top: 0; }
.ev time { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.ev b { font-weight: 700; }
.ev span { color: var(--ink-3); }

/* ── Tables ───────────────────────── */
.tbl-wrap { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFAF8; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FCFAF8; }
.tbl .r { text-align: right; }
.tbl .thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #EEE7E0; }
.tbl .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl .nm { display: flex; align-items: center; gap: 12px; }
.tbl .nm b { display: block; }
.tbl .nm small { color: var(--ink-3); font-weight: 600; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters .inp, .filters .sel { width: auto; min-width: 160px; height: 40px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* stock grid */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sk-card { background: #fff; border-radius: 18px; box-shadow: var(--sh-1); padding: 12px; display: grid; grid-template-columns: 64px 1fr; gap: 12px; position: relative; transition: opacity .2s; }
.sk-card.off { opacity: .55; }
.sk-card .ph { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--c); }
.sk-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.sk-card b { font-size: 14.5px; display: block; line-height: 1.2; }
.sk-card small { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.sk-card .lvl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.sk-card .bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(22, 18, 15, .07); overflow: hidden; }
.sk-card .bar i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); transition: width .5s var(--spring); }
.sk-card .bar i.low { background: var(--ember); }
.sk-card .bar i.out { background: var(--red); }
.sk-card .ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.sk-card .ctl .inp { width: 86px; height: 36px; text-align: center; font-weight: 800; }
.sk-card .ctl .switch { margin-left: auto; }

/* product editor */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.img-drop { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #EEE7E0; display: grid; place-items: center; cursor: pointer; }
.img-drop img { width: 100%; height: 100%; object-fit: cover; }
.img-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-drop .ov { position: absolute; inset: auto 10px 10px 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; text-align: center; backdrop-filter: blur(6px); }
.opt-group { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 12px; display: grid; gap: 8px; }
.opt-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; }

/* analytics */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: #fff; border-radius: 12px; box-shadow: var(--sh-2); padding: 10px 12px; font-size: 13px; min-width: 150px; opacity: 0; transition: opacity .12s; z-index: 5; }
.chart .tip.show { opacity: 1; }
.chart .tip .h { font-size: 12px; color: var(--ink-3); font-weight: 700; margin-bottom: 4px; }
.chart .tip .r { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.chart .tip .r i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.chart .tip .r b { font-variant-numeric: tabular-nums; }
.chart .tip .r span { color: var(--ink-3); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 13px; font-weight: 700; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 2.5px; border-radius: 2px; }
.legend i.sq { width: 10px; height: 10px; border-radius: 3px; }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(110px, 170px) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.hb .lbl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .trk { height: 12px; position: relative; }
.hb .trk i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--series-1); transition: width .8s var(--ease); }
.hb .val { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.hb .val small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
.heat { display: grid; grid-template-columns: 40px repeat(14, 1fr); gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.heat .c { aspect-ratio: 1.3; border-radius: 4px; background: #EEF3FA; cursor: default; }
.heat .c:hover { outline: 2px solid var(--ink); }
.heat .hl { display: flex; align-items: center; }
.heat .hh { text-align: center; }
.funnel { display: grid; gap: 10px; }
.fn { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; font-size: 13.5px; }
.fn .trk { height: 30px; }
.fn .trk i { display: block; height: 100%; border-radius: 0 6px 6px 0; }
.fn b { font-variant-numeric: tabular-nums; }
.fn .pct { color: var(--ink-3); font-weight: 700; font-size: 12px; display: block; }
.mix { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.mix i { display: block; height: 100%; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.refetch { opacity: .5; transition: opacity .2s; }

/* toasts */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #111; color: #fff; border-radius: 999px; padding: 10px 18px 10px 10px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .5); transform: translateY(-30px) scale(.6); opacity: 0; transition: transform .5s var(--spring), opacity .25s; font-size: 14px; font-weight: 600; max-width: 92vw; }
.toast.show { transform: none; opacity: 1; }
.toast .ti { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); flex: none; }
.toast.err .ti { background: var(--red); }
.toast.info .ti { background: var(--sky); }
.toast.warn .ti { background: var(--ember); }
.toast .ti svg { width: 17px; height: 17px; }
.toast small { display: block; opacity: .7; font-size: 12.5px; }
.toast button { color: var(--sun); font-weight: 800; margin-left: 6px; }

/* new order takeover banner */
.incoming { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 140px)); z-index: 55; visibility: hidden; background: var(--ink); color: #fff; border-radius: 22px; padding: 14px 14px 14px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--sh-3); transition: transform .55s var(--spring), visibility 0s .55s; min-width: min(520px, 92vw); }
.incoming.show { transform: translate(-50%, 0); visibility: visible; transition: transform .55s var(--spring), visibility 0s; }
.incoming .bell { width: 44px; height: 44px; border-radius: 14px; background: var(--grad-hot); display: grid; place-items: center; animation: ring 1.2s ease-in-out infinite; flex: none; }
.incoming .bell svg { width: 24px; height: 24px; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
.incoming b { display: block; font-size: 16px; }
.incoming small { opacity: .7; font-size: 13px; }
.incoming .btn { margin-left: auto; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 10% 0%, rgba(255, 90, 31, .25), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(139, 92, 246, .22), transparent 60%), var(--bg); }
.auth .box { width: min(420px, 100%); background: #fff; border-radius: 28px; padding: 30px; box-shadow: var(--sh-3); }
.auth .box img { height: 64px; margin-bottom: 18px; }
.auth h1 { font-size: 26px; }
.auth p { color: var(--ink-3); margin: 6px 0 20px; font-weight: 500; }

/* print ticket */
.ticket { width: 76mm; margin: 0 auto; font-family: "Plus Jakarta Sans", monospace; font-size: 12px; color: #000; }

/* rider */
.rider-list { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }

/* ── Responsive ───────────────────────── */

@media (max-width: 1080px) {
  :root { --side-w: 0px; }
  .side { display: none; }
  .top .in { padding: 12px 16px; min-height: 60px; }
  .top h1 { font-size: 20px; }
  .content { padding: 14px 16px 100px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 22px; }
  .grid-2, .grid-3, .ed-grid { grid-template-columns: 1fr; }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); height: calc(62px + env(safe-area-inset-bottom)); }
  .mnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 800; color: var(--ink-3); position: relative; }
  .mnav a svg { width: 23px; height: 23px; }
  .mnav a.on { color: var(--red); }
  .mnav .bdg { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }
  .col-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
  .col-tabs button { flex: none; height: 38px; padding: 0 14px; border-radius: 99px; background: #fff; box-shadow: var(--sh-1); font-weight: 800; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
  .col-tabs button i { width: 8px; height: 8px; border-radius: 50%; background: var(--s); }
  .col-tabs button em { font-style: normal; min-width: 22px; height: 22px; border-radius: 99px; background: rgba(22, 18, 15, .07); display: grid; place-items: center; font-size: 12px; padding: 0 6px; }
  .col-tabs button.on { background: var(--s); color: #fff; }
  .col-tabs button.on em { background: rgba(255, 255, 255, .25); }
  .board { display: block; overflow: visible; }
  .board .col { display: none; background: none; padding: 0; }
  .board .col.on { display: block; }
  .board .col-hd { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .incoming { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .hb { grid-template-columns: 100px 1fr auto; }
  .tbl .hide-m { display: none; }
}
@media print {
  .side, .top, .mnav, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
