:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6ec;
  --ink: #1b1f2a;
  --ink-2: #4a5263;
  --muted: #7b8496;
  --brand: #d6166c;
  --brand-ink: #ffffff;
  --brand-soft: #fde7f1;
  --accent: #2563eb;
  --good: #15803d;   --good-soft: #dcfce7;
  --warn: #b45309;   --warn-soft: #fef3c7;
  --bad: #b91c1c;    --bad-soft: #fee2e2;
  --info: #1d4ed8;   --info-soft: #dbeafe;
  --violet: #6d28d9; --violet-soft: #ede9fe;
  --gray-soft: #eef0f4;
  --chart: #d6166c;
  --grid: #eceef2;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --radius: 10px;
  --sidebar: #161a24;
  --sidebar-ink: #c9cedb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --surface: #171b24; --surface-2: #1d222d; --border: #2a303d;
    --ink: #e8ebf2; --ink-2: #b4bccb; --muted: #8590a3;
    --brand: #f0428f; --brand-soft: #3a1426;
    --good: #4ade80; --good-soft: #10301c; --warn: #fbbf24; --warn-soft: #3a2a0a;
    --bad: #f87171; --bad-soft: #3b1414; --info: #93b4fd; --info-soft: #17264a;
    --violet: #c4b5fd; --violet-soft: #2a1f47; --gray-soft: #232834;
    --chart: #f0428f; --grid: #252a36; --sidebar: #0b0e13;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218; --surface: #171b24; --surface-2: #1d222d; --border: #2a303d;
  --ink: #e8ebf2; --ink-2: #b4bccb; --muted: #8590a3;
  --brand: #f0428f; --brand-soft: #3a1426;
  --good: #4ade80; --good-soft: #10301c; --warn: #fbbf24; --warn-soft: #3a2a0a;
  --bad: #f87171; --bad-soft: #3b1414; --info: #93b4fd; --info-soft: #17264a;
  --violet: #c4b5fd; --violet-soft: #2a1f47; --gray-soft: #232834;
  --chart: #f0428f; --grid: #252a36; --sidebar: #0b0e13;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.strong { font-weight: 600; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- layout */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: #fff; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex-shrink: 0; padding: 4px; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.topbar-logo { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 7px; padding: 2px; border: 1px solid var(--border); }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: #8a92a6; }
