/* Pork Up Grill POS styles. Original look kept; new parts added at the end. */
/* Fonts are stored with the app (folder fonts), so the POS never waits for the internet to draw text. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/space-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/space-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); }

  :root {
    --bg: #FBF3E2; --surface: #FFFFFF; --surface-2: #F3E6C8;
    --ink: #1A1310; --ink-soft: #7A6552; --border: #E8D8B4;
    --brand: #0D0D0D; --brand-ink: #FCE3AE;
    --primary: #DA0F0F; --primary-ink: #FFFFFF; --primary-soft: #FBDADA;
    --success: #2F7D4F; --success-bg: #E4F3E9;
    --danger: #8C1515; --danger-bg: #FBE1DF;
    --warn: #8A5A00; --warn-bg: #FBF0D9;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20,15,10,.08), 0 6px 20px rgba(20,15,10,.10);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0A0A0A; --surface: #161311; --surface-2: #221D19;
      --ink: #FCE3AE; --ink-soft: #C9AD82; --border: #3A2E22;
      --primary-soft: #3A1414; --success-bg: #17301F; --danger-bg: #3A1613; --warn: #E0AC4E; --warn-bg: #3A2E0F;
      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
    }
  }
  :root[data-theme="dark"] {
    --bg: #0A0A0A; --surface: #161311; --surface-2: #221D19;
    --ink: #FCE3AE; --ink-soft: #C9AD82; --border: #3A2E22;
    --primary-soft: #3A1414; --success-bg: #17301F; --danger-bg: #3A1613; --warn: #E0AC4E; --warn-bg: #3A2E0F;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; flex-direction: column; min-height: 100%;
  }
  h1, h2, h3, .num, .mono { font-family: 'Space Grotesk', 'Inter', sans-serif; }
  .mono-figures { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
  button { font-family: inherit; }
  input, select { font-family: inherit; }

  /* ---------- header / chrome ---------- */
  header.app-header {
    background: var(--brand); color: var(--brand-ink);
    padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 15;
  }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; flex-shrink: 0; }
  .brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .brand-text h1 { margin: 0; font-size: 15.5px; font-weight: 700; }
  .brand-text p { margin: 0; font-size: 10.5px; opacity: .8; }
  .header-right { display: flex; align-items: center; gap: 10px; }
  .conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #E8C468; }
  .conn-dot[data-state="db"] { background: #6FCF97; }
  .conn-dot[data-state="local"] { background: #E8C468; }
  .conn-dot[data-state="offline"] { background: #E88468; }
  .who-chip { font-size: 11.5px; background: rgba(255,255,255,.15); padding: 5px 10px; border-radius: 20px; cursor: pointer; border: none; color: var(--brand-ink); }

  main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 14px 24px 14px; }
  main[hidden] { display: none; }
  main.pad-cart { padding-bottom: 100px; }

  /* ---------- big-button main menu ---------- */
  .big-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
  .big-btn {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    padding: 26px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
    box-shadow: var(--shadow); cursor: pointer; color: var(--ink);
  }
  .big-btn .icon { font-size: 30px; }
  .big-btn .label { font-weight: 700; font-size: 15px; }
  .big-btn .sub { font-size: 11px; color: var(--ink-soft); text-align: center; }

  .back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .back-row[hidden] { display: none; }
  .back-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; }
  .back-row h2 { margin: 0; font-size: 17px; }

  /* ---------- category tabs (Pork / Sides) ---------- */
  .cat-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
  .cat-tabs button {
    flex: 1; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
    padding: 11px; border-radius: 12px; font-weight: 700; font-size: 13.5px; cursor: pointer;
  }
  .cat-tabs button.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

  .pork-grid, .side-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pork-grid[hidden], .side-grid[hidden] { display: none; }
  .tables-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
  .table-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 8px; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
  .table-card .t-name { font-weight: 700; font-size: 14px; }
  .table-card .t-status { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
  .table-card.occupied { border-color: var(--primary); background: var(--primary-soft); }
  .table-card.occupied .t-status { color: var(--primary); font-weight: 700; }
  .sent-round { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
  .sent-round .sr-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 6px; }
  .sent-round .sr-item { font-size: 13.5px; padding: 2px 0; }
  .ticket-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--warn); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
  .ticket-card.aging { border-left-color: var(--danger); }
  .ticket-card .tk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .ticket-card .tk-table { font-weight: 700; font-size: 15px; }
  .ticket-card .tk-time { font-size: 11.5px; color: var(--ink-soft); }
  .ticket-card .tk-item { font-size: 14px; padding: 3px 0; }
  .ticket-card button.tk-ready { width: 100%; margin-top: 10px; border: none; background: var(--success); color: #fff; border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; }
  .pork-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); grid-column: span 2; }
  @media (min-width: 460px) { .pork-card { grid-column: span 1; } }
  .pork-card .style-name { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; }
  .size-row { display: flex; flex-direction: column; gap: 6px; }
  .size-btn { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--ink); font-size: 13px; }
  .size-btn .qty-badge { background: var(--primary); color: var(--primary-ink); border-radius: 8px; min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 5px; visibility: hidden; }
  .size-btn[data-qty]:not([data-qty="0"]) { border-color: var(--primary); background: var(--primary-soft); }
  .size-btn[data-qty]:not([data-qty="0"]) .qty-badge { visibility: visible; }
  .size-btn .price { color: var(--ink-soft); }

  .side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: left; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; position: relative; }
  .side-card[data-qty]:not([data-qty="0"]) { border-color: var(--primary); background: var(--primary-soft); }
  .side-card .name { font-weight: 700; font-size: 14.5px; }
  .side-card .price { color: var(--ink-soft); font-size: 12.5px; }
  .side-card .qty-badge { position: absolute; top: 8px; right: 8px; background: var(--primary); color: var(--primary-ink); border-radius: 8px; min-width: 22px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 6px; visibility: hidden; }
  .side-card[data-qty]:not([data-qty="0"]) .qty-badge { visibility: visible; }

  /* ---------- cart bar ---------- */
  .cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) 14px; background: var(--surface); border-top: 1px solid var(--border); }
  .cart-bar-inner { max-width: 760px; margin: 0 auto; background: var(--primary); color: var(--primary-ink); border-radius: 14px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; border: none; width: 100%; }
  .cart-bar-inner[disabled] { background: var(--surface-2); color: var(--ink-soft); cursor: default; }
  .cart-bar-inner .cb-left { display: flex; flex-direction: column; align-items: flex-start; }
  .cart-bar-inner .cb-count { font-size: 11.5px; opacity: .85; }
  .cart-bar-inner .cb-total { font-size: 18px; font-weight: 700; }
  .cart-bar-inner .cb-cta { font-size: 14px; font-weight: 600; }

  /* ---------- sheets / modals ---------- */
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(20,13,9,.5); z-index: 30; }
  .sheet-backdrop[hidden] { display: none; }
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--surface); border-radius: 18px 18px 0 0; max-height: 92vh; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sheet[hidden] { display: none; }
  .sheet:not([hidden]) { display: flex; }
  .sheet-handle { display: flex; justify-content: center; padding: 10px 0 4px; }
  .sheet-handle span { width: 36px; height: 4px; border-radius: 2px; background: var(--border); }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 10px; border-bottom: 1px solid var(--border); }
  .sheet-head h2 { margin: 0; font-size: 17px; }
  .sheet-close { border: none; background: var(--surface-2); color: var(--ink); width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer; }
  .sheet-body { overflow-y: auto; padding: 14px 18px; flex: 1; }
  .sheet-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

  .modal-center { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
  .modal-center[hidden] { display: none; }
  .modal-box { background: var(--surface); border-radius: 18px; padding: 22px; width: 100%; max-width: 340px; box-shadow: var(--shadow); text-align: center; }
  .modal-box h3 { margin: 0 0 6px; font-size: 17px; }
  .modal-box p { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }

  /* ---------- pin pad ---------- */
  .pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 18px; }
  .pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border); }
  .pin-dots span.filled { background: var(--primary); border-color: var(--primary); }
  .pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .pin-pad button { padding: 16px 0; font-size: 19px; font-weight: 700; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); cursor: pointer; }
  .pin-pad button.pin-clear, .pin-pad button.pin-back { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
  .pin-error { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-top: 4px; }

  /* ---------- cart lines ---------- */
  .cart-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
  .cart-line:last-child { border-bottom: none; }
  .cart-line .cl-name { flex: 1; font-size: 13.5px; }
  .cart-line .cl-name .size { color: var(--ink-soft); font-size: 12px; }
  .cart-line .cl-stepper { display: flex; align-items: center; gap: 8px; }
  .cl-stepper button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--ink); font-size: 15px; cursor: pointer; line-height: 1; }
  .cl-stepper .cl-qty { min-width: 18px; text-align: center; font-weight: 600; font-size: 13.5px; }
  .cart-line .cl-total { width: 78px; text-align: right; font-size: 13.5px; }
  .cl-override { font-size: 10.5px; color: var(--primary); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; margin-top: 2px; }

  .field { margin-bottom: 12px; }
  .field label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
  .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
  .field textarea { resize: vertical; min-height: 60px; }
  .pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pay-grid label { font-size: 11px; }
  .discount-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); margin-top: 6px; }
  .discount-row button { border: none; background: none; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; }
  .paid-unpaid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn-paid-big, .btn-unpaid-big { border: none; border-radius: 14px; padding: 18px 10px; font-size: 15px; font-weight: 700; line-height: 1.8; cursor: pointer; }
  .btn-paid-big { background: var(--success-bg); color: var(--success); border: 2px solid var(--success); }
  .btn-unpaid-big { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); }
  .method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .method-grid button { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 14px 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
  .stage-back { border: none; background: none; color: var(--ink-soft); font-size: 13px; cursor: pointer; padding: 0; font-weight: 600; }
  .stage-link { display: block; margin: 12px auto 0; border: none; background: none; color: var(--primary); font-size: 12.5px; font-weight: 600; text-decoration: underline; cursor: pointer; }
  .unpaid-badge { display: block; width: 100%; text-align: left; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 700; margin-bottom: 12px; cursor: pointer; }
  .avail-link { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--ink-soft); font-size: 12px; font-weight: 600; padding: 0 2px 10px; cursor: pointer; }
  .avail-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .avail-row:last-child { border-bottom: none; }
  .avail-row .avail-name { font-size: 13.5px; }
  .avail-row .avail-name .size { color: var(--ink-soft); font-size: 12px; }
  .avail-toggle { border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--success-bg); color: var(--success); }
  .avail-toggle.is-out { background: var(--danger-bg); color: var(--danger); }
  .size-btn.sold-out, .side-card.sold-out { opacity: .45; }
  .size-btn.sold-out .qty-badge, .side-card.sold-out .qty-badge { visibility: hidden !important; }
  .unpaid-badge[hidden] { display: none; }
  .unpaid-order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
  .unpaid-order-card .uo-top { display: flex; justify-content: space-between; gap: 8px; }
  .unpaid-order-card .uo-time { font-size: 11.5px; color: var(--ink-soft); }
  .unpaid-order-card .uo-items { font-size: 12px; color: var(--ink-soft); margin: 4px 0 8px; }
  .unpaid-order-card .uo-owing { color: var(--danger); font-weight: 700; }
  .unpaid-order-card button.uo-mark-paid { width: 100%; border: none; background: var(--success); color: #fff; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }

  .settle-banner { margin-top: 12px; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; }
  .settle-banner.ok { background: var(--success-bg); color: var(--success); }
  .settle-banner.owing { background: var(--danger-bg); color: var(--danger); }
  .settle-banner.neutral { background: var(--surface-2); color: var(--ink-soft); }

  .btn-primary { flex: 1; border: none; background: var(--primary); color: var(--primary-ink); border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
  .btn-primary:disabled { background: var(--surface-2); color: var(--ink-soft); }
  .btn-secondary { flex: 1; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
  .btn-danger { flex: 1; border: none; background: var(--danger); color: #fff; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
  .btn-full { width: 100%; }

  /* ---------- summary cards / tables ---------- */
  .summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
  .low-stock-banner { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
  .summary-card .label { font-size: 11.5px; color: var(--ink-soft); }
  .summary-card .value { font-size: 18px; font-weight: 700; }
  .summary-card.warn .value { color: var(--danger); }
  .summary-card.wide { grid-column: 1 / -1; }

  .date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
  .date-nav button.nav-arrow { border: 1px solid var(--border); background: var(--surface); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 15px; cursor: pointer; }
  .date-nav .date-label { font-weight: 700; font-size: 14.5px; text-align: center; flex: 1; }
  .date-nav .today-link { font-size: 11.5px; color: var(--primary); background: none; border: none; font-weight: 600; display: block; margin: 0 auto; }
  .date-nav .today-link[hidden] { display: none; }

  h3.section-title { font-size: 13px; color: var(--ink-soft); margin: 18px 2px 8px; }
  .data-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .data-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; gap: 8px; }
  .data-row:last-child { border-bottom: none; }
  .data-row .dr-label { color: var(--ink-soft); }
  .data-row .dr-value { font-weight: 600; }
  .data-row.total-row { background: var(--surface-2); }
  .data-row.variance-ok .dr-value { color: var(--success); }
  .data-row.variance-bad .dr-value { color: var(--danger); }

  .stock-cat-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
  .stock-cat-tabs button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
  .stock-cat-tabs button.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

  .action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
  .action-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
  .action-btn .lock { font-size: 10px; color: var(--ink-soft); display: block; margin-top: 2px; }

  .tx-card, .log-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
  .tx-card.voided { opacity: .55; }
  .tx-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .tx-time { font-size: 11.5px; color: var(--ink-soft); }
  .tx-total { font-size: 16px; font-weight: 700; }
  .tx-items { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
  .tx-pay { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
  .tx-pay span { font-size: 10.5px; background: var(--surface-2); border-radius: 7px; padding: 3px 8px; }
  .tx-pay .flag-unpaid { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
  .tx-pay .flag-over { background: var(--success-bg); color: var(--success); font-weight: 600; }
  .tx-pay .flag-void { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
  .tx-actions { display: flex; gap: 14px; margin-top: 8px; }
  .tx-actions button { border: none; background: none; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; text-decoration: underline; padding: 0; }
  .tx-actions .tx-delete-action { color: var(--danger); font-weight: 700; }
  .tx-void-reason { font-size: 11px; color: var(--danger); margin-top: 4px; }

  .empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
  .empty-state .icon { font-size: 30px; margin-bottom: 8px; }
  .empty-state p { font-size: 13.5px; margin: 4px 0; }

  #toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: 85vw; text-align: center; }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  #toast.err { background: var(--danger); color: #fff; }

  /* ---------- receipt ---------- */
  #receipt-content { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.5; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; padding: 14px; }
  #receipt-content .r-center { text-align: center; }
  #receipt-content .r-row { display: flex; justify-content: space-between; gap: 8px; }
  #receipt-content hr { border: none; border-top: 1px dashed var(--ink-soft); margin: 8px 0; }
  @media print {
    body > *:not(#print-root) { display: none !important; }
    #print-root { display: block !important; position: static; }
    #print-root #receipt-print-content { border: none; width: 280px; margin: 0 auto; font-size: 12px; }
  }
  #print-root { display: none; }

  .login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; padding: 20px; }
  .login-mark { width: 88px; height: 88px; border-radius: 20px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
  .login-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .login-wrap h1 { margin: 0 0 2px; font-size: 19px; }
  .login-wrap p.tag { margin: 0 0 22px; color: var(--ink-soft); font-size: 13px; }
  .login-wrap .pin-pad { width: 100%; max-width: 280px; }
  .login-wrap .pin-dots { margin-top: 4px; }

/* =================== v2 additions =================== */
[hidden] { display: none !important; }
.conn-pill { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 20px; background: #1f5d38; color: #d8ffe6; white-space: nowrap; }
.conn-pill.off { background: #8a2b14; color: #ffe2d6; }
.conn-pill.sync { background: #7a5a00; color: #fff3cf; }
.banner { border-radius: 12px; padding: 11px 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.banner.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.banner.ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.banner button { border: none; background: rgba(0,0,0,.12); color: inherit; font-weight: 700; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.alert-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alert-chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.alert-chip.hot { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-chip.warm { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.alert-chip.good { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.big-grid.three { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 620px) { .big-grid.three { grid-template-columns: repeat(3, 1fr); } }
.big-btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.big-btn.primary .sub { color: var(--primary-ink); opacity: .85; }
.big-btn.wide { grid-column: 1 / -1; padding: 30px 14px; }
.big-btn .badge { background: var(--primary); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.type-btn { border: 2px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 18px; padding: 40px 10px; font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); font-family: 'Space Grotesk', 'Inter', sans-serif; }
.type-btn span { display: block; font-size: 34px; margin-bottom: 8px; }
.type-btn:active, .big-btn:active, .item-card:active { transform: scale(.98); }
.sale-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.sale-head button { border: none; background: none; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 12.5px; }
.cat-tabs { overflow-x: auto; }
.cat-tabs button { flex: 1 0 auto; min-width: 110px; }
.item-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .item-grid { grid-template-columns: repeat(3, 1fr); } }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.item-card .ic-name { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; }
.item-card.single { cursor: pointer; position: relative; }
.item-card.single .ic-price { color: var(--ink-soft); font-size: 12.5px; }
.item-card.sel { border-color: var(--primary); background: var(--primary-soft); }
.item-card .qb { position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff; border-radius: 8px; min-width: 22px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 6px; }
.item-card.out, .size-btn.out { opacity: .45; }
.item-card .out-tag, .size-btn .out-tag { font-size: 10px; font-weight: 800; color: var(--danger); }
.size-btn { width: 100%; }
.size-btn.sel { border-color: var(--primary); background: var(--primary-soft); }
.size-btn .qb { background: var(--primary); color: #fff; border-radius: 8px; min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 5px; }
.avail-mode { background: var(--danger-bg) !important; color: var(--danger) !important; border: 1px solid var(--danger) !important; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; }
.order-card.st-new { border-left-color: #6b7fd7; } .order-card.st-preparing { border-left-color: var(--warn); }
.order-card.st-ready { border-left-color: var(--success); } .order-card.st-late { border-left-color: var(--danger); background: var(--danger-bg); }
.order-card .oc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.order-card .oc-code { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 17px; }
.order-card .oc-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.order-card .oc-items { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.order-card .oc-amt { text-align: right; font-weight: 800; }
.order-card .oc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 10.5px; font-weight: 800; border-radius: 7px; padding: 3px 8px; background: var(--surface-2); color: var(--ink-soft); letter-spacing: .02em; }
.chip.new { background: #e4e8fb; color: #3446a0; } .chip.preparing { background: var(--warn-bg); color: var(--warn); }
.chip.ready { background: var(--success-bg); color: var(--success); } .chip.done { background: var(--surface-2); color: var(--ink-soft); }
.chip.paid { background: var(--success-bg); color: var(--success); } .chip.unpaid, .chip.partial { background: var(--danger-bg); color: var(--danger); }
.chip.pending { background: #7a5a00; color: #fff3cf; } .chip.void { background: var(--danger); color: #fff; }
.seg { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.seg button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.seg button.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.kds-ticket { background: var(--surface); border: 2px solid var(--border); border-top: 8px solid #6b7fd7; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kds-ticket.preparing { border-top-color: var(--warn); } .kds-ticket.ready { border-top-color: var(--success); opacity: .8; }
.kds-ticket.aging { border-color: var(--warn); } .kds-ticket.late { border-color: var(--danger); background: var(--danger-bg); }
.kds-ticket.fresh { animation: flash 1s ease-in-out 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px rgba(218,15,15,.5); } }
.kds-code { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 24px; display: flex; justify-content: space-between; align-items: center; }
.kds-timer { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; }
.kds-meta { font-size: 14px; font-weight: 700; margin: 4px 0; }
.kds-meta .muted { color: var(--ink-soft); font-weight: 500; }
.kds-items { margin: 8px 0; flex: 1; }
.kds-items div { font-size: 18px; font-weight: 600; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.kds-items div b { display: inline-block; min-width: 34px; }
.kds-note { background: var(--warn-bg); color: var(--warn); font-weight: 800; border-radius: 8px; padding: 8px 10px; font-size: 15px; margin: 6px 0; }
.kds-btn { width: 100%; border: none; border-radius: 12px; padding: 16px; font-size: 18px; font-weight: 800; cursor: pointer; margin-top: 8px; color: #fff; background: #3446a0; }
.kds-btn.go-ready { background: var(--success); } .kds-btn.undo { background: var(--surface-2); color: var(--ink-soft); font-size: 13px; padding: 8px; }
.kds-waiting { font-weight: 800; color: var(--success); font-size: 14px; margin-top: 6px; }
.kds-waiting.late { color: var(--danger); }
.kds-counts { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.kds-counts span { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: 13px; }
.sound-gate { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 70; display: flex; align-items: center; justify-content: center; }
.sound-gate button { font-size: 20px; font-weight: 800; padding: 24px 30px; border-radius: 18px; border: none; background: var(--primary); color: #fff; }
.stock-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.stock-card h4 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; }
.stock-grid { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13px; }
.stock-grid .l { color: var(--ink-soft); } .stock-grid .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-grid .tot { font-weight: 800; color: var(--ink); border-top: 1px solid var(--border); padding-top: 3px; }
.v-ok { color: var(--success) !important; } .v-bad { color: var(--danger) !important; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.list-row.inactive { opacity: .5; }
.mini-btn { border: 1px solid var(--border); background: var(--bg); color: var(--ink); border-radius: 9px; padding: 7px 11px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mini-btn.danger { color: var(--danger); border-color: var(--danger); }
.mini-btn.ok { color: var(--success); border-color: var(--success); }
.toggle { border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; font-size: 11.5px; font-weight: 800; cursor: pointer; background: var(--success-bg); color: var(--success); white-space: nowrap; }
.toggle.off { background: var(--danger-bg); color: var(--danger); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row > button { flex: 1 1 140px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.center { text-align: center; }
.pin-screen { display: flex; flex-direction: column; align-items: center; padding: 30px 16px; }
.pin-screen .pin-pad { width: 100%; max-width: 300px; }
.pin-screen .pin-pad button { padding: 20px 0; font-size: 24px; }
.pin-screen .pin-dots span { width: 16px; height: 16px; }
.pin-who { font-size: 12px; color: var(--ink-soft); margin-top: 18px; text-align: center; }
.link-btn { border: none; background: none; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 13px; text-decoration: underline; padding: 8px; }
.method-grid button.sel { border-color: var(--primary); background: var(--primary-soft); }
.total-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.total-line.big { font-size: 18px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.sheet-foot.col { flex-direction: column; }
.field .hint { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 8px 0; }
.check input { width: 20px; height: 20px; }
.date-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.date-row input { flex: 1; border: 1px solid var(--border); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 9px; font-size: 14px; }
.ticket-block { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.ticket-block .tb-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.ticket-block .tb-item { display: flex; justify-content: space-between; font-size: 13.5px; padding: 2px 0; }
.timeline { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.fail-card { border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; }
main { max-width: 1100px; }
body.kitchen main { max-width: none; }
.num-in { font-variant-numeric: tabular-nums; }
.modal-center { background: rgba(20,13,9,.55); }
