/* ============ QRAYS dashboard (mobile-first) ============ */
:root {
  --ink: #0c0b09; --ink-2: #16130e; --ink-3: #241f17;
  --gold: #c8a25a; --gold-light: #ecd59f; --gold-deep: #9a7432;
  --grad-gold: linear-gradient(120deg, #f4e2ad 0%, #d3ad64 38%, #a57a33 70%, #e6c886 100%);
  --bg: #f6f3ee; --card: #fff; --line: #ebe4d8; --text: #1b1813; --muted: #81776a;
  --ok: #2f7a4f; --ok-bg: #e5f2ea; --warn: #a66a12; --warn-bg: #fbf0dc; --bad: #b5482f; --bad-bg: #f9e6e1; --info: #2f5f8a; --info-bg: #e3edf6; --pur: #6a4c93; --pur-bg: #eee7f6;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Jost', system-ui, -apple-system, sans-serif;
  --r: 18px; --side: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 500; font-size: 14px; transition: transform .15s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-dark { background: var(--ink); color: var(--gold-light); }
.btn-dark:hover { background: var(--ink-3); }
.btn-gold { background: var(--grad-gold); color: var(--ink); }
.btn-line { border: 1px solid var(--line); background: #fff; }
.btn-line:hover { border-color: var(--ink); }
.btn-danger { color: var(--bad); border: 1px solid #efcfc7; background: #fff; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; transition: background .2s; flex: none; }
.icon-btn:hover { background: rgba(0,0,0,.05); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 20%, rgba(200,162,90,.25), transparent 50%), var(--ink); }
.login-card { width: min(400px, 100%); text-align: center; color: #fbf3e0; }
.login-card img { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 22px; box-shadow: 0 0 0 1px rgba(200,162,90,.4), 0 30px 60px -20px rgba(0,0,0,.8); }
.login-card h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin: 0; }
.login-card p { color: rgba(251,243,224,.6); margin: 4px 0 28px; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card input[type=password] { height: 54px; border-radius: 16px; border: 1px solid rgba(200,162,90,.3); background: rgba(255,255,255,.06); padding: 0 18px; color: #fff; font-size: 16px; }
.login-card input[type=password]:focus { outline: none; border-color: var(--gold); }
.login-card label.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(251,243,224,.7); }
.login-card .btn { height: 54px; border-radius: 16px; font-size: 15px; }
.login-err { color: #f3a593; font-size: 14px; min-height: 20px; margin: 0; }
.login-hint { font-size: 13px; color: rgba(236,213,159,.6); margin-top: 18px; }
.login-hint code { color: var(--gold-light); }
.login a.back { display: inline-block; margin-top: 18px; color: rgba(236,213,159,.7); font-size: 14px; }

/* ---------- shell ---------- */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--ink); color: rgba(251,243,224,.7); display: flex; flex-direction: column; padding: 22px 14px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(200,162,90,.4); }
.brand b { display: block; font-family: var(--serif); font-size: 22px; letter-spacing: .14em; color: var(--gold-light); font-weight: 600; line-height: 1; }
.brand small { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; transition: background .2s, color .2s; position: relative; }
.side nav a:hover { background: rgba(255,255,255,.05); color: #fbf3e0; }
.side nav a.active { background: rgba(200,162,90,.14); color: var(--gold-light); }
.side nav a.active::before { content: ''; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--gold); }
.nbadge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.side-foot a, .side-foot button { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px; font-size: 14px; color: rgba(251,243,224,.6); width: 100%; text-align: left; }
.side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.05); color: #fbf3e0; }
.mode { margin: 12px 8px 0; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.4; background: rgba(255,255,255,.04); border: 1px solid rgba(200,162,90,.18); }
.mode b { color: var(--gold-light); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.mode b::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5bbf7f; }
.mode.local b::before { background: #e0a43c; }

.main { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 16px 32px; background: rgba(246,243,238,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; }
.top.scrolled { border-color: var(--line); }
.top h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0; line-height: 1.1; }
.top .sub { font-size: 13px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.top .mlogo { display: none; }
.content { padding: 8px 32px 40px; max-width: 1400px; }

/* ---------- cards / kpis ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel-h h2 { font-size: 16px; font-weight: 500; margin: 0; }
.panel-h a, .panel-h button.lnk { font-size: 13px; color: var(--gold-deep); font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; }
.kpi.dark { background: var(--ink); color: #fbf3e0; border-color: var(--ink); }
.kpi.dark::after { content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(200,162,90,.35), transparent 70%); }
.kpi span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi.dark span { color: var(--gold); }
.kpi b { display: block; font-size: 28px; font-weight: 500; margin: 8px 0 4px; letter-spacing: -.01em; line-height: 1.1; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi.dark small { color: rgba(251,243,224,.6); }
.up { color: var(--ok) !important; } .down { color: var(--bad) !important; }
.kpi.dark .up { color: #7ed49e !important; }
.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 16px; }

.chart { height: 230px; display: flex; align-items: flex-end; gap: 6px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; position: relative; }
.bar div { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #e8cd8c, #b88a3f); min-height: 3px; transition: height .8s var(--ease); position: relative; }
.bar.today div { background: var(--ink); }
.bar small { font-size: 10.5px; color: var(--muted); }
.bar:hover div::after { content: attr(data-v); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--gold-light); font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 140px; height: 140px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut div { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); }
.donut b { display: block; font-size: 22px; color: var(--text); font-weight: 500; }
.legend { display: grid; gap: 8px; font-size: 13px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { margin-left: auto; color: var(--muted); }

/* ---------- lists ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.searchbox { position: relative; flex: 1; min-width: 200px; }
.searchbox .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); width: 18px; height: 18px; }
.searchbox input { width: 100%; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 0 14px 0 40px; font-size: 15px; }
.searchbox input:focus { outline: none; border-color: var(--gold); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; white-space: nowrap; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--gold-light); }
.chip em { font-style: normal; font-size: 11px; opacity: .7; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .15s; }
.table tbody tr:hover { background: #fbf8f3; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table .who b { display: block; font-weight: 500; }
.table .who small { color: var(--muted); }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }

.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; text-transform: capitalize; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-pending { background: var(--warn-bg); color: var(--warn); }
.s-processing { background: var(--info-bg); color: var(--info); }
.s-shipped { background: var(--pur-bg); color: var(--pur); }
.s-delivered { background: var(--ok-bg); color: var(--ok); }
.s-cancelled { background: var(--bad-bg); color: var(--bad); }

/* mobile order cards (hidden on desktop) */
.ocards { display: none; }
.ocard { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; width: 100%; text-align: left; }
.ocard + .ocard { margin-top: 10px; }
.ocard b { font-weight: 500; }
.ocard .num { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.ocard .amt { font-weight: 600; text-align: right; }
.ocard .meta { font-size: 13px; color: var(--muted); }

.mini-list > * { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.mini-list > *:last-child { border-bottom: 0; }
.mini-list img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list .grow b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .grow small { color: var(--muted); font-size: 12.5px; }
.mini-list .end { text-align: right; font-size: 14px; font-weight: 500; }
.mini-list .end small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* products */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; text-align: left; transition: box-shadow .2s, transform .2s; }
.pcard:hover { box-shadow: 0 16px 30px -20px rgba(0,0,0,.35); transform: translateY(-2px); }
.pcard .ph { position: relative; aspect-ratio: 4/3; background: #f1ebe0; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph .tag { position: absolute; top: 10px; left: 10px; font-size: 11px; padding: 3px 10px; border-radius: 999px; background: #fff; font-weight: 500; }
.pcard .ph .tag.off { background: var(--ink); color: var(--gold-light); }
.pcard .pb { padding: 14px 16px 16px; display: grid; gap: 4px; }
.pcard .pb b { font-weight: 500; line-height: 1.3; }
.pcard .pb small { color: var(--muted); font-size: 12.5px; }
.pcard .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.stock { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.stock.low { background: var(--warn-bg); color: var(--warn); }
.stock.out { background: var(--bad-bg); color: var(--bad); }

/* ---------- sheet (detail / forms) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(12,11,9,.5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.scrim.open { opacity: 1; visibility: visible; }
.sheet { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .4s var(--ease); box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); }
.sheet.open { transform: none; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.sheet-h h3 { margin: 0; font-size: 18px; font-weight: 500; flex: 1; min-width: 0; }
.sheet-h h3 small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.sheet-b { flex: 1; overflow-y: auto; padding: 18px 20px 30px; overscroll-behavior: contain; display: grid; gap: 14px; align-content: start; }
.sheet-f { padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; display: flex; gap: 10px; }
.sheet-f .btn { flex: 1; }
.sheet-f .btn-danger { flex: 0 0 52px; padding: 0; }
.grab { display: none; }

.box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.box h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; word-break: break-word; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; }
.quick .icon { color: var(--gold-deep); }
.status-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.status-pick button { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 13px; text-transform: capitalize; font-weight: 500; }
.status-pick button.on { border-color: var(--ink); background: var(--ink); color: var(--gold-light); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 13.5px; }
.timeline li { display: flex; gap: 10px; align-items: center; }
.timeline li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.timeline span { color: var(--muted); margin-left: auto; font-size: 12.5px; }
.items .it { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.items .it:last-child { border: 0; }
.items img { width: 48px; height: 54px; border-radius: 10px; object-fit: cover; }
.items .it div { flex: 1; font-size: 14px; line-height: 1.35; }
.items small { color: var(--muted); }
.tot p { display: flex; justify-content: space-between; margin: 4px 0; font-size: 14px; }
.tot .g { font-size: 18px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }

/* forms */
.form { display: grid; gap: 14px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fl { display: grid; gap: 6px; }
.fl > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.fl input, .fl select, .fl textarea { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; font-size: 16px; }
.fl textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.fl input:focus, .fl select:focus, .fl textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,90,.15); }
.fl em { font-style: normal; font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: #d9d1c3; position: relative; transition: background .2s; cursor: pointer; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); background: var(--gold-light); }
.switch b { font-weight: 500; font-size: 14px; display: block; }
.switch small { color: var(--muted); font-size: 12.5px; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.imgs .im { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.imgs .im img { width: 100%; height: 100%; object-fit: cover; }
.imgs .im button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(12,11,9,.75); color: #fff; display: grid; place-items: center; font-size: 14px; }
.imgs .im .first { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: var(--ink); color: var(--gold-light); padding: 2px 6px; border-radius: 6px; }
.imgs label.add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed #cfc3ae; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; background: #fff; }
.imgs label.add input { display: none; }
.lib { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.lib button { flex: none; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.lib img { width: 100%; height: 100%; object-fit: cover; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-grid .panel h2 { font-size: 16px; font-weight: 500; margin: 0 0 4px; }
.settings-grid .panel > p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 100; background: var(--ink); color: var(--gold-light); padding: 12px 20px; border-radius: 14px; font-size: 14px; transition: all .3s var(--ease); pointer-events: none; box-shadow: 0 14px 40px -12px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); color: #fff; }

/* bottom tabs (mobile) */
.tabs { display: none; }
.fab { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: calc(76px + var(--safe-b)); }
  .top { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .top h1 { font-size: 26px; }
  .top .mlogo { display: block; width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(200,162,90,.4); }
  .top .hide-m { display: none; }
  .content { padding: 4px 16px 24px; }
  .kpis { gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 16px; border-radius: 16px; }
  .kpi b { font-size: 22px; }
  .kpi span { font-size: 10.5px; letter-spacing: .1em; }
  .kpi small { font-size: 11.5px; }
  .panel { padding: 16px; border-radius: 16px; }
  .chart { height: 180px; gap: 4px; }
  .bar small { font-size: 9px; }
  .bar:nth-child(odd) small { visibility: hidden; }
  .donut { width: 120px; height: 120px; }
  .donut div { width: 82px; height: 82px; }
  .table-wrap.orders { display: none; }
  .ocards { display: block; }
  .toolbar { gap: 8px; }
  .toolbar .chips { width: 100%; order: 3; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pcard .pb { padding: 10px 12px 12px; }
  .pcard .pb b { font-size: 14px; }
  .table.cust thead { display: none; }
  .table.cust tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.cust td { padding: 0; border: 0; }
  .table.cust td.hide-m { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(12,11,9,.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 4px calc(8px + var(--safe-b)); border-top: 1px solid rgba(200,162,90,.2); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: rgba(236,213,159,.55); position: relative; padding: 4px 0; }
  .tabs a .icon { width: 23px; height: 23px; }
  .tabs a.active { color: var(--gold-light); }
  .tabs a.active::before { content: ''; position: absolute; top: -8px; width: 28px; height: 2px; border-radius: 2px; background: var(--gold); }
  .tabs .nbadge { position: absolute; top: -2px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(86px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; background: var(--grad-gold); color: var(--ink); z-index: 35; box-shadow: 0 14px 30px -10px rgba(120,84,30,.7); }
  .fab .icon { width: 26px; height: 26px; stroke-width: 2; }
  .sheet { top: auto; left: 0; width: 100%; height: 92vh; height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .sheet-h { border-radius: 22px 22px 0 0; padding-top: 22px; position: relative; }
  .grab { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #d9d1c3; }
  .sheet-b { padding: 16px 16px 30px; }
  .sheet-f { padding: 12px 16px calc(12px + var(--safe-b)); }
  .f3 { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(90px + var(--safe-b)); }
}
@media (max-width: 400px) {
  .f2 { grid-template-columns: 1fr; }
  .kpi b { font-size: 20px; }
}
