/* =====================================================================
 *  Kopi Senja POS — gaya antarmuka (mengikuti desain Figma)
 *  Warna dari token tema (nav, primary, accent); lihat blok "tema warna".
 * ===================================================================== */
:root {
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-card: 0 1px 2px rgba(10,14,14,.06), 0 6px 16px -4px rgba(10,14,14,.06);
  --shadow-modal: 0 24px 48px -8px rgba(10,14,14,.22);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
/* ---------------------------------------------------------------- tema warna
 * Dipilih Administrator (Pengaturan > Tampilan): data-theme di <html>.
 * data-mode: light | dark | auto (ikuti perangkat). Kartu pratinjau memakai
 * data-theme sendiri sehingga selalu tampil dalam versi terang. */
:root, [data-theme="teal"] { --bg: #F3F6F6; --surface: #FFFFFF; --surface-2: #F7F9F9; --border: #DCE4E3; --text: #142322; --muted: #5F7270; --nav: #0B3B3A; --nav-2: #155352; --on-nav: #E8F3F2; --on-nav-muted: #8FB3B0; --primary: #0F766E; --primary-strong: #0B5D57; --primary-soft: #DDF1EE; --accent: #D97A2B; --accent-soft: #FBEBDD; --danger: #B83A26; --danger-soft: #F7E1DC; color-scheme: light; }
[data-theme="biru"] { --bg: #F3F5FA; --surface: #FFFFFF; --surface-2: #F7F9FC; --border: #DDE3EE; --text: #141B2D; --muted: #5C6680; --nav: #13213F; --nav-2: #1F3363; --on-nav: #E9EEFB; --on-nav-muted: #93A1C4; --primary: #2050C8; --primary-strong: #173DA0; --primary-soft: #E2EAFB; --accent: #D9921F; --accent-soft: #FBEFD9; --danger: #B83A26; --danger-soft: #F7E1DC; color-scheme: light; }
[data-theme="grafit"] { --bg: #F5F5F4; --surface: #FFFFFF; --surface-2: #F9F9F8; --border: #E4E4E1; --text: #1C1C1F; --muted: #6B6B70; --nav: #1C1C1F; --nav-2: #2E2E33; --on-nav: #F2F2F0; --on-nav-muted: #9A9AA0; --primary: #16805C; --primary-strong: #0F6447; --primary-soft: #DFF2EA; --accent: #6D5BD0; --accent-soft: #ECE9FB; --danger: #B83A26; --danger-soft: #F7E1DC; color-scheme: light; }
[data-theme="zaitun"] { --bg: #F5F4EE; --surface: #FFFFFF; --surface-2: #FAF9F4; --border: #E2E0D3; --text: #1F2414; --muted: #6B6F5C; --nav: #27301A; --nav-2: #3A4626; --on-nav: #EEF1E4; --on-nav-muted: #A2AB8C; --primary: #4D7C0F; --primary-strong: #3F6212; --primary-soft: #E8F1D9; --accent: #C2410C; --accent-soft: #FBE6DA; --danger: #B83A26; --danger-soft: #F7E1DC; color-scheme: light; }
[data-theme="kopi"] { --bg: #F4F1EC; --surface: #FFFFFF; --surface-2: #FAF8F4; --border: #E5DED4; --text: #24190F; --muted: #7B6D60; --nav: #2B1E16; --nav-2: #3B2B20; --on-nav: #F3E9DD; --on-nav-muted: #A8968A; --primary: #1E7550; --primary-strong: #155A3C; --primary-soft: #E1F0E7; --accent: #B9741C; --accent-soft: #F8EBD7; --danger: #B83A26; --danger-soft: #F7E1DC; color-scheme: light; }
:root[data-mode="dark"][data-theme="teal"] { --bg: #0E1716; --surface: #152221; --surface-2: #1A2A28; --border: #2A3D3B; --text: #E6F0EF; --muted: #92A8A5; --nav: #081F1E; --nav-2: #143533; --on-nav: #E6F0EF; --on-nav-muted: #86A5A2; --primary: #2BA597; --primary-strong: #4CC2B4; --primary-soft: #16403B; --accent: #F0A061; --accent-soft: #43301F; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
:root[data-mode="dark"][data-theme="biru"] { --bg: #0E121C; --surface: #151B29; --surface-2: #1A2132; --border: #2A3348; --text: #E7ECF7; --muted: #95A0BA; --nav: #0A1122; --nav-2: #1B2A4F; --on-nav: #E7ECF7; --on-nav-muted: #8C9AC0; --primary: #5B85F0; --primary-strong: #82A3F6; --primary-soft: #1C2B52; --accent: #F0B550; --accent-soft: #42331A; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
:root[data-mode="dark"][data-theme="grafit"] { --bg: #121214; --surface: #1B1B1E; --surface-2: #212125; --border: #313136; --text: #EDEDEC; --muted: #A0A0A6; --nav: #0C0C0E; --nav-2: #26262B; --on-nav: #EDEDEC; --on-nav-muted: #8E8E95; --primary: #3CB98A; --primary-strong: #62D0A6; --primary-soft: #17362B; --accent: #9A8BF0; --accent-soft: #2C2750; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
:root[data-mode="dark"][data-theme="zaitun"] { --bg: #12140D; --surface: #1A1D13; --surface-2: #20241A; --border: #333926; --text: #EEF0E6; --muted: #A6AB93; --nav: #0F130A; --nav-2: #2A331C; --on-nav: #EEF0E6; --on-nav-muted: #98A07F; --primary: #84B83A; --primary-strong: #A3CF63; --primary-soft: #26341A; --accent: #F07A45; --accent-soft: #45261A; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
:root[data-mode="dark"][data-theme="kopi"] { --bg: #15110E; --surface: #1E1814; --surface-2: #241D18; --border: #3A2F27; --text: #F1E9E1; --muted: #AD9D90; --nav: #110C09; --nav-2: #2C211A; --on-nav: #F3E9DD; --on-nav-muted: #A8968A; --primary: #3DAA78; --primary-strong: #5CC293; --primary-soft: #193A2B; --accent: #E39A3F; --accent-soft: #45321C; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"][data-theme="teal"] { --bg: #0E1716; --surface: #152221; --surface-2: #1A2A28; --border: #2A3D3B; --text: #E6F0EF; --muted: #92A8A5; --nav: #081F1E; --nav-2: #143533; --on-nav: #E6F0EF; --on-nav-muted: #86A5A2; --primary: #2BA597; --primary-strong: #4CC2B4; --primary-soft: #16403B; --accent: #F0A061; --accent-soft: #43301F; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
  :root[data-mode="auto"][data-theme="biru"] { --bg: #0E121C; --surface: #151B29; --surface-2: #1A2132; --border: #2A3348; --text: #E7ECF7; --muted: #95A0BA; --nav: #0A1122; --nav-2: #1B2A4F; --on-nav: #E7ECF7; --on-nav-muted: #8C9AC0; --primary: #5B85F0; --primary-strong: #82A3F6; --primary-soft: #1C2B52; --accent: #F0B550; --accent-soft: #42331A; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
  :root[data-mode="auto"][data-theme="grafit"] { --bg: #121214; --surface: #1B1B1E; --surface-2: #212125; --border: #313136; --text: #EDEDEC; --muted: #A0A0A6; --nav: #0C0C0E; --nav-2: #26262B; --on-nav: #EDEDEC; --on-nav-muted: #8E8E95; --primary: #3CB98A; --primary-strong: #62D0A6; --primary-soft: #17362B; --accent: #9A8BF0; --accent-soft: #2C2750; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
  :root[data-mode="auto"][data-theme="zaitun"] { --bg: #12140D; --surface: #1A1D13; --surface-2: #20241A; --border: #333926; --text: #EEF0E6; --muted: #A6AB93; --nav: #0F130A; --nav-2: #2A331C; --on-nav: #EEF0E6; --on-nav-muted: #98A07F; --primary: #84B83A; --primary-strong: #A3CF63; --primary-soft: #26341A; --accent: #F07A45; --accent-soft: #45261A; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
  :root[data-mode="auto"][data-theme="kopi"] { --bg: #15110E; --surface: #1E1814; --surface-2: #241D18; --border: #3A2F27; --text: #F1E9E1; --muted: #AD9D90; --nav: #110C09; --nav-2: #2C211A; --on-nav: #F3E9DD; --on-nav-muted: #A8968A; --primary: #3DAA78; --primary-strong: #5CC293; --primary-soft: #193A2B; --accent: #E39A3F; --accent-soft: #45321C; --danger: #F07A66; --danger-soft: #46221C; color-scheme: dark; }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -.5px; }
h2 { font-size: 18px; line-height: 26px; font-weight: 700; letter-spacing: -.2px; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 18px; }
.caps { font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s16 { width: 16px; height: 16px; } svg.i.s18 { width: 18px; height: 18px; } svg.i.s14 { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- layout: bar atas + tab bawah (HP) */
.app { display: flex; flex-direction: column; height: 100%; }
.topnav { position: relative; z-index: 35; background: var(--nav); color: var(--on-nav); display: flex; align-items: center; gap: 24px; min-height: 64px;
  padding-block: max(12px, env(safe-area-inset-top, 0px)) 12px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none !important; flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent); color: var(--nav); display: grid; place-items: center; flex: none; overflow: hidden; }
.brand-mark.has-logo { background: #fff; } .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand b { display: block; font-size: 15px; line-height: 20px; } .brand span { font-size: 12px; color: var(--on-nav-muted); }
.tn-items { display: flex; gap: 4px; align-items: center; min-width: 0; }
.tn-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-md); color: var(--on-nav-muted); font-weight: 600; border: 0; background: none; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tn-item:hover { color: var(--on-nav); background: rgba(255,255,255,.05); }
.tn-item.active { background: var(--nav-2); color: var(--on-nav); } .tn-item.active > svg:first-child { color: var(--accent); }
.tn-item .count { background: var(--accent); color: var(--nav); border-radius: 999px; font: 600 11px var(--mono); padding: 1px 7px; }
.tn-spacer { flex: 1; }
.dd { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-modal); padding: 6px; display: none; flex-direction: column; z-index: 45; }
.menu.right { left: auto; right: 0; } .dd.open .menu { display: flex; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text); background: none; border: 0; font-weight: 500; text-align: left; cursor: pointer; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: var(--surface-2); } .menu a.active { background: var(--primary-soft); color: var(--primary-strong); }
.menu a svg, .menu button svg { color: var(--muted); } .menu a.active svg { color: var(--primary); }
.menu .menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; gap: 4px; }
.printer-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--nav-2); color: var(--on-nav); font-size: 12px; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
.printer-chip svg { color: var(--on-nav-muted); } .printer-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.printer-chip i.on { background: #3BB57A; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--on-nav); cursor: pointer; padding: 0; text-align: left; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--accent); color: var(--nav); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.user-chip b { display: block; font-size: 14px; line-height: 18px; } .user-chip span { font-size: 12px; color: var(--on-nav-muted); }
.tabbar { display: none; }
.main { min-width: 0; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.main { flex: 1; min-height: 0; }
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.view.split { padding: 0; flex-direction: row; gap: 0; overflow: hidden; }
.view:not(.split) > *, .catalog > * { flex-shrink: 0; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
.panel .sheet-x { display: none; }
.page-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.page-head .title { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- controls */
.btn { text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; cursor: pointer; background: var(--surface); white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn.secondary { border-color: var(--border); } .btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.dark { background: var(--nav); color: var(--on-nav); }
.btn.lg { padding: 14px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); min-width: 0; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input-icon { position: relative; } .input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip .n { font: 12px var(--mono); color: var(--muted); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); } .chip.active .n { color: var(--bg); opacity: .7; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--primary-soft); color: var(--primary-strong); } .badge.warn { background: var(--accent-soft); color: var(--accent); } .badge.bad { background: var(--danger-soft); color: var(--danger); }
.role { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.role.administrator { background: var(--nav); color: var(--on-nav); } .role.manager { background: var(--accent); color: var(--nav); }
.role.kasir { background: var(--primary); color: #fff; } .role.waiter { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.switch { display: inline-block; vertical-align: middle; position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); } .switch input:checked + span::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--bg); border-radius: var(--r-md); padding: 3px; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 6px 14px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; cursor: pointer; flex: 1; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; gap: 12px; align-items: center; } .card-head .grow { display: flex; flex-direction: column; }
.card-ico { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.opt-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- tema & logo (Pengaturan > Tampilan) */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; color: var(--text); }
.theme-card.on { border: 2px solid var(--primary); }
.tc-bar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--nav); }
.tc-bar i { width: 22px; height: 6px; border-radius: 3px; background: var(--on-nav-muted); } .tc-bar .tc-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }
.tc-body { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--bg); }
.tc-cards { display: flex; gap: 6px; } .tc-cards > span { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.tc-cards i { width: 70%; height: 5px; border-radius: 2px; background: var(--muted); } .tc-cards b { width: 90%; height: 7px; border-radius: 2px; background: var(--text); }
.tc-btn { height: 14px; border-radius: 4px; background: var(--primary); }
.tc-label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-weight: 600; background: var(--surface); }
.tc-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; } .theme-card.on .tc-radio { border: 5px solid var(--primary); }
.logo-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; border: 1.5px dashed var(--border); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; text-align: center; }
.logo-drop img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: var(--r-md); }

/* ---------------------------------------------------------------- tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: auto; min-height: 0; }
table.t { width: 100%; border-collapse: collapse; }
.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; z-index: 1; }
.t td { padding: 10px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.t .r { text-align: right; } .t .c { text-align: center; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--surface-2); } .t tr.sel td { background: var(--primary-soft); }
.thumb { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }
.tint-coffee, .tint-cookie { background: var(--accent-soft); color: var(--accent); }
.tint-glass, .tint-leaf { background: var(--primary-soft); color: var(--primary); }
.tint-utensils { background: var(--danger-soft); color: var(--danger); }
.bar-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } .bar-track > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }

/* ---------------------------------------------------------------- POS */
.catalog { flex: 1; min-width: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; cursor: pointer; min-height: 156px; box-shadow: var(--shadow-card); }
.pcard:hover { border-color: var(--primary); }
.pcard.has-img { padding: 0; gap: 0; overflow: hidden; } .pcard.has-img.in { padding: 0; }
.pcard.has-img .name { padding: 12px 14px 0; } .pcard.has-img .bottom { padding: 8px 14px 14px; }
.pimg { position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg-ph { width: 100%; height: 100%; display: grid; place-items: center; } .pimg-ph svg { width: 40px; height: 40px; opacity: .9; }
.pimg-badge { position: absolute; top: 8px; right: 8px; } .pimg-badge .badge { box-shadow: var(--shadow-card); background: var(--surface); }
.pimg-badge .badge.bad { background: var(--danger-soft); } .pimg-badge .badge.warn { background: var(--accent-soft); }
.thumb.photo { overflow: hidden; background: var(--surface-2); } .thumb.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-field { display: flex; gap: 16px; align-items: center; }
.photo-box { width: 96px; height: 96px; flex: none; border-radius: var(--r-md); border: 1.5px dashed var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.new-cat { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border); }
.icon-pick { display: flex; gap: 6px; } .icon-pick .thumb { border: 2px solid transparent; cursor: pointer; padding: 0; } .icon-pick .thumb.on { border-color: var(--primary); }
.pcard.in { border: 2px solid var(--primary); padding: 15px; }
.pcard.out { opacity: .55; cursor: not-allowed; }
.pcard .top { display: flex; justify-content: space-between; align-items: center; }
.pcard .name { font-weight: 600; font-size: 15px; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.pcard .price { font: 600 20px/28px var(--mono); }
.pcard .add { width: 32px; height: 32px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.pcard .qty { width: 32px; height: 32px; border-radius: 999px; background: var(--primary); color: #fff; display: grid; place-items: center; font: 500 14px var(--mono); }
.panel { width: 400px; flex: none; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel-head { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.lines { flex: 1; overflow-y: auto; padding: 0 24px; min-height: 80px; }
.line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line .name { font-weight: 600; } .line .note { color: var(--accent); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.line .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.line.sent { opacity: .7; } .line.sent .name::after { content: " · terkirim"; font-weight: 500; color: var(--muted); font-size: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; }
.stepper button { width: 26px; height: 26px; border: 0; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.stepper button.plus { background: var(--primary); color: #fff; } .stepper b { width: 26px; text-align: center; font: 500 14px var(--mono); }
.note-btn { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; cursor: pointer; text-align: left; }
.summary { background: var(--surface-2); border-top: 1px solid var(--border); padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.summary .kv { display: flex; justify-content: space-between; color: var(--muted); }
.summary .kv b { font: 500 14px var(--mono); color: var(--text); }
.summary .total { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.summary .total b { font: 600 28px/36px var(--mono); letter-spacing: -1px; }
.hint { text-align: center; font: 12px var(--mono); color: var(--muted); }
.queue-pill { text-decoration: none !important; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; border: 0; cursor: pointer; }
.mobile-cart { display: none; }

/* ---------------------------------------------------------------- tables view */
.legend { display: flex; gap: 16px; flex-wrap: wrap; } .legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tcard { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: 12px; min-height: 108px; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; }
.tcard .no { font: 600 20px/28px var(--mono); display: flex; justify-content: space-between; align-items: center; }
.tcard .no small { font: 12px var(--mono); color: var(--muted); display: inline-flex; gap: 2px; align-items: center; }
.tcard .sp { flex: 1; }
.tcard.free .no { color: var(--muted); }
.tcard.busy { background: var(--primary-soft); border-color: var(--primary); }
.tcard.bill { background: var(--accent-soft); border-color: var(--accent); }
.tcard.mine { border-width: 2px; padding: 11px; }

/* ---------------------------------------------------------------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpi .v { font: 600 26px/34px var(--mono); letter-spacing: -1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.delta b { font: 400 12px var(--mono); } .delta.up b, .delta.up svg { color: var(--primary); } .delta.down b, .delta.down svg { color: var(--danger); }
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.dash-row3 { display: grid; grid-template-columns: minmax(0, 1fr) 280px 280px; gap: 16px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--mono); }
.heat { display: grid; gap: 3px; } .heat .lbl { font-size: 12px; color: var(--muted); } .heat .cell { height: 14px; border-radius: 3px; background: var(--primary); }
.insight { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-strong); font-size: 12px; }
.stack { display: flex; gap: 2px; height: 12px; border-radius: var(--r-sm); overflow: hidden; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

/* ---------------------------------------------------------------- report */
.pl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.pl > div { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); min-width: 0; }
.pl > div:last-child { border-right: 0; } .pl .v { font: 600 18px/26px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .hi { background: var(--primary-soft); } .pl .hi .caps, .pl .hi .v { color: var(--primary-strong); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); padding: 0 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 0 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.report-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

/* ---------------------------------------------------------------- modal, drawer, toast */
.scrim { position: fixed; inset: 0; background: rgba(10,14,14,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-modal); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--surface); box-shadow: var(--shadow-modal); z-index: 51; padding: 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-opt { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--muted); }
.pay-opt.on { border: 2px solid var(--primary); padding: 11px 7px; background: var(--primary-soft); color: var(--primary-strong); }
.total-box { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.total-box b { font: 600 28px/36px var(--mono); letter-spacing: -1px; }
.money { display: flex; align-items: center; gap: 8px; border: 2px solid var(--primary); border-radius: var(--r-md); padding: 10px 16px; }
.money span { font: 600 20px var(--mono); color: var(--muted); } .money input { border: 0; outline: 0; font: 600 28px var(--mono); width: 100%; min-width: 0; background: transparent; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); padding: 8px; font: 500 14px var(--mono); cursor: pointer; }
.quick button:first-child { font-family: var(--font); font-weight: 600; }
.change { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.change.short { background: var(--danger-soft); color: var(--danger); } .change b { font: 600 20px var(--mono); }
.printer-status { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; }
.toasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--nav); color: var(--on-nav); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-modal); display: flex; gap: 10px; align-items: flex-start; max-width: 380px; }
.toast svg { color: var(--accent); margin-top: 2px; } .toast.err { background: var(--danger); color: #fff; } .toast.err svg { color: #fff; }
.toast small { display: block; color: var(--on-nav-muted); }
.receipt-paper { background: #fff; width: 232px; padding: 16px 12px; font: 9.5px/13px var(--mono); white-space: pre; box-shadow: var(--shadow-card); overflow: hidden; color: #000; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: var(--nav); color: var(--on-nav); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.login .art p { color: var(--on-nav-muted); max-width: 420px; }
.login .art .roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; }
.login .art .roles div { background: var(--nav-2); border-radius: var(--r-md); padding: 12px; font-size: 12px; color: var(--on-nav-muted); }
.login form { align-self: center; justify-self: center; width: min(380px, 100% - 32px); display: flex; flex-direction: column; gap: 16px; padding: 32px 0; }
.err-box { background: var(--danger-soft); color: var(--danger); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row, .dash-row3, .report-body { grid-template-columns: minmax(0, 1fr); }
  .pl { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pl > div { border-bottom: 1px solid var(--border); }
  .panel { width: 340px; }
}
@media (max-width: 1100px) { .tn-item .lbl-long { display: none; } .user-chip .who { display: none; } }
@media (max-width: 900px) {
  .topnav { gap: 12px; min-height: 56px; }
  .topnav .tn-items, .topnav .brand div span { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none !important; position: relative; cursor: pointer; }
  .tabbar .active { color: var(--primary-strong); } .tabbar .active svg { color: var(--primary); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); background: var(--accent); color: var(--nav); border-radius: 999px; font: 600 10px var(--mono); padding: 0 5px; }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .view { padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .catalog { padding: 16px; padding-bottom: 88px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .panel { position: fixed; inset: auto 0 0 0; width: auto; height: 88vh; border-left: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-modal); z-index: 30; transform: translateY(100%); transition: transform .2s; }
  .panel.open { transform: none; }
  .panel .sheet-x { display: grid; }
  .mobile-cart { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
  .mobile-cart .btn { width: 100%; justify-content: space-between; box-shadow: var(--shadow-modal); }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; } .kpi { padding: 14px; } .kpi .v { font-size: 20px; line-height: 28px; }
  .pl { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; } .login .art { padding: 32px 24px; } .login .art .roles { display: none; }
  .t th, .t td { padding: 10px 12px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topnav, .tabbar { display: none; } }
