/* ==========================================================================
   Tree House Burger RMS - Design System
   Satu sumber kebenaran untuk seluruh layar. Diturunkan dari logo:
   emblem pohon + burger, merah bata di atas krem hangat.
   ========================================================================== */

:root {
  /* Warna */
  --bg:            #F6EFE4;
  --surface:       #FFFCF6;
  --surface-2:     #FBF5EA;
  --surface-3:     #F1E7D7;
  --primary:       #9E2B25;
  --primary-dark:  #7D1211;
  --primary-soft:  #F7E4E1;
  --text:          #3A1F1A;
  --brown:         #7A4A2E;
  --muted:         #6E6055;
  --border:        #E3D8C6;
  --border-strong: #D3C4AC;
  --success:       #4F7A4A;
  --success-soft:  #E7F0E5;
  --warning:       #C8862A;
  --warning-soft:  #FBF0DC;
  --danger:        #7A1512;
  --danger-soft:   #F8E5E3;

  /* Bentuk */
  --r-card: 12px;
  --r-btn: 10px;
  --r-chip: 999px;
  --shadow: 0 1px 2px rgba(58, 31, 26, .06);
  --shadow-lg: 0 8px 28px rgba(58, 31, 26, .16);

  /* Ukuran */
  --sidebar-w: 260px;
  --rail-w: 88px;
  --topbar-h: 68px;
  --touch: 44px;
  --touch-lg: 56px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: Bitter, Georgia, serif;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.num { font-variant-numeric: tabular-nums; }

/* Fokus terlihat di mana pun - jangan dihapus */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
}
.icon-fill { font-variation-settings: 'FILL' 1; }

/* ==========================================================================
   Kerangka aplikasi
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

/* --- Sidebar admin --- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--text);
  color: #F3E8DC;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(243, 232, 220, .12);
  flex-shrink: 0;
}
.sidebar__logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar__name { font-family: Bitter, serif; font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar__role { font-size: 11.5px; color: rgba(243, 232, 220, .6); }

.sidebar__nav { padding: 12px 12px 24px; flex: 1; }
.sidebar__group { margin-top: 16px; }
.sidebar__group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(243, 232, 220, .45);
  padding: 0 10px 6px;
  font-weight: 600;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-btn);
  color: rgba(243, 232, 220, .82);
  font-size: 14px;
  min-height: var(--touch);
  transition: background .15s, color .15s;
}
.sidebar__link:hover { background: rgba(243, 232, 220, .09); color: #fff; }
.sidebar__link.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}
.sidebar__link .material-symbols-outlined { font-size: 20px; }

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(243, 232, 220, .12);
  flex-shrink: 0;
}

/* --- Rail POS --- */
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  gap: 8px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
}
.rail__logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
  margin-bottom: 14px;
}
.rail__link {
  width: 100%;
  min-height: 68px;
  border-radius: var(--r-btn);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255, 255, 255, .82);
  font-size: 10.5px;
  transition: background .15s;
}
.rail__link:hover { background: rgba(0, 0, 0, .16); color: #fff; }
.rail__link.is-active { background: var(--primary-dark); color: #fff; font-weight: 600; }
.rail__link .material-symbols-outlined { font-size: 23px; }
.rail__spacer { flex: 1; }

/* --- Area utama --- */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.main--rail { margin-left: var(--rail-w); }
.main--bare { margin-left: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__title { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__crumb { font-size: 12px; color: var(--muted); }
.topbar__right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar__meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.topbar__sep { width: 1px; height: 22px; background: var(--border); }

.burger {
  display: none;
  width: var(--touch); height: var(--touch);
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--r-btn); color: var(--text); cursor: pointer;
}

.page { padding: 24px; flex: 1; }
/* Wadah layar POS: harus flex agar panel keranjang bisa setinggi layar */
.posbody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.page__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page__title { font-size: 24px; font-weight: 600; }
.page__sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.page__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Overlay drawer mobile */
.scrim {
  position: fixed; inset: 0;
  background: rgba(58, 31, 26, .48);
  z-index: 55;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Komponen
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.card__head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.card__title { font-size: 15.5px; font-weight: 600; }
.card__body { padding: 18px; }
.card__foot { padding: 14px 18px; border-top: 1px solid var(--border); }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* --- KPI --- */
.kpi { padding: 16px 18px; }
.kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi__value { font-family: Bitter, serif; font-size: 27px; font-weight: 700; margin: 5px 0 4px; line-height: 1.15; }
.kpi__value--primary { color: var(--primary); }
.kpi__delta { font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.kpi__delta .material-symbols-outlined { font-size: 15px; }

/* --- Tombol --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--touch);
  padding: 0 16px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn .material-symbols-outlined { font-size: 19px; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--brown); }
.btn--quiet { background: transparent; color: var(--brown); }
.btn--quiet:hover { background: var(--surface-2); }
/* Destruktif SELALU outline + ikon + teks. Merah adalah warna merek,
   jadi merah terisi tidak boleh dipakai untuk aksi berbahaya. */
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--lg { min-height: var(--touch-lg); font-size: 15.5px; padding: 0 22px; }
/* Tombol yang tampil seperti tautan di dalam tabel. Tetap ringkas untuk mouse,
   tapi diperbesar di perangkat sentuh (lihat aturan pointer: coarse di bawah). */
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text); font-weight: 600; text-align: left;
  min-height: 28px; border-radius: 4px;
}
.linkbtn:hover { color: var(--primary); text-decoration: underline; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Chip --- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-chip);
  font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--brown);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip .material-symbols-outlined { font-size: 14px; }
.chip--success { background: var(--success-soft); color: var(--success); }
.chip--warning { background: var(--warning-soft); color: var(--warning); }
.chip--danger  { background: var(--danger-soft);  color: var(--danger); }
.chip--primary { background: var(--primary-soft); color: var(--primary); }
.chip--muted   { background: var(--surface-3); color: var(--muted); }

/* Chip filter yang bisa diklik */
.chipbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chipbtn {
  min-height: var(--touch);
  padding: 0 16px;
  border-radius: var(--r-chip);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chipbtn:hover { border-color: var(--brown); }
.chipbtn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

/* --- Form --- */
.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field__hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-btn);
  color: var(--text);
  font: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { min-height: 84px; resize: vertical; }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }

.search { position: relative; flex: 1; min-width: 180px; }
.search .material-symbols-outlined {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 20px; pointer-events: none;
}
.search .input { padding-left: 40px; }

.switch {
  position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong); border-radius: 999px; transition: background .2s;
}
.switch__track::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::before { transform: translateX(18px); }

