/* =====================================================================
   Warung 3A — Spatial Glass Design System (mobile-first)
   ===================================================================== */
:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --page: #eef1fb;
  --orb-1: #a5b4fc; --orb-2: #f9a8d4; --orb-3: #7dd3fc; --orb-4: #fde68a;

  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .80);
  --glass-soft: rgba(255, 255, 255, .40);
  --glass-hover: rgba(255, 255, 255, .70);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-edge: rgba(255, 255, 255, .95);
  --hairline: rgba(15, 23, 42, .08);
  --blur: 22px;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --text-inv: #ffffff;

  --accent: #5b5bf6;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-soft: rgba(91, 91, 246, .12);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --ring: 0 0 0 4px rgba(99, 102, 241, .22);

  --good: #0f9d58;  --good-bg: rgba(16, 185, 129, .14);
  --warn: #b45309;  --warn-bg: rgba(245, 158, 11, .16);
  --bad:  #dc2626;  --bad-bg:  rgba(239, 68, 68, .13);
  --info: #2563eb;  --info-bg: rgba(59, 130, 246, .13);

  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px -12px rgba(30, 41, 82, .18);
  --shadow-2: 0 2px 6px rgba(15, 23, 42, .06), 0 28px 60px -18px rgba(30, 41, 82, .32);
  --shadow-3: 0 30px 80px -20px rgba(15, 23, 42, .45);

  --r-xl: 28px; --r-lg: 22px; --r: 16px; --r-sm: 12px; --r-xs: 9px;
  --nav-h: 94px; /* jarak bawah 10 + bar 64 + tombol Kasir menonjol 20 */
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* chart roles (validated palette) */
  --chart-surface: #f6f7fb;
  --grid: rgba(15, 23, 42, .08);
  --axis: rgba(15, 23, 42, .22);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
  --pos: #2a78d6; --neg: #e34948;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #070a14;
    --orb-1: #4338ca; --orb-2: #9d174d; --orb-3: #0e7490; --orb-4: #6d28d9;
    --glass: rgba(20, 24, 40, .56);
    --glass-strong: rgba(22, 26, 44, .86);
    --glass-soft: rgba(255, 255, 255, .05);
    --glass-hover: rgba(40, 46, 72, .7);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-edge: rgba(255, 255, 255, .14);
    --hairline: rgba(255, 255, 255, .08);
    --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #94a3b8;
    --accent: #818cf8; --accent-soft: rgba(129, 140, 248, .16);
    --ring: 0 0 0 4px rgba(129, 140, 248, .25);
    --good: #34d399; --good-bg: rgba(52, 211, 153, .14);
    --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .14);
    --bad: #f87171;  --bad-bg: rgba(248, 113, 113, .14);
    --info: #60a5fa; --info-bg: rgba(96, 165, 250, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 30px 60px -18px rgba(0, 0, 0, .75);
    --chart-surface: #161a26;
    --grid: rgba(255, 255, 255, .08); --axis: rgba(255, 255, 255, .22);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #cde2fb;
    --pos: #3987e5; --neg: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #070a14;
  --orb-1: #4338ca; --orb-2: #9d174d; --orb-3: #0e7490; --orb-4: #6d28d9;
  --glass: rgba(20, 24, 40, .56);
  --glass-strong: rgba(22, 26, 44, .86);
  --glass-soft: rgba(255, 255, 255, .05);
  --glass-hover: rgba(40, 46, 72, .7);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-edge: rgba(255, 255, 255, .14);
  --hairline: rgba(255, 255, 255, .08);
  --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #94a3b8;
  --accent: #818cf8; --accent-soft: rgba(129, 140, 248, .16);
  --ring: 0 0 0 4px rgba(129, 140, 248, .25);
  --good: #34d399; --good-bg: rgba(52, 211, 153, .14);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .14);
  --bad: #f87171;  --bad-bg: rgba(248, 113, 113, .14);
  --info: #60a5fa; --info-bg: rgba(96, 165, 250, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 30px 60px -18px rgba(0, 0, 0, .75);
  --chart-surface: #161a26;
  --grid: rgba(255, 255, 255, .08); --axis: rgba(255, 255, 255, .22);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #cde2fb;
  --pos: #3987e5; --neg: #e66767;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 15px; line-height: 1.45;
  color: var(--text); background: var(--page); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
