/* ============================================================
   OPSARA — Hospitality OS Prototype
   Warm African modern. Forest green primary. Ochre accent.
   ============================================================ */

:root {
  /* Type */
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Light theme (warm) */
  --bg: #F6F1E8;          /* warm cream */
  --bg-2: #EFE8DA;        /* slightly deeper */
  --surface: #FFFFFF;
  --surface-2: #FBF7EF;
  --ink: #1A1814;
  --ink-2: #4B463E;
  --ink-3: #7A7367;
  --line: #E5DDCD;
  --line-2: #D6CDB9;

  /* Brand — forest (default) */
  --primary: #0B5D3B;
  --primary-2: #094B30;
  --primary-tint: #DEEAE2;
  --primary-tint-2: #C7DDD0;
  --on-primary: #F6F1E8;

  --accent: #C8531C;       /* clay */
  --accent-tint: #FBEADD;
  --gold: #C49A3B;         /* ochre / brass */
  --success: #2F7D4B;
  --warning: #B97B0E;
  --danger: #B23A2C;
  --whatsapp: #25D366;
  --whatsapp-dk: #075E54;

  --radius: 10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(20,15,5,0.04), 0 1px 2px rgba(20,15,5,0.04);
  --shadow-md: 0 6px 24px -8px rgba(20,15,5,0.12), 0 2px 6px rgba(20,15,5,0.06);
  --shadow-lg: 0 30px 60px -20px rgba(20,15,5,0.25);
}