/* --- Tabel --- */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: middle; }
.table thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rowactions { display: flex; gap: 6px; justify-content: flex-end; }

tr.is-warning { background: var(--warning-soft); box-shadow: inset 3px 0 0 var(--warning); }
tr.is-danger  { background: var(--danger-soft);  box-shadow: inset 3px 0 0 var(--danger); }
tr.is-void td { opacity: .55; }
tr.is-void .strike { text-decoration: line-through; }
tr.is-sub td { background: var(--surface-2); }
tr.is-sub td:first-child { padding-left: 34px; }

/* --- Callout --- */
.note {
  display: flex; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brown);
  background: var(--surface);
  font-size: 13.5px;
}
.note .material-symbols-outlined { font-size: 20px; color: var(--brown); flex-shrink: 0; }
.note--warning { border-left-color: var(--warning); background: var(--warning-soft); }
.note--warning .material-symbols-outlined { color: var(--warning); }
.note--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.note--danger .material-symbols-outlined { color: var(--danger); }
.note--success { border-left-color: var(--success); background: var(--success-soft); }
.note--success .material-symbols-outlined { color: var(--success); }
.note__title { font-weight: 600; margin-bottom: 2px; }

/* --- Status --- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.status .material-symbols-outlined { font-size: 17px; }
.status--ok { color: var(--success); }
.status--warn { color: var(--warning); }
.status--bad { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot--ok { background: var(--success); }
.dot--warn { background: var(--warning); }
.dot--bad { background: var(--danger); }

/* --- Progress & bar chart --- */
.bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar__fill { height: 100%; background: var(--primary); border-radius: 999px; }
.bar__fill--success { background: var(--success); }
.bar__fill--warning { background: var(--warning); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart__bar {
  width: 100%; background: var(--primary); border-radius: 5px 5px 0 0;
  min-height: 4px; transition: opacity .15s;
}
.chart__col:hover .chart__bar { opacity: .78; }
.chart__label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.timeline__item:last-child { border-bottom: 0; }
.timeline__icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); flex-shrink: 0;
}
.timeline__icon .material-symbols-outlined { font-size: 17px; color: var(--brown); }
.timeline__body { min-width: 0; flex: 1; }
.timeline__time { font-size: 12px; color: var(--muted); }