img, svg { display: block; }
svg:not([width]) { width: 20px; height: 20px; flex: none; } /* ukuran default ikon; komponen menimpa */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: none; box-shadow: var(--ring); }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Ambient spatial background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(80px); opacity: .55; will-change: transform;
  animation: drift 28s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { background: var(--orb-1); top: -20vmax; left: -15vmax; }
.ambient i:nth-child(2) { background: var(--orb-2); top: 10vmax; right: -25vmax; animation-delay: -7s; animation-duration: 34s; }
.ambient i:nth-child(3) { background: var(--orb-3); bottom: -30vmax; left: 10vmax; animation-delay: -14s; animation-duration: 38s; }
.ambient i:nth-child(4) { background: var(--orb-4); bottom: -10vmax; right: 5vmax; width: 35vmax; height: 35vmax; opacity: .4; animation-delay: -3s; }
.ambient::after {
  content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-4vmax, 8vmax, 0) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .ambient i { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Glass primitives ---------- */
.glass, .card, .panel {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-edge);
  border-radius: var(--r-lg);
}
.glass-strong { background: var(--glass-strong); }
.card { padding: 16px; }
.card.pad-lg { padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
/* specular highlight that follows the pointer (spatial feel) */
.spatial { isolation: isolate; overflow: hidden; }
.spatial::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(255, 255, 255, .45), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
:root[data-theme="dark"] .spatial::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(165, 180, 252, .14), transparent 45%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spatial::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(165, 180, 252, .14), transparent 45%); } }
.spatial:hover::after { opacity: 1; }
.lift { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, background .2s; }
@media (hover: hover) { .lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge); } }
.lift:active { transform: scale(.985); }

/* ---------- Layout shell ---------- */
.shell { min-height: 100dvh; }
.content { min-width: 0; }
.main { padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 16px); max-width: 1480px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  transition: background .25s, box-shadow .25s;
}
.topbar.scrolled {
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 var(--hairline), 0 10px 30px -18px rgba(15, 23, 42, .35);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { margin-left: -6px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 14px; border: 2px solid var(--glass-edge);
  box-shadow: var(--shadow-1);
}
.shift-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--text-2); white-space: nowrap;
}
.shift-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.sync-pill { border: 1px solid var(--glass-border); cursor: pointer; }
@media (max-width: 479px) {
  .shift-pill[data-shift] { width: 36px; height: 36px; padding: 0; justify-content: center; flex: none; }
  .shift-pill[data-shift] span:not(.dot) { display: none; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 20px; }
}
.sync-pill.off { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.sync-pill.pending { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.sync-pill.pending svg { animation: spin 2.4s linear infinite; }
.shift-pill.on .dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } }

/* Bottom nav (mobile)
 * Tata letak tetap per item (tinggi bar 64px): ikon 22px @ y13–35 · jarak 4px · label 12px @ y39–51.
 * Tombol Kasir melayang absolut (tidak ikut menentukan tinggi baris): dasar tombol sejajar dasar
 * ikon lain (y35, termasuk border 1px) dan labelnya sebaris dengan label lain. */