/* Brand variants applied to root */
[data-brand="forest"] { --primary: #0B5D3B; --primary-2: #094B30; --primary-tint: #DEEAE2; --primary-tint-2: #C7DDD0; }
[data-brand="clay"]   { --primary: #B14A20; --primary-2: #8E3915; --primary-tint: #FBE5D4; --primary-tint-2: #F4CFB0; }
[data-brand="ink"]    { --primary: #1F2A36; --primary-2: #131C26; --primary-tint: #E0E5EB; --primary-tint-2: #C7CFD8; }
[data-brand="indigo"] { --primary: #2C2D7A; --primary-2: #1F2059; --primary-tint: #DFDFF0; --primary-tint-2: #C0C0E1; }

/* Dark theme */
[data-theme="dark"] {
  --bg: #0F0E0C;
  --bg-2: #16140F;
  --surface: #1B1813;
  --surface-2: #221F18;
  --ink: #F4EFE3;
  --ink-2: #C9C1AE;
  --ink-3: #8A8170;
  --line: #2B2820;
  --line-2: #3A362C;
  --primary-tint: #143426;
  --primary-tint-2: #1B4732;
  --on-primary: #F4EFE3;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 24px -8px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
}
[data-theme="dark"][data-brand="forest"] { --primary: #2F9C68; --primary-2: #23845A; }
[data-theme="dark"][data-brand="clay"]   { --primary: #E07041; --primary-2: #C0582E; }
[data-theme="dark"][data-brand="ink"]    { --primary: #6F8398; --primary-2: #5A6E83; }
[data-theme="dark"][data-brand="indigo"] { --primary: #7E80E2; --primary-2: #6566D0; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: #1c1a16;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow: hidden;
  min-height: 100vh;
}

/* ============================================================
   Stage — full viewport, dark backdrop, tablet centered
   ============================================================ */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 70% 100%, #2a241b 0%, #15130f 50%, #0a0907 100%);
  overflow: hidden;
  padding: 24px;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(196,154,59,0.07) 0, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(11,93,59,0.10) 0, transparent 42%);
  pointer-events: none;
}

/* Tablet bezel */
.tablet {
  position: relative;
  width: 1280px;
  height: 800px;
  background: #0c0b09;
  border-radius: 28px;
  padding: 18px;
  box-shadow:
    0 0 0 1.5px #2a2620 inset,
    0 0 0 3px #0a0907,
    0 50px 100px -30px rgba(0,0,0,0.7),
    0 20px 40px -10px rgba(0,0,0,0.5);
  transform-origin: center;
}

.tablet::before {
  /* camera */
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a2620;
  box-shadow: 0 0 0 1px #4a4338;
}

.tablet-screen {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Tablet status strip */
.tablet-status {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  flex-shrink: 0;
  white-space: nowrap;
}
.tablet-status .left, .tablet-status .right { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.tablet-status .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.tablet-status[data-offline="true"] .dot { background: var(--warning); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  flex: 1;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 0;
  background: var(--bg);
}

/* Top bar */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  position: relative;
  z-index: 5;
}
.topbar .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .wordmark .glyph {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-feature-settings: "ss02";
}

.topbar .property {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
  white-space: nowrap;
}
.topbar .property > div { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.topbar .property:hover { background: var(--bg-2); }
.topbar .property .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.topbar .property .pname { font-weight: 600; color: var(--ink); font-size: 13px; }
.topbar .property .ploc { color: var(--ink-3); font-size: 12px; }

.topbar .spacer { flex: 1; }

.topbar .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-ui);
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar .pill.online { color: var(--success); background: color-mix(in oklab, var(--success) 8%, var(--surface)); border-color: color-mix(in oklab, var(--success) 30%, var(--line)); }
.topbar .pill.offline { color: var(--warning); background: color-mix(in oklab, var(--warning) 10%, var(--surface)); border-color: color-mix(in oklab, var(--warning) 35%, var(--line)); animation: blink 2s infinite; }
@keyframes blink {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--warning) 40%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--warning) 0%, transparent); }
}
.topbar .pill .pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.topbar .stafftag {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.topbar .stafftag > div { display: flex; flex-direction: column; line-height: 1.15; }
.topbar .stafftag .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-tint-2); color: var(--primary-2);
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  font-family: var(--font-display);
}
.topbar .stafftag .name { font-size: 12.5px; font-weight: 600; }
.topbar .stafftag .role { font-size: 11px; color: var(--ink-3); }

/* Side nav */
.sidenav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
}
.sidenav .navbtn {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid; place-items: center;
  position: relative;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 120ms ease;
}
.sidenav .navbtn:hover { background: var(--surface-2); color: var(--ink); }
.sidenav .navbtn[data-active="true"] {
  background: var(--primary-tint);
  color: var(--primary);
}
.sidenav .navbtn[data-active="true"]::before {
  content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.sidenav .navbtn .label {
  position: absolute; bottom: 4px; font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.sidenav .navbtn svg { width: 22px; height: 22px; margin-top: -8px; }
.sidenav .spacer { flex: 1; }
.sidenav .divider { width: 28px; height: 1px; background: var(--line); margin: 6px 0; }
.sidenav .badge {
  position: absolute; top: 7px; right: 7px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  padding: 0 4px;
  font-family: var(--font-mono);
}

/* ============================================================
   Main work area
   ============================================================ */
.work {
  display: flex;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Section header bar inside the work area */
.section-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.section-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.section-head .sub {
  color: var(--ink-3); font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-head .grow { flex: 1; }

.tabs {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.tabs button {
  border: 0; background: transparent;
  font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary-2);
}
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.lg { font-size: 15px; padding: 12px 18px; border-radius: 10px; }
.btn.xl { font-size: 16px; padding: 16px 22px; border-radius: 12px; font-weight: 700; }
.btn.accent { background: var(--accent); color: white; border-color: color-mix(in oklab, var(--accent) 70%, black); }
.btn.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 30%, var(--line)); }

.iconbtn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

/* ============================================================
   POS: Floor plan
   ============================================================ */
.pos {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  min-height: 0;
}
.floor {
  position: relative;
  background:
    radial-gradient(circle at 50% 100%, color-mix(in oklab, var(--primary) 4%, var(--bg)) 0%, var(--bg) 60%);
  overflow: auto;
  display: flex; flex-direction: column;
  min-height: 0;
}
.floor-canvas {
  position: relative;
  flex: 1;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 64px;
  gap: 10px;
  min-height: 0;
}

.zone-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.table {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px 9px;
  display: flex; flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: all 120ms ease;
  font-family: var(--font-ui);
  text-align: left;
  overflow: hidden;
  min-width: 0;
}
.table:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
}
.table .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.table .tnum {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  flex-shrink: 0;
}
.table .seats {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.table .tstatus {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table .total {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: auto;
  color: var(--ink);
  white-space: nowrap;
}
.table .elapsed {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* status colors */
.table[data-status="free"] {
  background: var(--surface);
}
.table[data-status="free"] .tstatus { color: var(--ink-3); }

.table[data-status="seated"] {
  background: color-mix(in oklab, var(--primary) 4%, var(--surface));
  border-color: color-mix(in oklab, var(--primary) 22%, var(--line));
}
.table[data-status="seated"] .tstatus { color: var(--primary); }

.table[data-status="ordered"] {
  background: color-mix(in oklab, var(--gold) 7%, var(--surface));
  border-color: color-mix(in oklab, var(--gold) 35%, var(--line));
}
.table[data-status="ordered"] .tstatus { color: var(--warning); }

.table[data-status="billing"] {
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
  border-color: color-mix(in oklab, var(--accent) 35%, var(--line));
}
.table[data-status="billing"] .tstatus { color: var(--accent); }

.table[data-status="reserved"] {
  background: var(--surface-2);
  border-color: var(--line);
  border-style: dashed;
}
.table[data-status="reserved"] .tstatus { color: var(--ink-3); }

.table[data-flag="bill-requested"]::after {
  content: "BILL";
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
}

.table.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Floor metrics strip */
.floor-foot {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  white-space: nowrap;
}
.floor-foot .stat { flex-shrink: 0; }
.floor-foot .stat { display: flex; flex-direction: column; gap: 2px; }
.floor-foot .stat .lbl { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.floor-foot .stat .val { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.floor-foot .stat .val.mono { font-family: var(--font-mono); font-weight: 500; }
.floor-foot .vsep { width: 1px; align-self: stretch; background: var(--line); }

/* ============================================================
   Right rail: order ticket / actions
   ============================================================ */
.rail {
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.rail-head .eyebrow {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.rail-head .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.rail-head .meta { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.rail-head .meta .item { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rail-head .meta .item .v { font-weight: 600; color: var(--ink); font-family: var(--font-mono); }

.rail-list {
  flex: 1; overflow: auto;
  padding: 4px 0;
}
.rail-empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 0 30px;
  color: var(--ink-3); text-align: center;
}
.rail-empty .ico {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--bg-2);
  display: grid; place-items: center;
  color: var(--ink-3);
}
.rail-empty .title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink-2); }
.rail-empty .sub { font-size: 12px; }

.ord-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 9px 16px;
  position: relative;
}
.ord-item:hover { background: var(--surface-2); }
.ord-item .qty {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  background: var(--primary-tint);
  color: var(--primary-2);
  border-radius: 5px;
  height: 22px;
  display: grid; place-items: center;
}
.ord-item .name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.ord-item .mods { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.ord-item .price { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.ord-item .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  position: absolute; left: 8px; top: 16px;
  background: var(--line-2);
}
.ord-item[data-fired="true"] .status-dot { background: var(--warning); }
.ord-item[data-fired="ready"] .status-dot { background: var(--success); }
.ord-item[data-fired="served"] .status-dot { background: var(--primary); }

.rail-totals {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: var(--surface);
}
.rail-totals .line {
  display: flex; justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
  color: var(--ink-2);
  white-space: nowrap;
  gap: 8px;
}
.rail-totals .line .v { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.rail-totals .line.grand {
  border-top: 1px dashed var(--line);
  margin-top: 6px; padding-top: 8px;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
}
.rail-totals .line.grand .v {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.rail-actions {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface);
}
.rail-actions .span-2 { grid-column: span 2; }

/* ============================================================
   Order screen — menu grid + ticket
   ============================================================ */
.order-screen {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  min-height: 0;
}
.menu {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg);
}
.menu-tabs {
  display: flex; gap: 4px;
  padding: 12px 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.menu-tabs button {
  border: 0; background: transparent;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 600;
  color: var(--ink-3);
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.menu-tabs button[aria-selected="true"] {
  color: var(--primary);
  background: var(--surface);
}
.menu-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--primary);
}
.menu-grid {
  flex: 1; overflow: auto;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: start;
}
.menu-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 10px;
  text-align: left;
  cursor: pointer;
  display: flex; flex-direction: column;
  gap: 4px;
  position: relative;
  transition: transform 80ms ease, box-shadow 120ms ease;
}
.menu-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--line-2); }
.menu-item:active { transform: translateY(0); }
.menu-item .iname {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.menu-item .idesc {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-item .iprice {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 6px;
}
.menu-item .ilow {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 999px;
  font-family: var(--font-mono);
}
.menu-item[data-oos="true"] { opacity: 0.5; cursor: not-allowed; }
.menu-item[data-oos="true"]::before {
  content: "OUT"; position: absolute; top: 8px; right: 8px;
  background: var(--ink-3); color: white; font-size: 9.5px; padding: 2px 6px; border-radius: 999px;
  font-weight: 700;
}

/* ============================================================
   KDS
   ============================================================ */
.kds {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #11100D;
}
[data-theme="light"] .kds { background: #1A1814; }
.kds-grid {
  flex: 1; overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-content: start;
}
.ticket {
  background: #1F1C16;
  border-radius: 12px;
  border: 1px solid #2E2A22;
  color: #F4EFE3;
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}
.ticket[data-age="warn"] { border-color: #B97B0E; box-shadow: 0 0 0 1px #B97B0E inset; }
.ticket[data-age="late"] {
  border-color: #B23A2C;
  box-shadow: 0 0 0 2px #B23A2C inset, 0 0 24px rgba(178,58,44,0.3);
  animation: late-pulse 2s ease-in-out infinite;
}
@keyframes late-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #B23A2C inset, 0 0 24px rgba(178,58,44,0.3); }
  50% { box-shadow: 0 0 0 2px #B23A2C inset, 0 0 36px rgba(178,58,44,0.55); }
}

.ticket-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: #16140F;
  border-bottom: 1px solid #2E2A22;
}
.ticket-head .tnum {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.ticket-head .ago {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #2E2A22;
}
.ticket[data-age="warn"] .ago { background: #B97B0E; color: #1A1814; }
.ticket[data-age="late"] .ago { background: #B23A2C; color: white; }

.ticket-meta {
  display: flex; gap: 12px;
  padding: 6px 12px;
  font-size: 11px;
  color: #C9C1AE;
  border-bottom: 1px solid #2E2A22;
  font-family: var(--font-mono);
}

.ticket-items { padding: 8px 0; }
.ticket-line {
  display: grid;
  grid-template-columns: 26px 1fr 24px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.ticket-line:hover { background: rgba(255,255,255,0.03); }
.ticket-line .q {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #F4EFE3;
}
.ticket-line .n { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.ticket-line .m { font-size: 11px; color: #C9C1AE; margin-top: 2px; }
.ticket-line .check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid #4A453A;
  display: grid; place-items: center;
}
.ticket-line[data-done="true"] { color: #7A7367; }
.ticket-line[data-done="true"] .n { text-decoration: line-through; color: #7A7367; }
.ticket-line[data-done="true"] .m { color: #5A5246; }
.ticket-line[data-done="true"] .check { background: #2F9C68; border-color: #2F9C68; color: white; }

.ticket-foot {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #2E2A22;
  background: #16140F;
}
.ticket-foot button {
  flex: 1;
  border: 0; background: #2E2A22;
  color: #F4EFE3;
  font-family: var(--font-ui);
  font-weight: 600; font-size: 12.5px;
  padding: 8px 12px; border-radius: 8px;
  cursor: pointer;
}
.ticket-foot button.go { background: #2F9C68; }
.ticket-foot button:hover { filter: brightness(1.1); }

.kds-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: #16140F;
  color: #F4EFE3;
  border-bottom: 1px solid #2E2A22;
  flex-shrink: 0;
}
.kds-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.02em;
}
.kds-head .kpi {
  display: flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #1F1C16;
  border: 1px solid #2E2A22;
}
.kds-head .kpi .v { font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: #F4EFE3; }
.kds-head .kpi .l { font-size: 11px; color: #8A8170; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kds-head .grow { flex: 1; }

/* ============================================================
   Owner dashboard
   ============================================================ */
.owner {
  flex: 1; overflow: auto;
  padding: 22px;
  background: var(--bg);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: min-content;
  gap: 14px;
  align-content: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  position: relative;
}
.card .head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.card .head h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--ink-2);
  text-transform: uppercase;
  font-feature-settings: "ss01";
  min-width: 0;
  line-height: 1.3;
}
.card .head .sub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.card.hero {
  background:
    linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: var(--on-primary);
  border-color: var(--primary-2);
}
.card.hero h3 { color: color-mix(in oklab, var(--on-primary) 75%, transparent); }
.card.hero .sub { color: color-mix(in oklab, var(--on-primary) 60%, transparent); }
.card.hero .big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 48px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 6px 0 8px;
}
.card.hero .meta {
  display: flex; gap: 18px; align-items: center;
  color: color-mix(in oklab, var(--on-primary) 80%, transparent);
  font-size: 12px;
  white-space: nowrap;
  flex-wrap: wrap;
}
.card.hero .meta .pos { color: color-mix(in oklab, #ABEDC8 100%, transparent); font-weight: 600; }

.metric {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.metric .unit { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }

.spark { width: 100%; height: 60px; }

/* table styles */
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th, .dtable td { text-align: left; padding: 6px 0; vertical-align: middle; }
.dtable th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dtable td { border-bottom: 1px solid var(--line); }
.dtable tr:last-child td { border-bottom: 0; }
.dtable .n { font-family: var(--font-mono); font-weight: 600; text-align: right; white-space: nowrap; }
.dtable .ttl { font-weight: 600; }

.bar { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); border-radius: 4px; }
.bar.acc > div { background: var(--accent); }

/* WhatsApp moments */
.wa-feed {
  display: flex; flex-direction: column; gap: 8px;
}
.wa-msg {
  display: flex; gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 12.5px;
  border: 1px solid var(--line);
}
.wa-msg .icn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.wa-msg .who { font-weight: 600; color: var(--ink); }
.wa-msg .body { color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.wa-msg .when { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 4px; }

/* ============================================================
   Floating toasts (WhatsApp send confirmation)
   ============================================================ */
.toasts {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
  z-index: 50;
}
.toast {
  background: #1A1814;
  color: #F4EFE3;
  padding: 10px 14px 10px 10px;
  border-radius: 999px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 220ms cubic-bezier(.2,.7,.2,1) both;
}
.toast .icn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--whatsapp);
  color: white;
  display: grid; place-items: center;
}
.toast .who { color: #C9C1AE; font-family: var(--font-mono); font-size: 12px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Offline banner + sync queue
   ============================================================ */
.offline-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  background: color-mix(in oklab, var(--warning) 12%, var(--surface));
  border-bottom: 1px solid color-mix(in oklab, var(--warning) 35%, var(--line));
  color: color-mix(in oklab, var(--warning) 60%, var(--ink));
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  animation: slide-down 220ms ease both;
  flex-shrink: 0;
}
.offline-banner .qbadge {
  font-family: var(--font-mono);
  background: var(--warning);
  color: white;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
}
.offline-banner .spacer { flex: 1; }
.offline-banner .link {
  color: var(--warning); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
@keyframes slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ============================================================
   Payment modal
   ============================================================ */
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(15,12,8,0.5);
  display: grid; place-items: center;
  z-index: 80;
  backdrop-filter: blur(6px);
  animation: fade-in 180ms ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 18px;
  width: 520px;
  max-width: 90%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 220ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
}
.modal-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

.modal-body { padding: 18px 22px; }
.modal-foot {
  padding: 14px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
  justify-content: flex-end;
}

.pay-methods {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 16px;
}
.pay-method {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.pay-method:hover { border-color: var(--line-2); background: var(--surface-2); }
.pay-method[data-selected="true"] {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.pay-method .icn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-2);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.pay-method[data-selected="true"] .icn { background: var(--primary); color: var(--on-primary); }
.pay-method .pname { font-weight: 600; font-size: 13.5px; }
.pay-method .pdesc { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.pay-total {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 38px;
  letter-spacing: -0.025em;
  text-align: center;
  padding: 10px 0;
  color: var(--primary);
}
.pay-sub { font-size: 12px; color: var(--ink-3); text-align: center; margin-bottom: 16px; font-family: var(--font-mono); }

.wa-send {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--whatsapp) 6%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--whatsapp) 30%, var(--line));
  font-size: 12.5px;
  margin-top: 12px;
}
.wa-send .icn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--whatsapp); color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.wa-send .l1 { font-weight: 600; font-size: 13px; }
.wa-send .l2 { color: var(--ink-3); font-size: 11.5px; }
.wa-send input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  min-width: 0;
}

/* Receipt preview (WhatsApp message) */
.receipt-bubble {
  background: #DCF8C6;
  color: #1A1814;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  width: 280px;
  margin: 12px auto 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.receipt-bubble .rline { display: flex; justify-content: space-between; }
.receipt-bubble .rdiv { border-top: 1px dashed #8aab78; margin: 6px 0; }
.receipt-bubble .center { text-align: center; }
.receipt-bubble .bold { font-weight: 700; }
.receipt-bubble .small { font-size: 10px; opacity: 0.7; }
.receipt-bubble .when { font-size: 9.5px; color: #5C7B4B; text-align: right; margin-top: 4px; }

/* ============================================================
   Sync queue panel (slide in)
   ============================================================ */
.sync-panel {
  position: absolute;
  top: 56px; right: 0;
  width: 360px; height: calc(100% - 56px - 22px);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 40px -20px rgba(0,0,0,0.2);
  z-index: 30;
  display: flex; flex-direction: column;
  animation: slide-left 240ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes slide-left {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.sync-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sync-head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 0;
}
.sync-list { flex: 1; overflow: auto; padding: 4px 0; }
.sync-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
.sync-row .sdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warning);
  justify-self: center;
}
.sync-row[data-status="syncing"] .sdot {
  background: var(--primary);
  animation: pulse 1s infinite;
}
.sync-row[data-status="synced"] .sdot { background: var(--success); }
.sync-row .stype { font-size: 13px; font-weight: 600; }
.sync-row .swhen { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 2px; }
.sync-row .samt { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

/* Generic */
button { font-family: inherit; }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Scrollbar */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
.kds *::-webkit-scrollbar-thumb { background: #2E2A22; }

/* ============================================================
   Bookings / reservations
   ============================================================ */
.bookings { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.bk-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.bk-main { overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bk-rail { border-left: 1px solid var(--line); background: var(--surface); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }

.btn.sm { font-size: 12px; padding: 5px 10px; border-radius: 7px; gap: 4px; }

.bk-row {
  display: grid;
  grid-template-columns: 58px 3px 1fr auto;
  gap: 14px; align-items: center;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}
.bk-row:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.bk-row[data-tone="bad"], .bk-row[data-tone="muted"] { opacity: 0.72; }

.bk-time { text-align: left; }
.bk-time .t { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.bk-chan {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 5px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3);
  padding: 1px 5px; border-radius: 5px; background: var(--surface-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.bk-chan.wa { color: var(--whatsapp-dk); background: color-mix(in oklab, var(--whatsapp) 10%, var(--surface)); border-color: color-mix(in oklab, var(--whatsapp) 30%, var(--line)); }

.bk-rail-line { width: 3px; height: 36px; border-radius: 2px; background: var(--line-2); }
.bk-row[data-tone="ok"] .bk-rail-line { background: var(--primary); }
.bk-row[data-tone="soon"] .bk-rail-line { background: var(--accent); }
.bk-row[data-tone="go"] .bk-rail-line { background: var(--gold); }
.bk-row[data-tone="wait"] .bk-rail-line { background: var(--ink-3); opacity: 0.5; }
.bk-row[data-tone="bad"] .bk-rail-line { background: var(--danger); }

.bk-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); }
.bk-party { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-2); font-family: var(--font-mono); }
.bk-table { font-size: 11px; font-weight: 600; color: var(--primary-2); background: var(--primary-tint); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.bk-table.none { color: var(--ink-3); background: var(--surface-2); border: 1px dashed var(--line-2); }
.bk-sub { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.bk-dep { color: var(--gold); font-weight: 600; font-family: var(--font-mono); }
.bk-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }

.bk-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bk-pill { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.bk-pill.tone-ok { color: var(--primary); background: var(--primary-tint); }
.bk-pill.tone-soon { color: white; background: var(--accent); }
.bk-pill.tone-go { color: var(--warning); background: color-mix(in oklab, var(--gold) 16%, var(--surface)); }
.bk-pill.tone-wait { color: var(--ink-3); background: var(--surface-2); border: 1px dashed var(--line-2); }
.bk-pill.tone-bad { color: var(--danger); background: color-mix(in oklab, var(--danger) 12%, var(--surface)); }
.bk-pill.tone-muted { color: var(--ink-3); background: var(--surface-2); }
.bk-actions { display: flex; gap: 6px; align-items: center; }
.bk-done { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); }

.bk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 64px; color: var(--ink-3); text-align: center; }
.bk-empty svg { color: var(--success); }

.wa-badge { width: 18px; height: 18px; border-radius: 5px; background: var(--whatsapp); color: white; display: grid; place-items: center; flex-shrink: 0; }

.bk-glance { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin: 4px 0 14px; }
.bk-glance .g .v { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.bk-glance .g .v.mono { font-family: var(--font-mono); font-size: 22px; }
.bk-glance .g .l { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.bk-meter { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: var(--bg-2); }
.bk-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.bk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bk-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.bk-dep-list { display: flex; flex-direction: column; }
.bk-dep-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px dashed var(--line); }
.bk-dep-item:first-child { border-top: 0; }
.bk-dep-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.bk-dep-item .dot[data-tone="ok"] { background: var(--primary); }
.bk-dep-item .dot[data-tone="soon"] { background: var(--accent); }
.bk-dep-item .dot[data-tone="go"] { background: var(--gold); }
.bk-dep-item .who .n { font-weight: 600; font-size: 13px; }
.bk-dep-item .who .m { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 1px; }
.bk-dep-item .amt { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.bk-dep-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.bk-dep-total .v { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }

/* ============================================================
   Stock / inventory
   ============================================================ */
.stock { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.stk-stats { display: flex; align-items: center; gap: 18px; padding: 11px 22px; background: var(--surface); border-bottom: 1px solid var(--line); flex-shrink: 0; white-space: nowrap; }
.stk-stats .stat { display: flex; flex-direction: column; gap: 2px; }
.stk-stats .stat .l { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.stk-stats .stat .v { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.stk-stats .stat .v.mono { font-family: var(--font-mono); font-weight: 500; font-size: 18px; }
.stk-stats .vsep { width: 1px; height: 30px; background: var(--line); }
.stk-stats .grow { flex: 1; }

.stk-body { flex: 1; display: grid; grid-template-columns: 1fr 330px; min-height: 0; }
.stk-main { overflow: auto; padding: 0 0 12px; }

.stk-table { width: 100%; border-collapse: collapse; }
.stk-table thead th { position: sticky; top: 0; background: var(--bg); z-index: 2; text-align: left; font-size: 10.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stk-table thead th.c { text-align: center; }
.stk-cat-row td { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 16px 16px 6px; font-weight: 600; background: var(--bg); }
.stk-row { border-bottom: 1px solid var(--line); }
.stk-row:hover { background: var(--surface-2); }
.stk-row td { padding: 11px 16px; vertical-align: middle; }
.stk-name .n { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.stk-name .m { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 2px; }

.stk-bar-cell { width: 32%; min-width: 170px; }
.stk-bar { position: relative; height: 8px; border-radius: 4px; background: var(--bg-2); }
.stk-bar > div { height: 100%; border-radius: 4px; background: var(--primary); transition: width 160ms ease; }
.stk-bar[data-status="low"] > div { background: var(--gold); }
.stk-bar[data-status="critical"] > div { background: var(--accent); }
.stk-bar[data-status="out"] > div { background: var(--danger); }
.stk-bar .par { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink-3); border-radius: 1px; transform: translateX(-1px); }
.stk-bar-meta { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; font-family: var(--font-mono); }
.stk-bar-meta .lvl { font-weight: 600; }
.stk-bar-meta .lvl.tone-ok { color: var(--ink); }
.stk-bar-meta .lvl.tone-low { color: var(--warning); }
.stk-bar-meta .lvl.tone-critical { color: var(--accent); }
.stk-bar-meta .lvl.tone-out { color: var(--danger); }
.stk-bar-meta .par-txt { color: var(--ink-3); }

.stk-stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.stk-stepper button { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.stk-stepper button:hover { background: var(--surface); color: var(--ink); }
.stk-stepper .q { min-width: 32px; text-align: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--ink); }
.stk-stepper.sm { padding: 1px; }
.stk-stepper.sm button { width: 22px; height: 22px; }
.stk-stepper.sm .q { min-width: 22px; font-size: 12px; }
.stk-stepper-cell { text-align: center; }

.stk-pill { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.stk-pill.tone-ok { color: var(--primary); background: var(--primary-tint); }
.stk-pill.tone-low { color: var(--warning); background: color-mix(in oklab, var(--gold) 16%, var(--surface)); }
.stk-pill.tone-critical { color: var(--accent); background: var(--accent-tint); }
.stk-pill.tone-out { color: white; background: var(--danger); }
.stk-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.stk-ok svg { color: var(--success); }
.stk-act-cell { text-align: right; }

.stk-suppliers { padding: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-content: start; }
.stk-sup .stk-sup-cat { font-size: 12px; color: var(--ink-3); margin-top: -4px; }
.stk-sup-meta { display: flex; gap: 28px; margin-top: 12px; }
.stk-sup-meta .l { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; }
.stk-sup-meta .v { display: block; font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-top: 2px; color: var(--ink); }
.stk-sup-phone { margin-top: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.stk-sup-phone svg { color: var(--whatsapp); }

.stk-rail { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.stk-po-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.stk-po-head .eyebrow { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.stk-po-head .title { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; margin-top: 2px; color: var(--ink); }
.stk-po-count { min-width: 24px; height: 24px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-family: var(--font-mono); font-weight: 700; font-size: 12px; display: grid; place-items: center; padding: 0 7px; }
.stk-po-list { flex: 1; overflow: auto; padding: 4px 0; }
.stk-po-empty { padding: 34px 24px; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stk-po-empty .ico { width: 54px; height: 54px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; }
.stk-po-empty .t { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink-2); }
.stk-po-empty .s { font-size: 12px; line-height: 1.45; }
.stk-po-group { padding: 2px 0 6px; }
.stk-po-sup { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 16px 4px; font-weight: 600; }
.stk-po-item { display: grid; grid-template-columns: 1fr auto auto 20px; gap: 8px; align-items: center; padding: 7px 16px; }
.stk-po-item .info { min-width: 0; }
.stk-po-item .info .n { font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-po-item .info .m { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 1px; }
.stk-po-item .line { font-family: var(--font-mono); font-size: 12px; font-weight: 600; min-width: 42px; text-align: right; color: var(--ink); }
.stk-po-item .rm { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; }
.stk-po-item .rm:hover { background: var(--surface-2); color: var(--danger); }
.stk-po-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.stk-po-foot .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stk-po-foot .row .v { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.stk-po-foot .note { font-size: 11px; color: var(--ink-3); text-align: center; }

/* ============================================================
   Auto-scale: tablet fits viewport
   ============================================================ */
.tablet-wrap { transform-origin: center; }
