/* ==========================================================================
   Kedai Pena — sistem visual
   Tinta (biru tua) · Pandan (aksi) · Kunyit (sorotan) · Kertas (latar)
   ========================================================================== */

:root {
  --ink: #17233F;
  --ink-2: #24345A;
  --ink-soft: #3B4A6B;
  --pandan: #1E8A5A;
  --pandan-dark: #166A45;
  --pandan-tint: #E3F3EA;
  --kunyit: #F2B33D;
  --kunyit-tint: #FDF1D8;
  --cabai: #C8372D;
  --cabai-tint: #FBE5E3;
  --langit: #2F6FD6;
  --langit-tint: #E4EDFC;

  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #EEF0F4;
  --line: #DCE0E8;
  --text: #1C2436;
  --muted: #5D6880;

  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-receipt: "Courier New", ui-monospace, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow-pop: 0 18px 50px -18px rgba(23, 35, 63, .45);
  --rail: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--langit); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--kunyit); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 38px; height: 38px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1; color: inherit; }
.brand-tag { font-size: .74rem; opacity: .75; margin-top: 3px; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink); --b-line: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--b-line); border-radius: 10px;
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --b-bg: var(--pandan); --b-fg: #fff; --b-line: var(--pandan); }
.btn-primary:hover { --b-bg: var(--pandan-dark); border-color: var(--pandan-dark); }
.btn-ink { --b-bg: var(--ink); --b-fg: #fff; --b-line: var(--ink); }
.btn-ink:hover { --b-bg: var(--ink-2); }
.btn-danger { --b-bg: var(--surface); --b-fg: var(--cabai); --b-line: #EBC2BE; }
.btn-danger:hover { --b-bg: var(--cabai-tint); border-color: var(--cabai); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-2); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; padding: 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .err { font-size: .8rem; color: var(--cabai); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--ink-soft); outline: 3px solid rgba(242, 179, 61, .45); outline-offset: 0; }
.input.is-invalid { border-color: var(--cabai); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--pandan); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.input-money { position: relative; }
.input-money::before { content: "Rp"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-money .input { padding-left: 38px; }

/* ---------- Chips, segmented, badges ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink-soft);
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ink-soft);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,35,63,.15); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.badge-green { background: var(--pandan-tint); color: var(--pandan-dark); }
.badge-yellow { background: var(--kunyit-tint); color: #8A5A00; }
.badge-red { background: var(--cabai-tint); color: var(--cabai); }
.badge-blue { background: var(--langit-tint); color: var(--langit); }
.badge-ink { background: var(--ink); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- App shell (staf) ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: #DCE3F2; padding: 18px 12px; display: flex; flex-direction: column; gap: 18px;
}
.rail .brand { padding: 4px 8px 10px; color: #fff; }
.rail nav { display: grid; gap: 2px; }
.rail .nav-group { font-size: .74rem; color: #8E9AB8; padding: 12px 10px 4px; }
.rail a {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px;
  color: #DCE3F2; text-decoration: none; font-weight: 600; font-size: .93rem;
}
.rail a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.rail a:hover { background: rgba(255,255,255,.07); }
.rail a[aria-current="page"] { background: var(--kunyit); color: var(--ink); }
.rail a[aria-current="page"] svg { opacity: 1; }
.rail-user { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.12); font-size: .86rem; }
.rail-user strong { color: #fff; display: block; }
.rail-user .btn { margin-top: 10px; --b-bg: transparent; --b-fg: #DCE3F2; --b-line: rgba(255,255,255,.25); }

.main { min-width: 0; padding: 22px clamp(14px, 2.4vw, 32px) 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.topbar-mobile { display: none; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: 10px 14px;
  }
  .topbar-mobile .brand { color: #fff; }
  .topbar-mobile .btn { --b-bg: transparent; --b-fg: #fff; --b-line: rgba(255,255,255,.3); }
  .main { padding-bottom: calc(86px + var(--safe-b)); }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
  }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 2px; border-radius: 8px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a[aria-current="page"] { color: var(--ink); background: var(--kunyit-tint); }
}

/* Drawer menu (mobile) */
.drawer-nav { display: grid; gap: 2px; }
.drawer-nav a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.drawer-nav a svg { width: 20px; height: 20px; }
.drawer-nav a[aria-current="page"] { background: var(--kunyit-tint); }

/* ---------- Panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-pad { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFC; }
.table tr.is-clickable { cursor: pointer; }
.table .right, .right { text-align: right; }
.table td.num { white-space: nowrap; }
.toolbar .input { width: auto; }
.table .actions { text-align: right; white-space: nowrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink-soft); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; font-size: .88rem; color: var(--muted); }

.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-items: end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }

/* ---------- Toast & modal ---------- */
#toast-root { position: fixed; z-index: 90; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-pop); font-weight: 600; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .2s ease-out; }
.toast-error { background: var(--cabai); }
.toast-success { background: var(--pandan-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 22, 40, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: min(90vh, 900px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: pop .18s ease-out;
}
.modal.modal-wide { width: min(980px, 100%); }
.modal.modal-narrow { width: min(420px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot:empty { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (max-width: 640px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.modal-wide, .modal.modal-narrow { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: var(--safe-b); animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
}

/* ---------- Landing ---------- */
.landing { min-height: 100vh; background: var(--ink); color: #E6EBF6; display: flex; flex-direction: column; }
.landing-top { display: flex; justify-content: space-between; align-items: center; padding: 20px clamp(16px, 4vw, 48px); }
.landing-top .brand { color: #fff; }
.landing-hero { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding: 20px clamp(16px, 4vw, 48px) 48px; max-width: 1240px; margin: 0 auto; width: 100%; }
.landing-hero h1 {
  font-size: clamp(2.7rem, 1.5rem + 5.4vw, 5.6rem); line-height: .95; color: #fff; letter-spacing: -.035em; font-weight: 800; margin-bottom: 22px;
}
.landing-hero .signature { display: block; width: min(420px, 80%); height: 26px; margin: -6px 0 18px; overflow: visible; }
.landing-hero .signature path { fill: none; stroke: var(--kunyit); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: ink 1.1s .35s cubic-bezier(.6,.1,.3,1) forwards; }
@keyframes ink { to { stroke-dashoffset: 0; } }
.landing-hero .lead { font-size: 1.12rem; max-width: 46ch; color: #C3CCE0; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.landing-actions .btn-ghost { --b-fg: #fff; --b-line: rgba(255,255,255,.3); }
.landing-actions .btn-ghost:hover { --b-bg: rgba(255,255,255,.08); }
.landing-card { background: #FAFAF7; color: var(--text); border-radius: 22px; padding: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); transform: rotate(1.2deg); }
.landing-card h2 { font-size: 1.1rem; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: flow; }
.flow li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; counter-increment: flow; }
.flow li::before { content: counter(flow); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--kunyit-tint); color: #7A4F00; font-weight: 800; font-family: var(--font-display); }
.flow strong { display: block; color: var(--ink); }
.flow span { font-size: .9rem; color: var(--muted); }
.landing-foot { padding: 18px clamp(16px, 4vw, 48px); font-size: .85rem; color: #8E9AB8; border-top: 1px solid rgba(255,255,255,.08); }
@media (max-width: 860px) { .landing-hero { grid-template-columns: 1fr; } .landing-card { transform: none; } }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(320px, 460px); }
.auth-side { background: var(--ink); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .brand { color: #fff; }
.auth-side blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.8rem, 1rem + 2.6vw, 3rem); line-height: 1.05; font-weight: 800; max-width: 14ch; }
.auth-form { padding: 40px clamp(20px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
@media (max-width: 760px) { .auth-page { grid-template-columns: 1fr; } .auth-side { padding: 22px; gap: 22px; } .auth-side blockquote { font-size: 1.7rem; } }
.demo-accounts { margin-top: 20px; font-size: .84rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

/* ---------- Product visual ---------- */
.p-thumb {
  aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--ink-soft);
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-thumb.food { background: linear-gradient(145deg, #FDF1D8, #F7DDA4); color: #8A5A00; }
.p-thumb.beverage { background: linear-gradient(145deg, #E3F3EA, #BFE3CF); color: var(--pandan-dark); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-search { display: flex; gap: 8px; margin-bottom: 12px; }
.pos-search .input { flex: 1; }
.pos-tabs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.product-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 12px; }
.product-tile {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 8px; cursor: pointer;
  display: grid; gap: 8px; position: relative;
}
.product-tile:hover { border-color: var(--ink-soft); }
.product-tile .p-name { font-weight: 700; font-size: .92rem; line-height: 1.25; color: var(--ink); }
.product-tile .p-price { font-weight: 700; color: var(--pandan-dark); font-size: .92rem; }
.product-tile .p-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 4px 2px; }
.product-tile.is-soldout { opacity: .5; cursor: not-allowed; }
.product-tile .soldout { position: absolute; top: 14px; left: 14px; }
.product-tile .p-name { padding: 0 4px; }

.pos-order { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pos-order-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.pos-order-body { flex: 1; overflow-y: auto; padding: 6px 0; min-height: 120px; }
.pos-order-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 10px; background: #FBFCFD; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px dashed var(--surface-2); }
.line-name { font-weight: 700; color: var(--ink); font-size: .93rem; }
.line-sub { font-size: .8rem; color: var(--muted); grid-column: 1 / -1; }
.line-total { font-weight: 700; text-align: right; }
.line-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.line.is-void { opacity: .45; text-decoration: line-through; }
.line.is-draft { background: #FFFDF6; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 32px; border: 0; background: var(--surface); cursor: pointer; font-weight: 800; font-size: 1.05rem; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.totals { display: grid; gap: 4px; font-size: .92rem; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.section-label { padding: 10px 16px 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }

.active-orders { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.order-card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: grid; gap: 6px; }
.order-card:hover { border-color: var(--ink-soft); }
.order-card.is-unpaid { border-left: 5px solid var(--kunyit); }
.order-card.is-paid { border-left: 5px solid var(--pandan); }
.order-card .oc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.order-card .oc-table { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink); }

.table-picker { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.table-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 6px; cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.table-btn strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.table-btn small { font-size: .72rem; }
.table-btn.is-busy { background: var(--kunyit-tint); border-color: #F0D28C; }
.table-btn[aria-pressed="true"] { outline: 3px solid var(--pandan); }

.pos-mobile-bar { display: none; }
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .pos-order { position: fixed; inset: auto 0 0 0; top: auto; max-height: 88vh; z-index: 40; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .22s ease-out; box-shadow: var(--shadow-pop); }
  .pos-order.is-open { transform: none; }
  .pos-mobile-bar { display: flex; position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(76px + var(--safe-b)); }
  .pos-mobile-bar .btn { width: 100%; justify-content: space-between; box-shadow: var(--shadow-pop); }
}
@media (min-width: 901px) and (max-width: 1100px) { .pos-mobile-bar { bottom: 16px; } }

/* Payment */
.pay-methods { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.pay-method { border: 1px solid var(--line); background: var(--surface); padding: 12px; border-radius: 12px; cursor: pointer; font-weight: 700; text-align: center; }
.pay-method[aria-pressed="true"] { border-color: var(--pandan); background: var(--pandan-tint); color: var(--pandan-dark); }
.pay-total { text-align: center; padding: 12px 0 16px; }
.pay-total .amount { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; color: var(--ink); line-height: 1; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.change-box { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.change-box.ok { background: var(--pandan-tint); color: var(--pandan-dark); }
.change-box.short { background: var(--cabai-tint); color: var(--cabai); }
.success-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--pandan); color: #fff; display: grid; place-items: center; margin: 6px auto 12px; }
.success-mark svg { width: 38px; height: 38px; }
.qr-box { display: grid; place-items: center; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; width: fit-content; margin: 0 auto; }
.qr-box svg, .qr-box img { width: 240px; height: 240px; }

/* ---------- Product options (shared) ---------- */
.opt-group { padding: 12px 0; border-top: 1px solid var(--surface-2); }
.opt-group:first-child { border-top: 0; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.opt-head strong { color: var(--ink); }
.opt-list { display: grid; gap: 6px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt input { accent-color: var(--pandan); width: 18px; height: 18px; }
.opt .opt-price { margin-left: auto; color: var(--muted); font-size: .88rem; }
.opt:has(input:checked) { border-color: var(--pandan); background: var(--pandan-tint); }

/* ---------- Customer ---------- */
.cust { max-width: 760px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: calc(110px + var(--safe-b)); }
.cust-head { background: var(--ink); color: #fff; padding: 16px 16px 22px; border-radius: 0 0 22px 22px; }
.cust-head .brand { color: #fff; }
.cust-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-badge { background: var(--kunyit); color: var(--ink); border-radius: 12px; padding: 6px 12px; text-align: center; line-height: 1.1; }
.table-badge small { display: block; font-size: .7rem; color: var(--ink-soft); font-weight: 600; }
.table-badge strong { font-family: var(--font-display); font-size: 1.3rem; }
.cust-hello { margin-top: 16px; }
.cust-hello h1 { color: #fff; font-size: 1.6rem; margin-bottom: 2px; }
.cust-hello p { color: #C3CCE0; margin: 0; }
.cust-sticky { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 12px 16px 8px; display: grid; gap: 10px; }
.cust-sticky .segmented { width: 100%; }
.cust-sticky .segmented button { flex: 1; }
.cust-list { padding: 4px 16px; }
.cust-cat-title { margin: 18px 0 8px; font-size: 1.05rem; }
.menu-item { display: grid; grid-template-columns: 1fr 96px; gap: 12px; padding: 12px; background: var(--surface); border-radius: 14px; margin-bottom: 10px; border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; }
.menu-item:hover { border-color: var(--line); }
.menu-item .p-thumb { aspect-ratio: 1; }
.menu-item h3 { font-size: 1rem; margin: 0 0 2px; }
.menu-item p { font-size: .84rem; color: var(--muted); margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item .price { font-weight: 800; color: var(--ink); }
.menu-item.is-soldout { opacity: .55; cursor: not-allowed; }
.menu-item .in-cart { display: inline-flex; margin-left: 8px; }
.cart-bar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); width: min(728px, calc(100% - 24px)); }
.cart-bar .btn { width: 100%; justify-content: space-between; box-shadow: var(--shadow-pop); }
.cust-status { padding: 16px; display: grid; gap: 14px; }
.status-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0 4px; }
.status-steps span { height: 6px; border-radius: 3px; background: var(--surface-2); }
.status-steps span.on { background: var(--pandan); }
.status-legend { display: grid; grid-template-columns: repeat(4, 1fr); font-size: .72rem; color: var(--muted); text-align: center; }

/* ---------- Production board (Kitchen/Bar) ---------- */
.board-page { background: #0F1A30; min-height: 100vh; color: #E6EBF6; }
.board-page .main { padding-top: 16px; }
.board-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.board-head h1 { color: #fff; margin: 0; display: flex; align-items: center; gap: 10px; }
.board-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.board-stats span { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: .9rem; }
.board-cols { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.board-col { background: rgba(255,255,255,.04); border-radius: 16px; padding: 10px; min-height: 50vh; }
.board-col h2 { color: #C3CCE0; font-size: .95rem; padding: 4px 6px 10px; display: flex; justify-content: space-between; margin: 0; }
.ticket { background: #FAFAF7; color: var(--text); border-radius: 14px; margin-bottom: 10px; overflow: hidden; border-top: 6px solid var(--kunyit); }
.ticket.st-NEW { border-top-color: var(--kunyit); animation: ticket-new 1.6s ease-out 2; }
.ticket.st-ACCEPTED, .ticket.st-PREPARING { border-top-color: var(--langit); }
.ticket.st-READY { border-top-color: var(--pandan); }
.ticket.st-COMPLETED { opacity: .6; border-top-color: #8E9AB8; }
.ticket.is-late .t-age { background: var(--cabai); color: #fff; }
@keyframes ticket-new { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(242,179,61,.75); } }
.t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 12px 6px; }
.t-table { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1; color: var(--ink); }
.t-meta { font-size: .78rem; color: var(--muted); }
.t-age { font-weight: 800; font-size: .82rem; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); }
.t-items { list-style: none; margin: 0; padding: 4px 12px 10px; display: grid; gap: 8px; }
.t-items li { border-top: 1px dashed var(--line); padding-top: 8px; }
.t-items li:first-child { border-top: 0; }
.t-item-name { font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.t-item-name b { display: inline-block; min-width: 30px; color: var(--cabai); }
.t-mod { font-size: .86rem; color: var(--ink-soft); padding-left: 30px; }
.t-note { font-size: .86rem; padding: 4px 8px; margin: 4px 0 0 30px; background: var(--kunyit-tint); border-radius: 6px; font-weight: 700; color: #6F4700; }
.t-actions { display: flex; gap: 6px; padding: 10px 12px; background: #F0F2F6; }
.t-actions .btn { flex: 1; }
@media (max-width: 1000px) { .board-cols { grid-template-columns: 1fr; } .board-col { min-height: 0; } }

/* ---------- Stats & charts ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .k { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.stat.feature { background: var(--ink); border-color: var(--ink); grid-column: span 2; }
.stat.feature .k { color: #C3CCE0; }
.stat.feature .v { color: var(--kunyit); font-size: 2.1rem; }
@media (max-width: 560px) { .stat.feature { grid-column: auto; } }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding: 10px 4px 0; }
.bars .bar { flex: 1; background: var(--ink-soft); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { background: var(--kunyit); }
.bars-labels { display: flex; gap: 4px; padding: 6px 4px 0; font-size: .7rem; color: var(--muted); }
.bars-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); margin: 8px 0; }
.split .food { background: var(--kunyit); }
.split .bev { background: var(--pandan); }
.legend { display: flex; gap: 16px; font-size: .86rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.rank { counter-reset: rank; list-style: none; margin: 0; padding: 0; }
.rank li { counter-increment: rank; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--surface-2); }
.rank li::before { content: counter(rank); font-family: var(--font-display); font-weight: 800; color: var(--muted); }
.rank li:nth-child(-n+3)::before { color: #B07800; }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--ink-soft); }

/* ---------- Receipt preview ---------- */
.receipt { font-family: var(--font-receipt); font-size: 12.5px; line-height: 1.35; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; white-space: pre; overflow-x: auto; color: #111; }

/* ---------- Detail / timeline ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .78rem; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--kunyit); }

/* QR print sheet */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-card { border: 2px solid var(--ink); border-radius: 16px; padding: 16px; text-align: center; background: #fff; break-inside: avoid; }
.qr-card .brand { justify-content: center; margin-bottom: 8px; }
.qr-card .qr-code svg { width: 180px; height: 180px; margin: 0 auto; }
.qr-card .qr-table { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--ink); line-height: 1; margin-top: 8px; }

/* ---------- Print styles ---------- */
.print-only { display: none; }
@media print {
  body { background: #fff; }
  .rail, .topbar-mobile, .bottom-nav, .no-print, #toast-root, .pos-mobile-bar { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .print-only { display: block; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; width: 100% !important; }
  .modal-head, .modal-foot { display: none; }
  body.printing-modal #app { display: none; }
  .receipt { border: 0; font-size: 11px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .landing-hero .signature path { stroke-dashoffset: 0; }
}