.bottom-nav {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
  height: 64px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: 100%;
  border-radius: 24px; padding: 0 6px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge);
}
.bottom-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; height: 100%; color: var(--text-3); transition: color .2s; -webkit-tap-highlight-color: transparent;
}
.bottom-nav a svg { width: 22px; height: 22px; flex: none; display: block; }
.bottom-nav a > span:last-child {
  display: block; max-width: 100%; height: 12px; font-size: 10.5px; line-height: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.fab { padding-top: 26px; } /* = slot ikon 22px + jarak 4px → label sebaris */
.bottom-nav a.fab span.ic {
  position: absolute; top: -20px; left: calc(50% - 27px); width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: var(--accent-grad); box-shadow: 0 12px 26px -8px rgba(99, 102, 241, .7), inset 0 1px 0 rgba(255, 255, 255, .4);
  border: 3px solid var(--glass-edge); transition: transform .2s;
}
.bottom-nav a.fab svg { width: 24px; height: 24px; }
.bottom-nav a.fab:active span.ic { transform: scale(.96); }
.bottom-nav a.fab.active { color: var(--text-2); }

/* Tombol aksi menempel di bawah layar, di atas bottom nav (termasuk tombol Kasir & area aman iPhone) */
.sticky-actions { position: sticky; z-index: 5; bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }
@media (min-width: 1024px) { .sticky-actions { bottom: 16px; } }

/* Sidebar (desktop) */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .shell { display: grid; grid-template-columns: 264px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 14px; height: calc(100dvh - 28px); margin: 14px 0 14px 14px;
    padding: 18px 12px; border-radius: var(--r-xl); overflow-y: auto; scrollbar-width: none;
  }
  .main { padding: 8px 28px 40px; }
  .topbar { padding: 18px 28px 10px; }
  .topbar h1 { font-size: 26px; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: var(--accent-grad); box-shadow: 0 10px 22px -8px rgba(99, 102, 241, .7), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.brand b { display: block; font-size: 16px; }
.brand small { color: var(--text-3); font-size: 11.5px; }
.nav-group { margin-top: 10px; }
.nav-group > span { display: block; padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; color: var(--text-2);
  font-weight: 600; font-size: 14px; transition: background .2s, color .2s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; }
.nav-link:hover { background: var(--glass-soft); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .18); }
.nav-link .count { margin-left: auto; font-size: 11px; background: var(--bad-bg); color: var(--bad); padding: 1px 7px; border-radius: 999px; }

/* ---------- Typography helpers ---------- */
.h2 { font-size: 17px; font-weight: 750; }
.h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.section-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 24px 2px 10px; }
.section-title .h2 { display: flex; align-items: center; gap: 8px; }
.section-title .h2 svg { width: 20px; height: 20px; }
.section-title > span.small, .section-title > .small { flex-basis: 100%; }
@media (min-width: 760px) { .section-title > span.small, .section-title > .small { flex-basis: auto; } }