.nav { padding: 6px 10px; flex: 1; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6c7488; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--sidebar-ink); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav .badge { margin-left: auto; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot button { background: none; border: 0; color: #9aa3b8; padding: 4px 0; cursor: pointer; font: inherit; }
.sidebar-foot button:hover { color: #fff; }

.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 24px 28px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stat { padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.stat-accent { border-top: 3px solid var(--brand); }

/* ---------- buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 16px; }
.icon-btn, .btn.icon-btn { width: 30px; padding: 0; }
.btn svg { flex-shrink: 0; }

label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; height: 36px; width: 100%; }
textarea { padding: 8px 10px; height: auto; min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
input.sm, select.sm { height: 30px; font-size: 13px; padding: 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > :first-child { border-radius: 8px 0 0 8px; }
.input-group > :last-child { border-radius: 0 8px 8px 0; }
.input-group > * + * { margin-left: -1px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar input[type=search] { min-width: 240px; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tr.click { cursor: pointer; }
tfoot td { font-weight: 700; background: var(--surface-2); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-antrian { background: var(--gray-soft); color: var(--ink-2); }
.b-desain { background: var(--violet-soft); color: var(--violet); }
.b-cetak { background: var(--info-soft); color: var(--info); }
.b-finishing { background: var(--warn-soft); color: var(--warn); }
.b-selesai { background: var(--good-soft); color: var(--good); }
.b-diambil { background: var(--good); color: #fff; }
.b-batal { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.b-lunas { background: var(--good-soft); color: var(--good); }
.b-dp { background: var(--warn-soft); color: var(--warn); }
.b-belum { background: var(--bad-soft); color: var(--bad); }
.b-brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- tabs & chips */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ---------- POS */
/* ---------- kasir: tata letak 2 kolom (form + ringkasan) */
.pos2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pos-side { position: sticky; top: 16px; }
.sec-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sec-b { padding: 14px 16px; }
.sec-num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.grid-cust { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
@media (min-width: 1500px) { .grid-cust { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); } }
.add-bar { display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.add-bar input { height: 42px; font-size: 15px; }
.add-bar .btn { height: 42px; }
/* item pesanan */
.it { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.it:last-child { border-bottom: 0; }
.it.pending { background: var(--surface-2); }
.it-h { display: flex; gap: 10px; align-items: center; }
.it-prod { flex: 1; min-width: 0; font-weight: 600; }
.it-h > .btn { flex-shrink: 0; }
.it-sub { text-align: right; min-width: 130px; display: flex; flex-direction: column; line-height: 1.25; }
.it-sub .sub { font-size: 15px; font-variant-numeric: tabular-nums; }
.it-sub .formula { font-size: 11px; color: var(--muted); white-space: nowrap; }
.it-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0 34px; }
.it-fields.manual { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.it-fields input, .sizes input { height: 36px; }
.it .area-info { margin: 6px 0 0 34px; }
.it .note { display: block; margin: 10px 0 0 34px; width: calc(100% - 34px); height: 34px; font-size: 13px; }
.line-no { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
/* ukuran pakaian */
.sizes { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 0 34px; align-items: stretch; }
.sz-group { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); }
.sz-cap { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; white-space: nowrap; }
.sz-row { display: flex; gap: 6px; }
.sz { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sz span { font-size: 12px; font-weight: 700; }
.sz input { width: 56px; text-align: center; padding: 0 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.sz-total { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 8px; min-width: 70px; }
.sz-total strong { font-size: 16px; }
/* ringkasan */
.sum-items { padding: 10px 16px; max-height: 32vh; overflow-y: auto; border-bottom: 1px solid var(--border); }
.sum-it { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; }
.pay-box { margin: 0 16px 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; }
.totals { padding: 12px 16px; }
.totals .line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; }
.totals .line input { width: 140px; height: 32px; text-align: right; }
.totals .line input.fee-label { width: 150px; text-align: left; }
.totals .grand { font-size: 22px; font-weight: 800; border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 10px; }
/* katalog (modal) */
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.p-card { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.p-card:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.p-card.in { border-color: var(--brand); }
.p-card .n { font-weight: 600; padding-right: 24px; }
.p-card .c { font-size: 11px; color: var(--muted); }
.p-card .p { margin-top: auto; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.in-cart { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.cart-fab { display: none; }
/* saran (pelanggan & produk) */
.cust-box { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 320px; overflow-y: auto; margin-top: 4px; }
.suggest > div { padding: 8px 12px; cursor: pointer; }
.suggest > div:hover, .suggest > div.on { background: var(--brand-soft); }
.size-cfg { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-2); }

/* ---------- board (produksi) */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; }
.col-h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; border-bottom: 1px solid var(--border); }
.col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; box-shadow: var(--shadow); }
.job .inv { font-weight: 700; font-size: 13px; }
.job .items { font-size: 12px; color: var(--ink-2); margin: 4px 0; }
.job .acts { display: flex; gap: 4px; margin-top: 8px; }
.job.overdue { border-left: 3px solid var(--bad); }
.due-late { color: var(--bad); font-weight: 600; }
.due-soon { color: var(--warn); font-weight: 600; }

/* ---------- order detail */
.steps { display: flex; gap: 0; margin: 4px 0 8px; overflow-x: auto; }
.step { flex: 1; min-width: 90px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); position: relative; padding-top: 22px; }
.step::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--border); transform: translateX(-50%); z-index: 1; }
.step::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.step:first-child::after { display: none; }
.step.done { color: var(--ink); }
.step.done::before, .step.done::after { background: var(--brand); }
.step.cur::before { box-shadow: 0 0 0 4px var(--brand-soft); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--border); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }

/* ---------- chart */
.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: var(--chart); }
.chart .bar-hit:hover + .bar, .chart .bar:hover { opacity: .8; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart-tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 6px; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; margin-bottom: 10px; }
.hbar .track { grid-column: 1 / -1; height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }

/* ---------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10,12,18,.5); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.wide { width: min(820px, 100%); }
.modal-h { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 360px; animation: fade .15s; }
.toast.err { background: var(--bad); color: #fff; }
.toast.ok { background: var(--good); color: #fff; }

/* ---------- memuat */
#busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 40% 100%; background-repeat: no-repeat; }
#busy-bar.on { opacity: 1; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.splash img { background: #fff; border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.splash-dots { display: flex; gap: 6px; }
.splash-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot 1s infinite ease-in-out; }
.splash-dots i:nth-child(2) { animation-delay: .15s; } .splash-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #busy-bar.on, .splash-dots i { animation: none; } #busy-bar.on { background: var(--brand); } }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--sidebar), #3b0d24); }
.login { width: min(380px, 100%); padding: 28px; }
.login-logo { display: block; width: 150px; height: auto; margin: 0 auto 6px; background: #fff; border-radius: 12px; padding: 10px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .pos2 { grid-template-columns: 1fr; }
  .pos-side { position: static; }
  .grid-cust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-fab { display: flex; align-items: center; gap: 8px; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 25; height: 48px; padding: 0 16px;
    border: 0; border-radius: 12px; background: var(--ink); color: var(--surface); font: inherit; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
  .cart-fab svg { width: 18px; height: 18px; }
  .pos2 { padding-bottom: 64px; }
  #toasts { bottom: 76px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .layout.nav-open .sidebar { transform: none; }
  .layout.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .page { padding: 16px 16px 40px; }
  .g2, .g4, .form-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select, .toolbar input[type=search] { min-width: 0; flex: 1 1 140px; }
  .kv { grid-template-columns: 110px 1fr; }
  .grid-cust { grid-template-columns: 1fr; }
  .it-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; }
  .sizes, .it .area-info { margin-left: 0; }
  .it .note { margin-left: 0; width: 100%; }
  .it-h { flex-wrap: wrap; }
  .it-prod { flex-basis: calc(100% - 80px); }
  .it-sub { order: 3; flex: 1; flex-direction: row; justify-content: space-between; align-items: baseline; text-align: left; }
  .sz input { width: 48px; }
  .pos-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-card { min-height: 84px; padding: 10px; }
}
