/* HORA DEL CAFE — gaya aplikasi (tablet-first). Semua warna lewat token agar tema terang/gelap konsisten. */

:root {
  color-scheme: light;
  --bg: #f6f2ec;
  --surface: #fffdf9;
  --surface-2: #f3ede4;
  --surface-3: #ebe3d7;
  --text: #1f1a16;
  --text-2: #5a5048;
  --muted: #877c73;
  --border: #e5ddd1;
  --border-strong: #d4c8b8;
  --accent: #6f4424;
  --accent-hover: #5b371c;
  --accent-soft: #f1e5d8;
  --accent-ink: #ffffff;
  --caramel: #c9853f;
  --success: #17733c;
  --success-soft: #e3f3e8;
  --warning: #9a5b00;
  --warning-soft: #fdf0d9;
  --danger: #b3261e;
  --danger-soft: #fbe5e2;
  --info: #1f5fa8;
  --info-soft: #e3eefb;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(31, 26, 22, 0.06), 0 4px 16px rgba(31, 26, 22, 0.05);
  --shadow-lg: 0 12px 40px rgba(31, 26, 22, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --sidebar-collapsed: 72px;
  --topbar: 60px;
  /* grafik (palet tervalidasi CVD terhadap surface) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --grid: #ece5da;
  --axis: #cfc4b4;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #110e0c;
    --surface: #1d1916;
    --surface-2: #26211d;
    --surface-3: #2f2924;
    --text: #f5efe8;
    --text-2: #cfc5bb;
    --muted: #9a9088;
    --border: #3a332d;
    --border-strong: #4a4139;
    --accent: #d39b6a;
    --accent-hover: #e0ad80;
    --accent-soft: #3a2a1d;
    --accent-ink: #1d1410;
    --success: #4cc27a;
    --success-soft: #16301f;
    --warning: #f0b34a;
    --warning-soft: #33260f;
    --danger: #f07a6f;
    --danger-soft: #3a1b18;
    --info: #7fb2f0;
    --info-soft: #172a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --grid: #2c2622;
    --axis: #453c35;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #110e0c;
  --surface: #1d1916;
  --surface-2: #26211d;
  --surface-3: #2f2924;
  --text: #f5efe8;
  --text-2: #cfc5bb;
  --muted: #9a9088;
  --border: #3a332d;
  --border-strong: #4a4139;
  --accent: #d39b6a;
  --accent-hover: #e0ad80;
  --accent-soft: #3a2a1d;
  --accent-ink: #1d1410;
  --success: #4cc27a;
  --success-soft: #16301f;
  --warning: #f0b34a;
  --warning-soft: #33260f;
  --danger: #f07a6f;
  --danger-soft: #3a1b18;
  --info: #7fb2f0;
  --info-soft: #172a40;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --grid: #2c2622;
  --axis: #453c35;
}

@media (min-width: 1400px) { :root { font-size: 15.5px; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.align-start { align-items: start; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40; transition: width 0.22s ease, transform 0.22s ease; overflow: hidden;
}
.sidebar-head { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; transition: opacity 0.18s ease; }
.brand-text strong { font-size: 0.98rem; letter-spacing: 0.02em; white-space: nowrap; }
.brand-text span { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 10px 20px; scrollbar-width: thin; }
.nav-group { margin-top: 10px; }
.nav-group-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 6px 12px 4px; white-space: nowrap; transition: opacity 0.18s ease; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2);
  text-decoration: none; white-space: nowrap; font-weight: 520; position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .nav-label { transition: opacity 0.18s ease; overflow: hidden; text-overflow: ellipsis; }
.nav a .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 0.72rem; display: grid; place-items: center; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px; flex-shrink: 0; }
.collapse-btn { width: 100%; justify-content: flex-start; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; transition: margin-left 0.22s ease; display: flex; flex-direction: column; }
.app.collapsed .sidebar { width: var(--sidebar-collapsed); }
.app.collapsed .main { margin-left: var(--sidebar-collapsed); }
.app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .nav-group-title, .app.collapsed .collapse-label { opacity: 0; pointer-events: none; }
.app.collapsed .nav a .nav-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 0.64rem; padding: 0 4px; }
.app.collapsed .nav-group-title { height: 8px; padding: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 20px;
}
.topbar .page-title { font-weight: 650; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 20px; max-width: 1480px; width: 100%; margin: 0 auto; }
.menu-toggle { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: min(86vw, 300px); box-shadow: var(--shadow-lg); }
  .app.drawer-open .sidebar { transform: translateX(0); }
  .app .main, .app.collapsed .main { margin-left: 0; }
  .app.collapsed .sidebar { width: min(86vw, 300px); }
  .app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .nav-group-title { opacity: 1; }
  .menu-toggle { display: inline-flex; }
  .collapse-btn { display: none; }
  .app.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 35; }
  .content { padding: 14px; }
  .topbar { padding: 0 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none; transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 0.9rem; }
.btn-lg { min-height: 56px; padding: 0 22px; font-size: 1.05rem; border-radius: 14px; }
.btn-xl { min-height: 64px; padding: 0 24px; font-size: 1.15rem; border-radius: 16px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 1rem; }
.card-body { padding: 14px 16px 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; box-shadow: var(--shadow); }
.tile-label { font-size: 0.82rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.tile-hero .tile-value { font-size: clamp(1.45rem, 2.1vw, 2rem); }
.delta { font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.formula { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-variant-numeric: tabular-nums; }
.formula .f-label { color: var(--text-2); }
.formula .f-value { text-align: right; }
.formula .f-total { font-weight: 700; color: var(--text); border-top: 1px solid var(--border); padding-top: 6px; }
.formula .f-indent { padding-left: 16px; }
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field .error-text { font-size: 0.8rem; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); outline: none; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea { padding: 10px 12px; min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-money { text-align: right; font-variant-numeric: tabular-nums; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font-size: 0.86rem; }
.input-group .addon:first-child { border-right: 0; border-radius: 11px 0 0 11px; }
.input-group .addon:last-child { border-left: 0; border-radius: 0 11px 11px 0; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: 11px 0 0 11px; }
.input-group .input:last-child { border-radius: 0 11px 11px 0; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; user-select: none; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.filterbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar .input, .filterbar .select { min-height: 42px; width: auto; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 38px; min-width: 220px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.78rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sorted { color: var(--text); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.table-cards { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 700px) {
  .table-wrap.responsive table { display: none; }
  .table-wrap.responsive .table-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
  .table-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
  .table-card.clickable { cursor: pointer; }
  .table-card .tc-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 0.9rem; }
  .table-card .tc-row .tc-label { color: var(--muted); }
  .table-card .tc-row .tc-value { text-align: right; min-width: 0; overflow-wrap: anywhere; }
}
.empty { padding: 36px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs .active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Modal, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 14, 10, 0.45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.14s ease; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop 0.16s ease; }
.modal.wide { width: min(860px, 100%); }
.modal.xwide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide, .modal.xwide { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0.4; } to { transform: none; opacity: 1; } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: pop 0.18s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
.alert { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* ---------- Dropdown (notifikasi, akun) ---------- */
.dropdown { position: relative; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; z-index: 60; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text); text-decoration: none; min-height: 44px; }
.menu-item:hover { background: var(--surface-2); }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--muted); }
.notif-dot.danger { background: var(--status-critical); }
.notif-dot.warning { background: var(--status-warning); }
.notif-dot.info { background: var(--series-1); }