/* --- Definition list (rincian angka) --- */
.dl { display: flex; flex-direction: column; }
.dl__row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.dl__row:last-child { border-bottom: 0; }
.dl__row dt { color: var(--muted); }
.dl__row dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.dl__row--total {
  border-top: 2px solid var(--primary); border-bottom: 0;
  margin-top: 5px; padding-top: 12px;
}
.dl__row--total dt { color: var(--text); font-weight: 600; font-size: 15px; }
.dl__row--total dd { color: var(--primary); font-family: Bitter, serif; font-size: 21px; font-weight: 700; }

/* --- Modal --- */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(58, 31, 26, .5);
}
.modal.is-open { display: flex; }
.modal__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}
.modal__box--wide { max-width: 660px; }
.modal__box--danger { border: 2px solid var(--danger); }
.modal__head { padding: 17px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal__title { font-size: 18px; font-weight: 600; }
.modal__body { padding: 20px; }
.modal__foot { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* --- Toast --- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 9px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  background: var(--text); color: #F6EFE4;
  padding: 12px 15px; border-radius: var(--r-btn);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; display: flex; gap: 9px; align-items: flex-start;
  animation: toastin .22s ease-out;
}
.toast .material-symbols-outlined { font-size: 19px; flex-shrink: 0; }
.toast--ok .material-symbols-outlined { color: #9ED89A; }
.toast--warn .material-symbols-outlined { color: #F0C070; }
.toast--bad .material-symbols-outlined { color: #FFB4AB; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* --- Keypad --- */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.keypad__key {
  min-height: 58px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-btn);
  font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums;
  cursor: pointer; color: var(--text);
  transition: background .1s;
}
.keypad__key:hover { background: var(--surface-2); }
.keypad__key:active { background: var(--surface-3); }
.keypad__key--wide { grid-column: span 2; }

.pindots { display: flex; gap: 10px; justify-content: center; }
.pindot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: transparent;
  transition: background .12s, border-color .12s;
}
.pindot.is-filled { background: var(--primary); border-color: var(--primary); }

/* --- Menu POS --- */
.menugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 13px; }
.menucard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; text-align: left;
  padding: 0; min-height: var(--touch-lg);
  transition: border-color .15s, transform .1s;
}
.menucard:hover { border-color: var(--primary); }
.menucard:active { transform: scale(.985); }
.menucard__img {
  aspect-ratio: 4 / 3; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.menucard__img .material-symbols-outlined { font-size: 40px; color: var(--border-strong); }
.menucard__flag { position: absolute; top: 7px; left: 7px; }
.menucard__body { padding: 10px 12px; background: var(--surface); }
.menucard__name { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.menucard__price { font-size: 14px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; margin-top: 3px; }

/* --- Panel order kasir --- */
.pos { display: flex; flex: 1; min-height: 0; }
.pos__menu { flex: 1; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.pos__cart {
  width: 372px; flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.cart__head { padding: 15px 18px; border-bottom: 1px solid var(--border); }
.cart__items { flex: 1; overflow-y: auto; padding: 6px 18px; }
.cart__foot { padding: 16px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cartline { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cartline:last-child { border-bottom: 0; }
.cartline__qty {
  min-width: 27px; height: 27px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.cartline__body { flex: 1; min-width: 0; }
.cartline__name { font-size: 14px; font-weight: 500; }
.cartline__note { font-size: 12px; color: var(--muted); font-style: italic; }
.cartline__price { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cartline__del {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  width: 30px; display: flex; align-items: center; justify-content: center;
}
.cartline__del:hover { color: var(--danger); }

.empty { text-align: center; padding: 40px 18px; color: var(--muted); }
.empty .material-symbols-outlined { font-size: 42px; color: var(--border-strong); }

/* --- Struk --- */
.receipt {
  background: #fff; border: 1px solid var(--border);
  padding: 20px 18px; font-size: 12.5px; max-width: 320px;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px;
  background: repeating-linear-gradient(135deg, #fff 0 7px, transparent 7px 14px);
  filter: drop-shadow(0 1px 0 var(--border));
}
.receipt__center { text-align: center; }
.receipt__rule { border-top: 1px dashed var(--border-strong); margin: 10px 0; }
.receipt__row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }

/* --- Tab bar mobile --- */
.tabbar {
  position: sticky; bottom: 0; z-index: 40;
  display: flex; background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__link {
  flex: 1; min-height: var(--touch-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted);
}
.tabbar__link .material-symbols-outlined { font-size: 22px; }
.tabbar__link.is-active { color: var(--primary); font-weight: 600; }

/* --- Layar mobile terpusat (dipakai halaman mobile owner) --- */
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.phone__body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.hero-card {
  background: var(--primary); color: #FDF3EA;
  border-radius: var(--r-card); padding: 18px 20px;
}
.hero-card__label { font-size: 12.5px; opacity: .82; }
.hero-card__value { font-family: Bitter, serif; font-size: 32px; font-weight: 700; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.hero-card__meta { display: flex; gap: 16px; font-size: 12.5px; opacity: .9; flex-wrap: wrap; }

/* Utilitas kecil */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.codeblock {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-btn); padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  overflow-x: auto; line-height: 1.7;
}
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.hide { display: none !important; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brown); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; flex-shrink: 0;
}
.avatar--off { background: var(--border-strong); color: var(--muted); }

/* Banner demo */
.demobar {
  background: var(--brown); color: #FBF0E4;
  font-size: 12.5px; padding: 7px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center;
}
.demobar a { text-decoration: underline; }
.demobar .material-symbols-outlined { font-size: 16px; }

/* ==========================================================================
   Responsif
   ========================================================================== */

@media (max-width: 1200px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .main, .main--rail { margin-left: 0; }
  .burger { display: inline-flex; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Rail POS jadi bar bawah */
  .rail {
    inset: auto 0 0 0;
    width: 100%; height: auto;
    flex-direction: row;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, .12);
  }
  .rail__logo { display: none; }
  .rail__spacer { display: none; }
  .rail__link { min-height: var(--touch-lg); }
  .main--rail { padding-bottom: 74px; }

  /* Panel keranjang jadi lembar bawah */
  .pos { flex-direction: column; }
  .pos__cart {
    width: 100%;
    border-left: 0; border-top: 1px solid var(--border);
    max-height: 46vh;
  }
}

@media (max-width: 860px) {
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar__meta--hide-sm { display: none; }
  .topbar__sep { display: none; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .page__title { font-size: 20px; }

  /* Tabel jadi kartu bertumpuk - jangan sekadar disembunyikan */
  .table--stack thead { display: none; }
  .table--stack tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    margin-bottom: 11px;
    padding: 6px 4px;
    background: var(--surface);
  }
  .table--stack tbody tr.is-warning,
  .table--stack tbody tr.is-danger { box-shadow: inset 3px 0 0 currentColor; }
  .table--stack tbody td {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 7px 12px; text-align: right; border: 0;
  }
  .table--stack tbody td::before {
    content: attr(data-label);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600; text-align: left; flex-shrink: 0;
  }
  .table--stack tbody td:empty { display: none; }
  .table--stack .rowactions { justify-content: flex-end; }
  .tablewrap { overflow-x: visible; }
}

@media (max-width: 560px) {
  .menugrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page__actions { width: 100%; }
  .page__actions .btn { flex: 1; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__box { max-width: none; border-radius: var(--r-card) var(--r-card) 0 0; max-height: 92vh; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* ==========================================================================
   Aksesibilitas
   ========================================================================== */

/* Di perangkat sentuh, semua kontrol kecil dinaikkan ke ambang 44px.
   Di desktop bermouse tetap ringkas supaya tabel tidak jadi renggang. */
@media (pointer: coarse) {
  .linkbtn, .addslot, .btn--quiet { min-height: var(--touch); }
  .cartline__del { width: var(--touch); min-height: var(--touch); }
  .setnav__link, .chipbtn, .keypad__key { min-height: var(--touch); }
}

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

@media print {
  .sidebar, .rail, .topbar, .demobar, .tabbar, .page__actions { display: none !important; }
  .main, .main--rail { margin-left: 0; }
  body { background: #fff; }
}