/* ---------- Layout utilities ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.gap-sm { gap: 6px; } .gap-lg { gap: 16px; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
/* Grid responsif: di layar kecil tetap bertumpuk satu kolom DENGAN jarak antar kartu */
.md-grid-2, .md-grid-3, .lg-grid-3, .lg-grid-4 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .md-grid-2, .md-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .md-grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .md-span-2 { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .md-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md-grid-3 > :last-child:nth-child(odd) { grid-column: auto; }
  .lg-grid-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
  .lg-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
.mt { margin-top: 12px; } .mt-lg { margin-top: 20px; } .mb { margin-bottom: 12px; }
.hide-mobile { display: none !important; }
@media (min-width: 760px) { .hide-mobile { display: revert !important; } .hide-desktop { display: none !important; } }
.divider { height: 1px; background: var(--hairline); margin: 12px 0; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text);
  font-weight: 650; font-size: 14.5px; white-space: nowrap; user-select: none;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 var(--glass-edge);
  transition: transform .15s, background .2s, box-shadow .2s, opacity .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--glass-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary {
  color: #fff; border-color: transparent; background: var(--accent-grad);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { background: var(--accent-grad); filter: brightness(1.06); }
.btn-success { color: #fff; border-color: transparent; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 24px -10px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-success:hover { background: linear-gradient(135deg, #10b981, #059669); filter: brightness(1.06); }
.btn-danger { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.btn-danger.solid { color: #fff; background: linear-gradient(135deg, #f43f5e, #dc2626); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-ghost:hover { background: var(--glass-soft); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; box-shadow: none; }
.btn-sm { --h: 36px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn-xs { --h: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { --h: 54px; font-size: 16px; border-radius: 18px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn-icon.round { border-radius: 50%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12px; color: var(--bad); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; font-size: 15px;
  background: var(--glass-soft); border: 1px solid var(--hairline); color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' 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; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--glass-strong); }
.input.invalid, .select.invalid { border-color: var(--bad); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-left: 42px; }
.input-group > .prefix { position: absolute; left: 14px; font-weight: 700; color: var(--text-3); font-size: 14px; pointer-events: none; }
.input-group > .prefix + .input { padding-left: 42px; }
.input-group > .suffix { position: absolute; right: 6px; }
.input-lg { height: 58px; font-size: 22px; font-weight: 750; border-radius: 18px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--hairline); position: relative; transition: background .2s; flex: none; box-shadow: inset 0 0 0 1px var(--hairline); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--hairline); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.seg button.active { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-1); }
/* seg yang mengisi lebar & membungkus rapi (metode bayar, pilihan satuan, dll) */
.seg.seg-fill { display: flex; flex-wrap: wrap; width: 100%; overflow: visible; }
.seg.seg-fill button { flex: 1 1 auto; text-align: center; }
/* rentang tanggal: grid 3 kolom di ponsel, tidak terpotong */
@media (max-width: 639px) {
  .seg.seg-range { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .seg.seg-range button { padding: 8px 4px; }
}

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Chips & badges ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 759px) {
  /* petunjuk visual bahwa chip dapat digeser */
  .chips:not(.wrap) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); padding-right: 22px; }
}
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.badge .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass); font-size: 13px; font-weight: 650; color: var(--text-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); white-space: nowrap; scroll-snap-align: start;
}
.chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.chip.active { background: var(--text); color: var(--page); border-color: transparent; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--glass-soft); color: var(--text-2); border: 1px solid var(--hairline); white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge.ok { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list + .list { border-top: 1px solid var(--hairline); } /* sambungan antar halaman pagedList */
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); color: inherit; min-width: 0;
}
.item:last-child { border-bottom: 0; }
a.item, button.item { transition: background .15s; text-align: left; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--hairline); font: inherit; color: inherit; }
a.item:last-child, button.item:last-child { border-bottom: 0; }
.item > .grow { display: flex; flex-direction: column; gap: 2px; }
.item .v { flex: none; max-width: 50%; }
.item .v .badge { margin-top: 3px; }
.list-head { padding: 12px 16px 6px; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--glass-soft); border-bottom: 1px solid var(--hairline); letter-spacing: .02em; }
.ic.cat-ic { position: relative; }
.ic.cat-ic::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--cat, var(--accent)); border: 2px solid var(--glass-strong); }
a.item:hover, button.item:hover { background: var(--glass-soft); }
.item .ic {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--glass-soft); border: 1px solid var(--hairline); color: var(--text-2);
}
.item .ic svg { width: 19px; height: 19px; }
.item .t { font-weight: 650; font-size: 14.5px; }
.item .s { font-size: 12.5px; color: var(--text-3); }
.item .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }      /* kartu ganjil terakhir tidak "yatim" */
@media (min-width: 900px) {
  .stats { gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .stats > :last-child:nth-child(odd) { grid-column: auto; }
}
.stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-radius: var(--r); }
.stat .label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); min-width: 0; }
.stat .label svg { width: 15px; height: 15px; flex: none; }
.stat .value { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .foot { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 11.5px; line-height: 1.35; color: var(--text-3); }
.stat .foot:empty { display: none; }
@media (min-width: 760px) {
  .stat { padding: 14px 16px; gap: 6px; border-radius: var(--r-lg); }
  .stat .label { font-size: 12.5px; }
  .stat .value { font-size: 22px; }
  .stat .foot { font-size: 12px; }
}
.mini-stats { display: grid; gap: 14px 12px; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); margin-top: 18px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 12px; }
.delta svg { width: 13px; height: 13px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.hero-stat { padding: 20px; overflow: hidden; }
.hero-stat .value { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
@media (min-width: 760px) { .hero-stat .value { font-size: 52px; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; position: sticky; top: 0; background: var(--glass-strong); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover { background: var(--glass-soft); }
.table tfoot td { font-weight: 800; border-top: 1px solid var(--hairline); border-bottom: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding: 4px; border-radius: 16px; background: var(--glass-soft); border: 1px solid var(--hairline); width: fit-content; max-width: 100%; }
.tabs a, .tabs button { flex: none; padding: 9px 14px; border-radius: 12px; font-weight: 650; font-size: 13.5px; color: var(--text-2); background: transparent; border: 0; }
.tabs .active { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-edge); }

/* ---------- Sheets / modals ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 11, 24, .38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .28s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; max-height: 94dvh; display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(34px) saturate(180%); backdrop-filter: blur(34px) saturate(180%);
  border: 1px solid var(--glass-border); border-bottom: 0; box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-edge);
  transform: translateY(105%); transition: transform .38s cubic-bezier(.2, .85, .25, 1);
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--hairline); margin: 9px auto 0; flex: none; background: var(--text-3); opacity: .35; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 10px; flex: none; }
.sheet-head h3 { flex: 1; font-size: 18px; font-weight: 800; min-width: 0; }
.sheet-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.sheet-body { padding: 4px 18px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet-foot { padding: 12px 18px 16px; display: flex; flex-wrap: wrap; gap: 8px; flex: none; border-top: 1px solid var(--hairline); }
.sheet-foot > .btn { flex: 1 1 0; min-width: 92px; }
@media (min-width: 760px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(var(--w, 560px), calc(100vw - 48px)); max-height: 88dvh;
    border-radius: 28px; border-bottom: 1px solid var(--glass-border);
    transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.2, .85, .25, 1), opacity .25s;
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: 18px; }
}

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 120; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; font-weight: 600; font-size: 14px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-2); pointer-events: auto;
  animation: toastIn .35s cubic-bezier(.2, .85, .25, 1);
}
.toast svg { width: 20px; height: 20px; flex: none; }
.toast.ok svg { color: var(--good); } .toast.bad svg { color: var(--bad); } .toast.warn svg { color: var(--warn); } .toast.info svg { color: var(--info); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* ---------- Skeleton / empty ---------- */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--glass-soft) 25%, var(--glass-hover) 50%, var(--glass-soft) 75%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--glass-border); color: var(--accent); }
.empty .ic svg { width: 28px; height: 28px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.page-loader { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.view-enter { animation: viewIn .38s cubic-bezier(.2, .85, .25, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px) scale(.995); } }

/* ---------- Toolbar / filter bar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 100%; }
.toolbar > .select { flex: 1 1 140px; width: auto; }
@media (min-width: 760px) { .toolbar .search { flex: 1 1 260px; } .toolbar > .select { flex: 0 1 190px; } }
.pager { display: flex; justify-content: center; padding: 14px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 28px 24px; border-radius: 32px; }
.login-card .logo { width: 64px; height: 64px; border-radius: 22px; font-size: 24px; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 26px; font-weight: 800; }
.login-card .tag { text-align: center; color: var(--text-3); margin: 4px 0 22px; }

/* ---------- POS ---------- */
.pos { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.pos > section, .content, .main > * { min-width: 0; }
.badge:empty { display: none; }
@media (min-width: 1024px) { .pos { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } }
.pos-search { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 20; padding: 8px; border-radius: 20px; margin-bottom: 10px; }
@media (min-width: 1024px) { .pos-search { top: 74px; } }
.pos-search .input { background: var(--glass-strong); }
.pgrid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard { padding: 12px; border-radius: 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; cursor: pointer; }
.pcard .cat { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; }
.pcard .name { font-weight: 700; font-size: 13.5px; line-height: 1.3; padding-right: 14px; min-height: 35px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .stock { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.pcard .stock i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); display: inline-block; }
.pcard .stock.low i { background: #f59e0b; } .pcard .stock.out i { background: var(--bad); }
.pcard.out { opacity: .5; }
.pcard .in-cart { position: absolute; top: -6px; left: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent-grad); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 6px 14px -4px rgba(99, 102, 241, .8); z-index: 2; }
.pcard { overflow: visible; }
.unit-pills { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }
.unit-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--hairline); background: var(--glass-soft); font-size: 11.5px; color: var(--text-3); font-weight: 600;
  line-height: 1.2; min-width: 0; transition: background .15s, transform .12s, border-color .15s;
}
.unit-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.unit-pill b { color: var(--text); font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-pill:hover { background: var(--accent-soft); border-color: rgba(99, 102, 241, .25); }
.unit-pill:active { transform: scale(.96); background: var(--accent-soft); }
.unit-pill.tier b::after { content: " ⚡"; font-size: 10px; }
.cartbar {
  position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(79, 70, 229, .92), rgba(147, 51, 234, .92)); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 18px 40px -12px rgba(79, 70, 229, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: toastIn .3s;
}
.cartbar .meta { flex: 1; min-width: 0; }
.cartbar .meta small { opacity: .85; font-size: 12px; }
.cartbar .meta b { display: block; font-size: 19px; font-weight: 800; }
.cartbar .btn { background: rgba(255, 255, 255, .95); color: #4338ca; border: 0; }
@media (min-width: 1024px) { .cartbar { display: none; } }
.cart-panel { position: sticky; top: 76px; padding: 0; display: none; max-height: calc(100dvh - 96px); flex-direction: column; overflow: hidden; }
@media (min-width: 1024px) { .cart-panel { display: flex; } }
.cart-head { padding: 16px 16px 10px; display: flex; align-items: center; gap: 8px; }
.cart-lines { overflow-y: auto; flex: 1; padding: 0 8px; min-height: 120px; }
.cart-foot { padding: 12px 16px 16px; border-top: 1px solid var(--hairline); }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 8px; border-bottom: 1px solid var(--hairline); }
.cline:last-child { border-bottom: 0; }
.cline .n { font-weight: 700; font-size: 14px; }
.cline .p { font-size: 12.5px; color: var(--text-3); }
.cline .lt { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.cline .ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.unit-select { height: 34px; border-radius: 10px; font-size: 13px; padding: 0 30px 0 10px; width: auto; background-position: right 8px center; }
.stepper { display: inline-flex; align-items: center; border-radius: 12px; background: var(--glass-soft); border: 1px solid var(--hairline); overflow: hidden; }
.stepper button { width: 36px; height: 34px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text); }
.stepper button:active { background: var(--accent-soft); }
.stepper button svg { width: 16px; height: 16px; }
.stepper input { width: 56px; height: 34px; border: 0; background: transparent; text-align: center; font-weight: 750; font-size: 14px; }
.stepper input:focus { outline: none; background: var(--glass-strong); }
.totals { display: grid; gap: 6px; font-size: 14px; }
.totals .r { display: flex; justify-content: space-between; gap: 10px; }
.totals .r.big { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.pay-total { text-align: center; padding: 6px 0 14px; }
.pay-total small { color: var(--text-3); font-weight: 600; }
.pay-total b { display: block; font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.cash-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cash-quick button { height: 46px; border-radius: 14px; font-weight: 750; font-size: 14.5px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 52px; border-radius: 16px; font-size: 20px; font-weight: 700; border: 1px solid var(--hairline); background: var(--glass-soft); color: var(--text); }
.keypad button:active { background: var(--accent-soft); transform: scale(.97); }
.change-box { padding: 14px 16px; border-radius: 18px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.change-box.ok { background: var(--good-bg); color: var(--good); }
.change-box.short { background: var(--warn-bg); color: var(--warn); }
.change-box b { font-size: 24px; font-weight: 800; }
.success-hero { text-align: center; padding: 12px 0 6px; }
.success-hero .check-anim { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 18px 40px -12px rgba(16, 185, 129, .8); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.success-hero .check-anim svg { width: 42px; height: 42px; stroke-width: 3; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.open-shift-card { max-width: 480px; margin: 6vh auto 0; text-align: center; padding: 28px 22px; }

/* Scanner */
.scanner-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; background: #000; }
.scanner-frame { position: relative; }
.scanner-frame::after { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #f43f5e; box-shadow: 0 0 12px #f43f5e; animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 25%; } to { top: 75%; } }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; min-width: 130px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-2); color: var(--text); opacity: 0; transition: opacity .12s; white-space: nowrap;
}
.chart-tip.show { opacity: 1; }
.chart-tip .tt { font-weight: 700; margin-bottom: 4px; color: var(--text-2); }
.chart-tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip .tr span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tip .tr b { font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key.line { height: 3px; border-radius: 2px; width: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-list { display: grid; gap: 8px; }
.legend-list .li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; font-size: 13px; }
.legend-list .li .pct { color: var(--text-3); font-size: 12px; min-width: 42px; text-align: right; }
.legend-list .li b { font-variant-numeric: tabular-nums; }
.chart-card { padding: 16px; }
.chart-card .chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chart-card .chart-head .h3 + .small { margin-top: 2px; }
.bar-list { display: grid; gap: 12px; }
.bar-list .bl { display: grid; gap: 5px; }
.bar-list .bl .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.bar-list .bl .top b { font-variant-numeric: tabular-nums; }
.bar-list .bl .track { height: 10px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.bar-list .bl .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; transition: width .6s cubic-bezier(.2, .85, .25, 1); }
.prop-bar { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; }
.prop-bar > i { display: block; height: 100%; min-width: 2px; }
.prop-bar > i:first-child { border-radius: 4px 0 0 4px; } .prop-bar > i:last-child { border-radius: 0 4px 4px 0; }

/* ---------- Misc ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.kv .total { font-size: 17px; font-weight: 800; }
.kv hr { grid-column: 1 / -1; border: 0; border-top: 1px dashed var(--hairline); margin: 2px 0; width: 100%; }
.note-box { padding: 12px 14px; border-radius: 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.note-box svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note-box > span { flex: 1 1 220px; min-width: 0; }
.note-box > .btn { flex: none; align-self: center; }
.note-box:has(> .btn) { flex-wrap: wrap; }
.note-box.warn { background: var(--warn-bg); color: var(--warn); }
.note-box.info { background: var(--info-bg); color: var(--info); }
.note-box.bad { background: var(--bad-bg); color: var(--bad); }
.note-box.ok { background: var(--good-bg); color: var(--good); }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.menu-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; text-align: center; border-radius: 22px; color: var(--text); font-size: 12.5px; font-weight: 650; }
.menu-tile .ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 20px -8px var(--c, rgba(99, 102, 241, .7)), inset 0 1px 0 rgba(255, 255, 255, .35); }
.menu-tile .ic svg { width: 22px; height: 22px; }
.report-tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; color: var(--text); }
.report-tile .ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; }
.report-tile .ic svg { width: 22px; height: 22px; }
.report-tile b { display: block; font-size: 15px; }
.report-tile span { font-size: 12.5px; color: var(--text-3); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 130; background: #dc2626; color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: calc(4px + env(safe-area-inset-top, 0px)) 8px 4px; }
.heat { display: grid; gap: 2px; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; min-width: 0; }
.perm-table td:first-child { font-weight: 600; }
.perm-table input { width: 18px; height: 18px; accent-color: var(--accent); }
.scroll-x { overflow-x: auto; }
kbd { font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--glass-soft); color: var(--text-3); }