/* ---------- Quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 86px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 650; color: var(--text); box-shadow: var(--shadow); }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.quick button .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; height: calc(100vh - var(--topbar) - 40px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; flex-shrink: 0; }
.chip { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--text-2); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; overflow-y: auto; align-content: start; padding: 2px 2px 12px; }
.product-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 118px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; box-shadow: var(--shadow); color: var(--text); }
.product-tile:hover { border-color: var(--accent); }
.product-tile:active { transform: scale(0.99); }
.product-tile .pt-name { font-weight: 650; font-size: 1rem; line-height: 1.25; }
.product-tile .pt-price { font-weight: 700; color: var(--accent); }
.product-tile .pt-meta { font-size: 0.76rem; color: var(--muted); }
.product-tile .pt-stripe { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.product-tile.soldout { opacity: 0.5; }
.cart { display: flex; flex-direction: column; min-height: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 14px; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item .ci-name { font-weight: 650; }
.cart-item .ci-sub { font-size: 0.8rem; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.stepper .qty { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-totals { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.cart-totals .ct-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.cart-totals .ct-total { font-size: 1.35rem; font-weight: 750; }
.cart-actions { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pay-methods button { min-height: 56px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 650; cursor: pointer; }
.pay-methods button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cash-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cash-quick button { min-height: 48px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 650; cursor: pointer; }
.big-number { font-size: 2rem; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.variant-btn { min-height: 72px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 650; }
.variant-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.variant-btn small { font-weight: 500; color: var(--muted); }
.addon-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pos-mobile-bar { display: none; }
.pos-close { display: none; }
@media (max-width: 1024px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 820px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow: visible; padding-bottom: 90px; }
  .cart { display: none; }
  .cart.open { display: flex; position: fixed; inset: 0; z-index: 70; border-radius: 0; }
  .pos-close { display: inline-flex; }
  .pos-mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); z-index: 50; gap: 10px; }
}

/* ---------- Queue ---------- */
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.queue-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.queue-card .q-no { font-weight: 750; font-size: 1.05rem; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .label { fill: var(--text-2); font-size: 11px; }
.chart .value-label { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 0.8rem; min-width: 150px; z-index: 5; }
.chart-tooltip .tt-title { color: var(--muted); font-size: 0.74rem; margin-bottom: 4px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tooltip .tt-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tooltip .tt-val { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.line-key { display: inline-block; width: 14px; height: 2px; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.s1 { background: var(--series-1); } .s2 { background: var(--series-2); } .s3 { background: var(--series-3); } .s4 { background: var(--series-4); }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 5px 0; font-size: 0.88rem; }
.hbar-track { height: 14px; position: relative; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.meter { height: 10px; background: color-mix(in srgb, var(--series-1) 16%, var(--surface)); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--series-1); transition: width 0.3s ease; }
.meter.good > span { background: var(--status-good); }
.meter.warn > span { background: var(--status-warning); }
.chart-toggle { font-size: 0.8rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 55%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--border); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 16px; }

/* ---------- Print (struk & laporan) ---------- */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; background: #fff; }
  @page { margin: 8mm; }
}
.receipt { width: 58mm; font-family: "Courier New", ui-monospace, monospace; font-size: 11px; color: #000; line-height: 1.35; }
.receipt.w80 { width: 76mm; font-size: 12px; }
.receipt .r-center { text-align: center; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 6px; }
.receipt .r-sep { border-top: 1px dashed #000; margin: 5px 0; }
.receipt .r-bold { font-weight: 700; }
.print-report { font-family: system-ui, sans-serif; color: #000; font-size: 11pt; }
.print-report h1 { font-size: 16pt; margin-bottom: 2mm; }
.print-report table { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.print-report td, .print-report th { border-bottom: 0.3mm solid #ccc; padding: 1.5mm 2mm; text-align: left; }
.print-report td.num { text-align: right; }
.print-report .total td { font-weight: 700; border-top: 0.5mm solid #000; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
