/* ==========================================================================
   SHAMOSH SHTIBLE POS — v2.19 interface
   Warm paper surfaces, deep forest navigation, coral accents.
   Built for iPad (landscape + portrait), iPhone, and desktop.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --sunken: #efece6;
  --line: #e5e0d7;
  --line-strong: #d2cbbf;
  --ink: #1b2421;
  --ink-2: #44514c;
  --muted: #74807b;
  --brand: #154a3f;
  --brand-hover: #0f3a31;
  --brand-ink: #ffffff;
  --brand-soft: #e2efe9;
  --brand-text: #17594b;
  --accent: #e5606b;
  --accent-soft: #fde8ea;
  --accent-text: #b8404c;
  --ok: #2f8a5f;
  --ok-soft: #e2f3ea;
  --warn: #a8701b;
  --warn-soft: #fbf0d9;
  --danger: #bf3f4b;
  --danger-soft: #fbe7e9;
  --sidebar: #0f2a24;
  --sidebar-2: #163a32;
  --sidebar-ink: #b9cec7;
  --sidebar-muted: #7f9c94;
  --focus: 0 0 0 3px rgba(21, 74, 63, .22);
  --shadow-sm: 0 1px 2px rgba(27, 36, 33, .05), 0 2px 8px rgba(27, 36, 33, .04);
  --shadow-md: 0 4px 14px rgba(27, 36, 33, .07), 0 1px 3px rgba(27, 36, 33, .05);
  --shadow-lg: 0 24px 60px rgba(15, 28, 24, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 72px;
  --sidebar-w: 232px;
  --ticket-w: 384px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", "Segoe UI Hebrew", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1412;
  --surface: #151e1b;
  --surface-2: #19231f;
  --sunken: #111916;
  --line: #26332e;
  --line-strong: #34443e;
  --ink: #e7eeeb;
  --ink-2: #b9c6c1;
  --muted: #86948e;
  --brand: #2f8a72;
  --brand-hover: #3a9a80;
  --brand-ink: #ffffff;
  --brand-soft: #1b3a32;
  --brand-text: #7fd0b6;
  --accent: #ef7882;
  --accent-soft: #3a1f23;
  --accent-text: #f4a1a8;
  --ok: #5cc092;
  --ok-soft: #173327;
  --warn: #e0ac55;
  --warn-soft: #362a14;
  --danger: #f07c86;
  --danger-soft: #3a1c20;
  --sidebar: #0a110f;
  --sidebar-2: #13201c;
  --sidebar-ink: #a9bcb6;
  --sidebar-muted: #6f8780;
  --focus: 0 0 0 3px rgba(127, 208, 182, .28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; touch-action: manipulation; }
button:active:not(:disabled) { transform: scale(.975); }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 0; box-shadow: var(--focus); }
input, select, textarea { color: var(--ink); }
strong, h1, h2, h3, h4 { font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- Brand ---------- */
.brand-mark { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; overflow: hidden; border-radius: 13px; background: radial-gradient(circle at 50% 36%, rgba(255,210,122,.42), transparent 58%), linear-gradient(145deg, #ef6f7b, #c63f4d 50%, #7e1f2c); color: #fff; box-shadow: inset 0 1px rgba(255,255,255,.35), 0 8px 20px rgba(198,63,77,.32); }
.brand-glyph { width: 100%; height: 100%; }
.brand-mark.big { width: 72px; height: 72px; border-radius: 22px; }
.brand-mark { overflow: visible; margin-right: 8px; }
.brand-mark::after { content: "\00AE"; position: absolute; top: -4px; right: -11px; color: currentColor; font-family: system-ui, -apple-system, sans-serif; font-size: 11px; font-weight: 800; line-height: 1; }
.brand-mark.big { margin-right: 0; }
.brand-mark.big::after { top: -4px; right: -17px; font-size: 16px; }
.auth-card .brand-mark::after { color: var(--ink); }
.brand-mark .brand-glyph { border-radius: inherit; }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); align-items: center; gap: 48px; padding: 32px max(32px, 6vw); background: radial-gradient(1200px 600px at 0% 0%, rgba(229,96,107,.18), transparent 60%), linear-gradient(150deg, #0d2621, #18483e); }
.auth-art { color: #e9f2ef; max-width: 520px; }
.auth-art h2 { margin: 26px 0 10px; font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.02em; }
.auth-art p { margin: 0 0 26px; color: #b7cdc6; font-size: 18px; line-height: 1.5; }
.auth-art ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.auth-art li { position: relative; padding-left: 30px; color: #d3e2dd; }
.auth-art li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(229,96,107,.25); color: #ffc3c8; font-size: 12px; font-weight: 800; }
.auth-card { width: 100%; padding: 36px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { margin: 6px 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.auth-copy { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.auth-form input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 16px; outline: 0; }
.auth-form input:focus { border-color: var(--brand); box-shadow: var(--focus); }
.auth-form .primary-button { width: 100%; min-height: 52px; margin-top: 4px; font-size: 16px; }
.full-width-button { width: 100%; }
.forgot-password-link { width: fit-content; margin: -4px 0 -2px auto; padding: 4px 0; font-size: 13px; }
.auth-switch { width: 100%; min-height: 44px; margin-top: 14px; font-size: 14px; }
#auth-loading { padding: 34px 0 20px; color: var(--muted); text-align: center; }
.auth-spinner { width: 34px; height: 34px; display: inline-block; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
#auth-loading p { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
#auth-loading small { display: block; margin-top: 6px; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell & sidebar ---------- */
.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: #fff; z-index: 30; overflow-y: auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 8px; border: 0; background: transparent; color: inherit; text-align: left; }
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { font-size: 14px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: var(--sidebar-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
#main-nav { display: grid; gap: 4px; }
.nav-item { position: relative; width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--sidebar-ink); font-size: 15px; font-weight: 600; text-align: left; }
.nav-item .ic { width: 22px; height: 22px; color: var(--sidebar-muted); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item b { margin-left: auto; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.active .ic { color: #ffb3b9; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 6px; }
.admin-button { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.admin-button .nav-label small { display: block; margin-top: 1px; color: #ffc6cb; font-size: 11px; font-weight: 700; }
.admin-button.admin-active { border-color: rgba(229,96,107,.5); background: rgba(229,96,107,.16); color: #ffd6da; }
.admin-button.admin-active .ic { color: #ffb3b9; }
.admin-button.expiring { animation: pulse-border 1.2s ease-in-out infinite; }
@keyframes pulse-border { 50% { border-color: rgba(255,200,120,.9); } }
.admin-extend { min-height: 34px; border: 1px dashed rgba(255,255,255,.25); border-radius: 10px; background: transparent; color: #ffd6da; font-size: 13px; font-weight: 700; }
.theme-toggle, .signout-button { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--sidebar-muted); font-size: 13px; font-weight: 600; text-align: left; }
.theme-toggle:hover, .signout-button:hover { background: rgba(255,255,255,.05); color: #fff; }
.theme-toggle .ic, .signout-button .ic { width: 19px; height: 19px; }
.cashier-chip { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.cashier-copy { min-width: 0; }
.cashier-chip strong, .cashier-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cashier-chip strong { font-size: 14px; }
.cashier-chip small { margin-top: 2px; color: var(--sidebar-muted); font-size: 12px; }
.avatar { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 800; }
.avatar.pale { background: var(--brand-soft); color: var(--brand-text); }
.sidebar .avatar { background: #f5dadd; color: #9d3540; }

/* ---------- Topbar ---------- */
.workspace { min-width: 0; min-height: 100vh; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
.topbar-title { min-width: 0; }
.topbar h1 { margin: 2px 0 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drawer-button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-sm); }
.drawer-button:hover { border-color: var(--line-strong); }
.drawer-button .ic { color: var(--brand-text); }
.scanner-badge, .status-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.scanner-badge { color: var(--muted); background: var(--sunken); }
.scanner-badge i, .status-badge i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.scanner-badge.scanning { color: var(--accent-text); background: var(--accent-soft); }
.scanner-badge.scanning i { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.status-badge { border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); background: var(--ok-soft); }
.status-badge.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); background: var(--warn-soft); }
.status-badge.warn i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.status-badge.error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); background: var(--danger-soft); }
.status-badge.error i { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.clock { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view { display: none; }
.view.active { display: block; animation: reveal .2s ease; }
@keyframes reveal { from { opacity: .3; transform: translateY(3px); } }

/* ---------- Buttons & shared controls ---------- */
.primary-button, .secondary-button, .discount-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.primary-button { border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 22%, transparent); }
.primary-button:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.secondary-button, .discount-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.secondary-button:hover:not(:disabled), .discount-button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-text); }
.secondary-button .ic, .discount-button .ic { color: var(--brand-text); }
.danger-action { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.danger-action:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.primary-button.danger-action { border-color: var(--danger); background: var(--danger); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--danger) 25%, transparent); }
.primary-button.danger-action:hover:not(:disabled) { filter: brightness(.94); background: var(--danger); color: #fff; }
.text-button { min-height: 36px; padding: 0 4px; border: 0; background: transparent; color: var(--brand-text); font-weight: 700; }
.danger-text { color: var(--danger) !important; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }
.count-pill { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; }
.search-box { flex: 1; min-width: 0; height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.search-box > span { color: var(--muted); font-size: 18px; }
.search-box .ic { color: var(--muted); }
.search-box input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-box.compact { max-width: 420px; }
.search-box input:focus { box-shadow: none; }
.toolbar, .section-toolbar { display: flex; align-items: center; gap: 12px; }
.section-toolbar { flex-wrap: wrap; justify-content: space-between; padding: 22px 26px 14px; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 10px; }
.section-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hint-line { margin: -4px 26px 14px; color: var(--muted); font-size: 13px; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 16px; background: var(--sunken); color: var(--muted); font-size: 22px; }
.empty-state > .ic { width: 44px; height: 44px; margin-bottom: 6px; padding: 10px; border-radius: 16px; background: var(--sunken); color: var(--muted); box-sizing: content-box; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state p { max-width: 300px; margin: 0; font-size: 14px; line-height: 1.45; }
.empty-state.compact { padding: 26px 12px; }
.status-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-pill.low { background: var(--warn-soft); color: var(--warn); }
.status-pill.out { background: var(--danger-soft); color: var(--danger); }
.up-pill, .report-period-label { padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 700; white-space: nowrap; }
.safe-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.safe-note > span:first-child { flex: 0 0 auto; font-weight: 800; color: var(--warn); }
.danger-note { background: var(--danger-soft); }
.danger-note > span:first-child { color: var(--danger); }
.info-banner { margin: 0 26px 26px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); font-size: 14px; }
.subnav, .settings-tabs { display: flex; gap: 6px; padding: 16px 26px 0; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar, .settings-tabs::-webkit-scrollbar { display: none; }
.subnav button, .settings-tabs button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 650; }
.subnav button.active, .settings-tabs button.active { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.subview, .order-subview { display: none; }
.subview.active, .order-subview.active { display: block; }

/* ---------- Register ---------- */
.register-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--ticket-w); min-height: calc(100vh - var(--topbar-h)); }
.catalog-pane { min-width: 0; padding: 18px 22px 32px; }
.toolbar { margin-bottom: 4px; }
.custom-item-button { min-height: 50px; padding: 0 18px; border-color: var(--line); }
.category-strip { position: sticky; top: var(--topbar-h); z-index: 12; display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 6px; margin: 0 -22px 14px; padding: 10px 22px; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.category-tabs { min-width: 0; display: flex; gap: 8px; padding: 2px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-behavior: smooth; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { flex: 0 0 auto; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 650; scroll-snap-align: start; box-shadow: var(--shadow-sm); }
.category-tabs button.active { border-color: var(--category-color); background: color-mix(in srgb, var(--category-color) 12%, var(--surface)); color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--category-color) 22%, transparent); }
.category-count { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.category-tabs button.active .category-count { background: color-mix(in srgb, var(--category-color) 20%, var(--surface)); color: var(--ink); }
.category-scroll-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.category-icon-tile { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--category-color) 16%, var(--surface)); color: var(--category-color); }
.category-icon-tile svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.category-label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.product-card { position: relative; min-height: 176px; overflow: hidden; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow-sm); }
.product-card:hover { border-color: color-mix(in srgb, var(--swatch) 70%, var(--line)); box-shadow: var(--shadow-md); }
.product-card.in-ticket { border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow-sm); }
.product-card.sold-out { opacity: .62; }
.product-card.sold-out .product-visual { filter: grayscale(.7); }
.product-card.just-added { animation: card-pop .32s ease; }
@keyframes card-pop { 40% { transform: scale(.96); } }
.product-visual { position: relative; height: 82px; display: grid; place-items: center; background: var(--swatch); }
.product-category-icon { position: relative; z-index: 1; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--swatch); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4), inset 0 1px rgba(255,255,255,.3), 0 8px 18px rgba(0,0,0,.22); }
.product-category-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-cell .product-category-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; box-shadow: none; }
.product-cell .product-category-icon svg { width: 20px; height: 20px; }
.product-card .copy { flex: 1; display: flex; flex-direction: column; padding: 10px 12px 12px; }
.product-card h3 { margin: 0; overflow: hidden; font-size: 15px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card .price-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; }
.product-card .price-line strong { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.stock-chip { padding: 3px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.stock-chip.low { background: var(--warn-soft); color: var(--warn); }
.stock-chip.out { background: var(--danger-soft); color: var(--danger); }
.sale-flag { position: absolute; z-index: 2; top: 8px; left: 8px; max-width: calc(100% - 50px); overflow: hidden; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.in-ticket-badge { position: absolute; z-index: 2; top: 8px; right: 8px; min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.was-price { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: line-through; }
.load-more-card { min-height: 120px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--brand-text); }
.load-more-card strong { font-size: 15px; }
.load-more-card span { color: var(--muted); font-size: 13px; }
.bottle { display: none; }

/* Ticket */
.ticket-pane { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); display: flex; flex-direction: column; overflow: hidden; padding: 16px 16px 14px; background: var(--surface); border-left: 1px solid var(--line); }
.sheet-head { display: none; }
.customer-ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 8px; margin-bottom: 10px; }
.customer-picker { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 11px; padding: 9px 12px 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); text-align: left; }
.customer-picker:hover { border-color: var(--brand); }
.customer-picker > span:nth-child(2) { min-width: 0; flex: 1; }
.customer-picker strong, .customer-picker small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-picker strong { font-size: 15px; }
.customer-picker small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.customer-picker .chevron { color: var(--muted); }
.trash-button { width: 54px; height: auto; color: var(--danger); }
.trash-button:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.ticket-lines { flex: 1; min-height: 120px; overflow-y: auto; margin: 0 -6px; padding: 2px 6px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ticket-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ticket-line.just-added { animation: line-flash .9s ease; }
@keyframes line-flash { 0% { background: var(--brand-soft); } 100% { background: transparent; } }
.ticket-line-main { min-width: 0; }
.ticket-item-name { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.ticket-line-main p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.ticket-line-price { font-size: 16px; font-weight: 750; text-align: right; white-space: nowrap; }
.ticket-line-price s { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.line-trash { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.line-trash:hover { background: var(--danger-soft); color: var(--danger); }
.line-trash .ic { width: 18px; height: 18px; }
.ticket-line-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.line-discount-link, .line-discount-chip { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.line-discount-link .ic { width: 16px; height: 16px; color: var(--muted); }
.line-discount-chip { border-style: solid; border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--accent-text); }
.qty-controls { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); }
.qty-controls button { width: 42px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--ink); }
.qty-controls button:hover { background: var(--sunken); }
.qty-controls .ic { width: 18px; height: 18px; }
.qty-input { width: 46px; height: 40px; padding: 0; border: 0; border-inline: 1px solid var(--line); background: transparent; font-size: 16px; font-weight: 750; text-align: center; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: 0; background: var(--brand-soft); }
.balance-item-qty { color: var(--muted); font-size: 13px; font-weight: 650; }
.ticket-empty { padding: 48px 16px; }
.ticket-tool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-top: 12px; }
.balance-picker-button { min-height: 44px; padding: 0 12px; font-size: 14px; }
.discount-button { min-height: 44px; padding: 0 14px; font-size: 14px; }
.ticket-summary { padding: 10px 2px 4px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--ink-2); font-size: 14px; }
.summary-row strong { color: var(--ink); }
.summary-row.discount, .summary-row.discount strong { color: var(--accent-text); }
.ticket-actions { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 8px; padding-top: 8px; padding-bottom: var(--safe-bottom); }
.ticket-actions .secondary-button { min-height: 62px; padding: 0 10px; font-size: 15px; white-space: normal; line-height: 1.15; }
.pay-button { min-height: 62px; justify-content: space-between; padding: 0 20px; border-radius: 14px; font-size: 18px; }
.pay-button strong { font-size: 22px; letter-spacing: -.01em; }
.mobile-ticket-bar { display: none; }

/* ---------- Tables, filters ---------- */
.table-card { margin: 0 26px 28px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-id] { cursor: pointer; }
tbody tr[data-id]:hover { background: var(--surface-2); }
tr.selected-row, .product-table-selected { background: var(--brand-soft) !important; }
.select-column { width: 46px; text-align: center; }
.select-column input, .product-select { width: 20px; height: 20px; accent-color: var(--brand); }
.product-cell, .customer-cell { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.product-cell strong, .customer-cell strong { display: block; font-size: 14px; }
.product-cell small, .customer-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.muted-cell { color: var(--muted); font-size: 13px; }
.table-tags, .product-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.product-tag, .product-tags span { padding: 3px 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); font-size: 12px; font-weight: 650; white-space: nowrap; }
.inventory-input { width: 82px; height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 700; }
.inventory-input:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus); }
.table-history-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--brand-text); font-size: 13px; font-weight: 700; white-space: nowrap; }
.load-more-row td { padding: 16px !important; text-align: center; }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 26px 12px; padding: 10px 12px 10px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 14px; }
.selection-bar > span { flex: 1; min-width: 180px; }
.selection-bar button { min-height: 40px; font-size: 14px; }
.filter-block { display: flex; align-items: center; gap: 10px; margin: 0 26px 10px; }
.filter-label { flex: 0 0 74px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tag-filter { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tag-filter::-webkit-scrollbar { display: none; }
.tag-filter button { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 650; }
.tag-filter button .category-icon-tile { width: 26px; height: 26px; flex-basis: 26px; margin-left: -7px; border-radius: 50%; }
.tag-filter button .category-icon-tile svg { width: 15px; height: 15px; }
.tag-filter button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.category-filter button.active { border-color: var(--category-color); background: color-mix(in srgb, var(--category-color) 12%, var(--surface)); color: var(--ink); }
.mini-swatch { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 4px; background: var(--swatch); }

/* ---------- Orders ---------- */
.order-groups, .closed-orders { display: grid; gap: 18px; padding: 0 26px 30px; }
.order-group { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.group-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.group-heading h3 { margin: 0; font-size: 17px; }
.group-heading small { color: var(--muted); font-size: 13px; }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.order-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 14px 50px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.order-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent); }
.order-card input[type=checkbox] { position: absolute; top: 14px; left: 14px; width: 24px; height: 24px; margin: 0; accent-color: var(--brand); }
.order-card h4 { margin: 0; font-size: 16px; }
.order-card .meta { color: var(--muted); font-size: 13px; }
.order-card .items { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.order-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-footer > strong { font-size: 19px; }
.order-card-actions { display: flex; gap: 6px; }
.order-card-actions button { min-height: 40px; padding: 0 14px; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-size: 14px; font-weight: 700; }
.order-card-actions .delete-order-button { border-color: var(--line-strong); background: var(--surface); color: var(--danger); }
.closed-orders { gap: 10px; }
.closed-order-card { display: grid; grid-template-columns: minmax(170px, .9fr) minmax(0, 1.6fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.closed-order-card h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.closed-order-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.closed-order-card.refunded { opacity: .7; }
.closed-order-card.partially-refunded { border-left: 4px solid var(--warn); }
.closed-items { color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.closed-total { font-size: 18px; font-weight: 750; text-align: right; white-space: nowrap; }
.closed-total small { display: block; color: var(--danger); font-size: 12px; font-weight: 650; }
.closed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.closed-actions .secondary-button { min-height: 42px; padding: 0 14px; font-size: 14px; }

/* ---------- Specials, data, team ---------- */
.specials-grid, .team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 0 26px 30px; }
.special-card, .team-card, .data-card, .detail-card, .report-card, .metric-card, .settings-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.special-card { display: grid; gap: 10px; padding: 18px; }
.special-card .topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.special-card h3 { margin: 4px 0 0; font-size: 18px; }
.special-card p { margin: 0; color: var(--muted); font-size: 14px; }
.special-card .dates { color: var(--ink-2); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px 26px 18px; }
.data-card { display: grid; gap: 10px; align-content: start; padding: 22px; }
.data-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand-text); }
.data-icon.coral { background: var(--accent-soft); color: var(--accent-text); }
.data-card h3 { margin: 4px 0 0; font-size: 18px; }
.data-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.data-card > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.team-card { position: relative; display: grid; gap: 12px; padding: 18px; }
.team-edit { position: absolute; top: 14px; right: 14px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--brand-text); font-size: 13px; font-weight: 700; }
.permission-list { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-list span { padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 650; }
.pin-line { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pin-line strong { color: var(--ink); }

/* ---------- Customers ---------- */
.customer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding: 0 26px 30px; align-items: start; }
.customer-layout .table-card { margin: 0; }
.balance-text { color: var(--warn); font-style: normal; font-weight: 700; }
.detail-card { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 20px; }
.detail-hero { display: flex; align-items: center; gap: 12px; }
.detail-hero .avatar { width: 50px; height: 50px; flex-basis: 50px; font-size: 16px; }
.detail-hero h3 { margin: 0; font-size: 19px; }
.detail-hero p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.detail-list { display: grid; margin: 16px 0; border-top: 1px solid var(--line); }
.detail-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-list span { color: var(--muted); }
.detail-list strong { text-align: right; overflow-wrap: anywhere; }
.customer-payment-history h4 { margin: 16px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.payment-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment-type-grid div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.payment-type-grid span, .payment-type-grid strong { display: block; }
.payment-type-grid span { color: var(--muted); font-size: 12px; }
.payment-type-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.customer-payment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.customer-payment-row strong, .customer-payment-row small { display: block; }
.customer-payment-row small { color: var(--muted); font-size: 12px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.detail-actions .primary-button { grid-column: 1 / -1; }
.detail-actions button { min-height: 46px; white-space: normal; line-height: 1.2; }

/* ---------- Reports ---------- */
.reports-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 22px 26px 16px; }
.reports-toolbar h2 { margin: 4px 0; font-size: 24px; letter-spacing: -.02em; }
.reports-toolbar p { margin: 0; color: var(--muted); font-size: 14px; }
.report-period-controls, .report-custom-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.report-period-controls label, .report-custom-range label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.report-period-controls select, .report-custom-range input { min-width: 170px; height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 15px; }
.report-custom-range > span { padding-bottom: 13px; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0 26px 16px; }
.metric-card { display: grid; gap: 4px; padding: 18px; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-card strong { font-size: 28px; letter-spacing: -.02em; }
.metric-card small { color: var(--muted); font-size: 13px; }
.metric-card:first-child { border-color: transparent; background: linear-gradient(145deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; }
.metric-card:first-child span, .metric-card:first-child small { color: rgba(255,255,255,.75); }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 26px 30px; }
.report-card { min-width: 0; padding: 18px; }
.report-sales-chart, .report-products { grid-column: 1 / -1; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-heading h3 { margin: 4px 0 0; font-size: 18px; }
.bar-chart { height: 220px; display: flex; align-items: flex-end; gap: 8px; padding-top: 20px; }
.bar-column { flex: 1; height: 100%; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-column em { color: var(--ink-2); font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.bar-column i { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--brand))); }
.bar-column span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.payment-report-row, .mix-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.payment-report-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.payment-report-row span { display: inline-flex; align-items: center; gap: 8px; }
.payment-report-row i { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.mix-row { margin-bottom: 12px; }
.mix-label span { color: var(--ink-2); }
.mix-track { height: 8px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--sunken); }
.mix-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.product-sales-head, .product-sales-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px 110px; gap: 12px; align-items: center; padding: 10px 4px; font-size: 14px; }
.product-sales-head { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.product-sales-row { border-bottom: 1px solid var(--line); }
.product-sales-head span:not(:first-child), .product-sales-row > *:not(:first-child) { text-align: right; }
.product-report-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-report-name b { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 8px; background: var(--sunken); color: var(--muted); font-size: 12px; }
.product-report-name strong, .product-report-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-report-name small { color: var(--muted); font-size: 12px; }
.stock-report-row, .activity-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stock-report-row > div, .activity-row > div { min-width: 0; flex: 1; }
.stock-report-row strong, .stock-report-row small, .activity-row strong, .activity-row small { display: block; }
.stock-report-row small, .activity-row small { color: var(--muted); font-size: 12px; }
.activity-row .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 13px; }
.report-empty, #low-stock-report { color: var(--muted); font-size: 14px; }

/* ---------- Settings ---------- */
.settings-tabs { padding-top: 20px; padding-bottom: 4px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; gap: 16px; padding: 16px 26px 34px; }
.settings-card { display: grid; gap: 12px; padding: 20px; }
.settings-card h3 { margin: 0 0 2px; font-size: 19px; letter-spacing: -.01em; }
.settings-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.settings-card label { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.settings-card label small { color: var(--muted); font-weight: 500; }
.settings-card input:not([type=checkbox]):not([type=color]), .settings-card select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 16px; outline: 0; }
.settings-card input:focus, .settings-card select:focus { border-color: var(--brand); box-shadow: var(--focus); }
.settings-card input:disabled { opacity: .55; }
.settings-card .eyebrow { color: var(--brand-text); }
.account-danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.account-danger-zone .eyebrow { color: var(--danger); }
.check-row { display: flex !important; align-items: center; gap: 10px !important; min-height: 40px; color: var(--ink) !important; font-size: 14px !important; font-weight: 600 !important; }
.check-row input, .check-label input { width: 22px; height: 22px; accent-color: var(--brand); }
.check-label { display: flex !important; align-items: center; gap: 10px; font-size: 14px; }
.toggle-row { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.toggle-row span { min-width: 0; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { color: var(--ink); font-size: 14px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.toggle-row input { -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 50px; width: 50px; height: 30px; margin: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background .18s; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.toggle-row input:checked { background: var(--ok); }
.toggle-row input:checked::after { transform: translateX(20px); }
.toggle-row input:disabled { opacity: .45; cursor: not-allowed; }
.setting-readout { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.setting-readout span { color: var(--muted); }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; }
.connection-row strong, .connection-row small { display: block; }
.connection-row strong { font-size: 14px; }
.connection-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.connection-row button { min-height: 40px; font-size: 13px; }
.storage-stat { display: flex; align-items: baseline; gap: 8px; }
.storage-stat strong { font-size: 34px; letter-spacing: -.02em; }
.storage-stat span { color: var(--muted); }
.update-status { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-size: 13px; font-weight: 650; }
.app-update-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.barcode-preview { display: grid; justify-items: center; gap: 6px; padding: 14px; border-radius: 12px; background: #fff; color: #000; }
.barcode-preview svg { max-width: 100%; height: 70px; }
.barcode-download { width: 100%; }

/* ---------- Modals ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 20, 17, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal { width: min(100%, 520px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); animation: modal-in .2s cubic-bezier(.2,.9,.3,1.2); }
.modal.large { width: min(100%, 820px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.01em; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 22px; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .text-button { margin-right: auto; }
.modal-search { margin-bottom: 14px; }
.stacked-form, .form-grid { display: grid; gap: 14px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.stacked-form label, .form-grid label, .refund-quantity { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.stacked-form input:not([type=checkbox]):not([type=color]), .stacked-form select, .stacked-form textarea, .form-grid input:not([type=checkbox]):not([type=color]), .form-grid select, .form-grid textarea, .custom-item-grid input, .refund-quantity input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 16px; outline: 0; }
.stacked-form textarea, .form-grid textarea { padding: 12px 13px; resize: vertical; }
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .custom-item-grid input:focus { border-color: var(--brand); box-shadow: var(--focus); }
input[type=color] { width: 100%; height: 48px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); }
.money-field { position: relative; display: flex; align-items: center; }
.money-field b { position: absolute; left: 13px; color: var(--muted); font-weight: 700; }
.money-field input { padding-left: 30px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-message, .form-error { min-height: 1em; margin: 0; color: var(--ok); font-size: 14px; }
.form-message.error, .form-error { color: var(--danger); }
.choice-list { display: grid; gap: 8px; }
.choice-card { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: left; }
.choice-card:hover { border-color: var(--brand); background: var(--surface-2); }
.choice-card > span:nth-child(2) { min-width: 0; flex: 1; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: 15px; }
.choice-card small { margin-top: 2px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.choice-card b, .choice-card .chevron { color: var(--muted); }
.selected-choice { border-color: var(--brand); background: var(--brand-soft); }
.selector-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.selector-pills label { display: inline-flex !important; align-items: center; gap: 8px !important; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink) !important; font-size: 14px !important; font-weight: 600 !important; cursor: pointer; }
.selector-pills label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.selector-pills input { width: 18px; height: 18px; accent-color: var(--brand); }
.product-tag-selector { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.product-tag-selector legend { padding: 0 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.product-tag-selector small { color: var(--muted); font-size: 12px; font-weight: 500; }
.product-tag-selector p { margin: 0; color: var(--muted); font-size: 14px; }
.product-editor-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.product-editor-visual { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 15px; background: var(--swatch); box-shadow: inset 0 1px rgba(255,255,255,.3); }
.product-editor-hero h3 { margin: 0; font-size: 17px; }
.product-editor-hero p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.custom-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.custom-item-grid label { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.custom-item-price { grid-column: 1 / -1; }
.custom-item-price input { min-height: 64px !important; font-size: 28px !important; }
.selected-line-summary { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.category-manager { display: grid; gap: 8px; margin-top: 16px; }
.category-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.category-row strong, .category-row small { display: block; }
.category-row small { color: var(--muted); font-size: 12px; }
.category-row div { display: flex; flex-wrap: wrap; gap: 6px; }
.category-row button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 650; }
.category-icon-form { display: grid; gap: 8px; }
.category-icon-setting { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 12px !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.category-setting-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.category-setting-name i { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--category-color) 16%, var(--surface)); color: var(--category-color); }
.category-setting-name svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.category-icon-form strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.category-setting-controls { display: grid !important; grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; }
.category-icon-form select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.category-setting-controls input[type=color] { width: 52px; height: 42px; }
.history-metrics, .customer-order-summary-clean, .refund-order-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.refund-order-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.history-metrics div, .customer-order-summary-clean div, .refund-order-summary span { display: grid; gap: 3px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.history-metrics strong, .customer-order-summary-clean strong, .refund-order-summary strong { color: var(--ink); font-size: 18px; overflow-wrap: anywhere; }
.history-heading { margin: 8px 0; font-size: 16px; }
.product-history-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.product-history-row span:last-child { text-align: right; }
.product-history-row strong, .product-history-row small { display: block; }
.product-history-row small { color: var(--muted); font-size: 12px; }
.customer-order-table-clean { display: grid; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.customer-order-table-clean-head, .customer-order-row-clean { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; }
.customer-order-table-clean-head { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.customer-order-row-clean { border-top: 1px solid var(--line); }
.customer-order-row-clean:has(input:checked) { background: var(--brand-soft); }
.order-checkbox-clean input { width: 24px; height: 24px; accent-color: var(--brand); }
.customer-order-info-clean strong, .customer-order-info-clean span { display: block; }
.customer-order-info-clean span { color: var(--muted); font-size: 12px; }
.customer-order-info-clean p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.customer-order-amount-clean { font-size: 17px; }
.edit-customer-order-clean { min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--brand-text); font-weight: 700; }
.customer-order-instruction, .refund-help { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.refund-item-list { display: grid; gap: 8px; }
.refund-item-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.refund-item-row:has(input[type=checkbox]:checked) { border-color: var(--brand); background: var(--brand-soft); }
.refund-item-check { display: flex; align-items: center; gap: 12px; }
.refund-item-check input { width: 22px; height: 22px; accent-color: var(--brand); }
.refund-item-check strong, .refund-item-check small { display: block; }
.refund-item-check small { color: var(--muted); font-size: 12px; }
.delete-open-order-summary, .delete-account-summary { display: grid; gap: 4px; margin-bottom: 14px; padding: 14px; border-radius: 12px; background: var(--danger-soft); }
.delete-open-order-summary p, .delete-account-summary span { margin: 0; color: var(--ink-2); font-size: 13px; }
.import-preview { display: grid; gap: 7px; margin: 15px 0; padding: 0; list-style: none; }
.import-preview li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.import-preview strong { color: var(--ink); }
.processor-checklist { display: grid; gap: 6px; margin: 14px 0; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.saved-card-confirm { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 16px; border-radius: 14px; background: linear-gradient(140deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000)); color: #fff; }
.saved-card-confirm > span { font-size: 26px; }
.saved-card-confirm strong, .saved-card-confirm small { display: block; }
.saved-card-confirm small { opacity: .8; }
.expiry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ifield-shell { height: 48px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; }
.ifield-shell iframe { width: 100%; height: 48px; border: 0; display: block; }
.ifield-shell.compact { max-width: 200px; }
.ifield-shell.stripe-card-shell { height: auto; min-height: 48px; padding: 14px 12px; box-sizing: border-box; overflow: visible; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.checkout-summary { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); align-self: start; }
.checkout-summary h3 { margin: 0; font-size: 16px; }
.checkout-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.checkout-item small, .checkout-discount { display: block; color: var(--accent-text); font-size: 12px; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; font-weight: 800; }
.checkout-total strong { font-size: 26px; letter-spacing: -.02em; }
.source-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.source-tags span { padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.payment-options { display: grid; gap: 10px; align-content: start; }
.payment-option { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; box-shadow: var(--shadow-sm); }
.payment-option:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent); }
.payment-option i { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 13px; background: var(--ok-soft); color: var(--ok); font-size: 20px; font-style: normal; font-weight: 800; }
.payment-option.credit i { background: var(--accent-soft); color: var(--accent-text); }
.payment-option span { min-width: 0; flex: 1; }
.payment-option strong, .payment-option small { display: block; }
.payment-option strong { font-size: 17px; }
.payment-option small { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.payment-option b { color: var(--muted); font-size: 22px; }
.cash-tender-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.cash-tender-grid button { min-height: 60px; display: grid; place-content: center; gap: 1px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cash-tender-grid button small { color: var(--brand-text); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cash-tender-grid button:hover { border-color: var(--brand); background: var(--brand-soft); }
.change-readout { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.change-readout strong { font-size: 26px; letter-spacing: -.02em; }
#cash-tender-form .money-field input, #check-tender-form .money-field input { min-height: 62px; font-size: 26px; }
.success-view { padding: 34px 26px 28px; text-align: center; overflow-y: auto; }
.success-icon { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 36px; font-weight: 800; box-shadow: 0 0 0 10px var(--ok-soft); animation: pop .35s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.success-view h2 { margin: 8px 0 4px; font-size: 26px; }
.success-view > p { margin: 0 0 6px; color: var(--muted); }
.success-amount { margin: 6px 0 16px; font-size: 44px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.success-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 460px; margin: 0 auto; }
.success-actions button { min-height: 54px; }
.offline-confirmation { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 700; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(400px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-radius: 14px; background: #183d35; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.4; pointer-events: auto; animation: toast-in .22s cubic-bezier(.2,.9,.3,1.2); }
.toast.warn { background: #6e4a1f; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-icon { color: #9fe0c4; }
.toast.warn .toast-icon { color: #ffd38a; }
.toast-text { flex: 1; min-width: 0; }
.toast-action { min-height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 9px; background: rgba(255,255,255,.12); color: #fff; font-size: 14px; font-weight: 800; }
.toast-close { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.7); }
.toast-close .ic { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Thermal receipt print ---------- */
#print-receipt { display: none; }
.thermal-receipt { width: 3in; padding: .14in .12in .2in; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 1.28; }
.thermal-center { text-align: center; }
.thermal-store { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.thermal-address { margin: 4px 0 0; font-size: 11px; line-height: 1.35; }
.thermal-phone { margin: 4px 0 0; font-size: 13px; font-weight: 800; }
.thermal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.thermal-meta span:nth-child(even) { text-align: right; }
.thermal-rule { height: 2px; margin: 12px 0; background: #000; }
.thermal-heading { margin: 0 0 14px; font-size: 13px; font-weight: 800; }
.thermal-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin: 6px 0; }
.thermal-line span:last-child { text-align: right; white-space: nowrap; }
.thermal-sku { display: block; color: #333; font-size: 9px; }
.thermal-totals .thermal-line { margin: 5px 0; font-size: 13px; }
.thermal-totals .total { font-size: 16px; font-weight: 900; }
@page { size: 3in 11in; margin: 0; }
@media print {
  html, body { width: 3in; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body > *:not(#print-receipt) { display: none !important; }
  #print-receipt { display: block !important; width: 3in; margin: 0; padding: 0; }
  .thermal-receipt { width: 3in; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Large desktop */
@media (min-width: 1500px) {
  :root { --ticket-w: 420px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
}

/* iPad landscape & small laptops: labeled icon rail */
@media (max-width: 1279px) {
  :root { --sidebar-w: 92px; --ticket-w: 340px; }
  .sidebar { padding: 14px 8px 12px; gap: 10px; }
  .brand { justify-content: center; padding: 2px 0 6px; }
  .brand-copy, .cashier-copy { display: none; }
  .nav-item, .theme-toggle, .signout-button { min-height: 62px; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 2px; font-size: 11.5px; font-weight: 650; text-align: center; }
  .nav-label { max-width: 100%; }
  .nav-item b { position: absolute; top: 5px; right: 12px; min-width: 20px; padding: 2px 5px; font-size: 11px; }
  .nav-item.active { box-shadow: none; }
  .theme-toggle, .signout-button { min-height: 52px; }
  .admin-button .nav-label small { font-size: 10px; }
  .admin-extend { font-size: 12px; }
  .cashier-chip { justify-content: center; padding: 8px 0 0; }
  .settings-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .closed-order-card { grid-template-columns: minmax(0, 1fr) auto; }
  .closed-items { grid-column: 1 / -1; grid-row: 2; }
  .closed-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .closed-total { grid-column: 2; grid-row: 1; }
}

@media (max-width: 1180px) {
  .topbar-actions .btn-label { display: none; }
  .drawer-button { width: 46px; padding: 0; justify-content: center; }
  .customer-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* iPad portrait */
@media (max-width: 1000px) {
  :root { --ticket-w: 310px; }
  .catalog-pane { padding: 14px 14px 28px; }
  .category-strip { margin-inline: -14px; padding-inline: 14px; grid-template-columns: minmax(0, 1fr); }
  .category-scroll-button { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .custom-item-button { width: 54px; padding: 0; font-size: 0; gap: 0; }
  .custom-item-button .ic { width: 22px; height: 22px; }
  .ticket-pane { padding: 12px 12px 12px; }
  .ticket-tool-row { grid-template-columns: 1fr 1fr; }
  .clock, .scanner-badge { display: none; }
  .customer-layout { grid-template-columns: 1fr; }
  .detail-card { position: static; }
  .import-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}

/* Phones: bottom tab bar + ticket sheet */
@media (max-width: 700px) {
  :root { --topbar-h: 60px; --tabbar-h: 66px; }
  .app-shell { display: block; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
  .sidebar { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-bottom)); flex-direction: row; gap: 0; padding: 4px 4px var(--safe-bottom); overflow: visible; border-top: 1px solid rgba(255,255,255,.08); }
  .brand, .theme-toggle, .signout-button, .cashier-chip, .admin-extend { display: none !important; }
  #main-nav { flex: 1; display: flex; gap: 0; }
  #main-nav .nav-item { flex: 1; min-width: 0; }
  .sidebar-bottom { margin: 0; display: flex; flex: 0 0 auto; }
  .nav-item, .admin-button { min-height: 58px; padding: 4px 2px; border-radius: 12px; font-size: 11px; }
  .admin-button { width: 70px; border: 0; background: transparent; }
  .admin-button.admin-active { background: rgba(229,96,107,.16); }
  .nav-item b { right: calc(50% - 22px); }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow { font-size: 10px; }
  .status-badge { max-width: 132px; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; font-size: 12px; }
  .drawer-button { width: 42px; min-height: 40px; }
  .register-layout { display: block; min-height: 0; }
  .catalog-pane { padding: 12px 12px calc(84px + var(--safe-bottom)); }
  .toolbar { gap: 8px; }
  .search-box { height: 48px; }
  .category-tabs button { min-height: 42px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-card { min-height: 160px; }
  .product-visual { height: 70px; }
  .product-category-icon { width: 44px; height: 44px; border-radius: 13px; }
  .product-category-icon svg { width: 24px; height: 24px; }

  .ticket-pane { position: fixed; z-index: 60; left: 0; right: 0; top: auto; bottom: 0; height: min(88dvh, calc(100dvh - 40px)); padding: 6px 14px 12px; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
  body.ticket-open .ticket-pane { transform: translateY(0); }
  body.ticket-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(10,20,17,.45); }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 10px; }
  .sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--line-strong); }
  .sheet-head strong { font-size: 18px; }
  .sheet-head strong span { color: var(--muted); font-weight: 600; }
  .ticket-actions { padding-bottom: calc(6px + var(--safe-bottom)); }

  .mobile-ticket-bar { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); min-height: 58px; display: none; align-items: center; gap: 12px; padding: 0 16px 0 10px; border: 0; border-radius: 16px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
  body[data-view="register"] .mobile-ticket-bar { display: flex; }
  .mobile-ticket-bar:not(.has-items) { background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .mobile-ticket-bar.bump { animation: card-pop .3s ease; }
  .mtb-count { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 8px; border-radius: 11px; background: rgba(255,255,255,.18); font-size: 16px; }
  .mobile-ticket-bar:not(.has-items) .mtb-count { background: var(--sunken); }
  .mtb-label { flex: 1; text-align: left; }
  .mobile-ticket-bar strong { font-size: 19px; }

  .section-toolbar { padding: 14px 12px 10px; }
  .search-box.compact { max-width: none; flex-basis: 100%; }
  .toolbar-group { width: 100%; }
  .toolbar-group button { flex: 1; padding: 0 10px; }
  .subnav, .settings-tabs { padding-inline: 12px; }
  .hint-line { margin-inline: 12px; }
  .selection-bar, .filter-block { margin-inline: 12px; }
  .filter-label { display: none; }
  .table-card { margin-inline: 12px; }
  .order-groups, .closed-orders, .specials-grid, .team-grid, .customer-layout { padding-inline: 12px; }
  .orders-grid { grid-template-columns: 1fr; }
  .import-grid, .metric-grid, .report-grid, .settings-grid { padding-inline: 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .reports-toolbar { margin-inline: 12px; }
  .report-period-controls, .report-period-controls label, .report-period-controls select { width: 100%; }
  .metric-card strong { font-size: 22px; }
  .info-banner { margin-inline: 12px; }
  .product-sales-head, .product-sales-row { grid-template-columns: minmax(0, 1fr) 54px 84px; }
  .product-sales-head span:nth-child(3), .product-sales-row > span:nth-child(3) { display: none; }
  .bar-column em { display: none; }

  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.large { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; animation: sheet-in .25s cubic-bezier(.2,.8,.2,1); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  .modal-head { padding: 16px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + var(--safe-bottom)); }
  .modal-foot button { flex: 1; }
  .checkout-layout, .form-grid, .custom-item-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .history-metrics, .customer-order-summary-clean { grid-template-columns: 1fr 1fr; }
  .refund-order-summary { grid-template-columns: 1fr; }
  .refund-item-row { grid-template-columns: 1fr; }
  .customer-order-table-clean-head { display: none; }
  .customer-order-row-clean { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .edit-customer-order-clean { grid-column: 2 / -1; justify-self: start; }
  .category-icon-setting { grid-template-columns: 1fr; }
  .success-actions { grid-template-columns: 1fr; }
  .success-amount { font-size: 38px; }
  .toast-stack { left: 10px; right: 10px; bottom: auto; top: calc(10px + env(safe-area-inset-top, 0px)); width: auto; }
}

@media (max-width: 380px) {
  .nav-item, .admin-button { font-size: 10px; }
  .admin-button { width: 60px; }
  .status-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 480px); justify-content: center; padding: 20px; }
  .auth-art { display: none; }
  .auth-card { padding: 28px 22px; }
}

/* refinements */
.ticket-tool-row button { min-width: 0; white-space: normal; line-height: 1.15; text-align: left; }
.signout-button { color: #9fb8b0; }
@media (max-width: 700px) {
  .topbar .eyebrow { display: none; }
  .status-badge { width: 34px; min-height: 34px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .status-badge i { width: 10px; height: 10px; flex-basis: 10px; }
}

/* iPad Home Screen install */
.install-guide { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.install-guide-icon { flex: 0 0 72px; border-radius: 16px; box-shadow: var(--shadow-md); }
.install-guide .section-copy { margin: 0; }
.install-steps { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: install-step; }
.install-steps li { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 54px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); counter-increment: install-step; }
.install-steps li::before { content: counter(install-step); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 14px; }
.install-steps small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.install-share-glyph { display: inline-block; width: 20px; height: 20px; margin-left: 4px; vertical-align: -4px; fill: none; stroke: #0a84ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-banner { position: fixed; z-index: 150; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 24px)); padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); animation: toast-in .22s cubic-bezier(.2,.9,.3,1.2); }
.install-banner img { flex: 0 0 36px; border-radius: 9px; }
.install-banner > span { flex: 1; display: grid; gap: 1px; min-width: 0; font-size: 14px; }
.install-banner small { color: var(--muted); font-size: 12px; }
.install-banner .secondary-button { width: auto; min-height: 40px; margin: 0; padding: 0 14px; white-space: nowrap; }
.install-banner .icon-button { flex: 0 0 auto; }
@media print { .install-banner { display: none; } }
.card-entry-form .card-field { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.card-entry-form .card-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-entry-form .card-box { min-height: 50px; padding: 15px 14px; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; }
.card-entry-form .card-box.StripeElement--focus { border-color: #1d2a26; box-shadow: 0 0 0 3px rgba(29, 42, 38, .12); }
.card-entry-form .card-box.StripeElement--invalid { border-color: #b42318; }
.card-entry-form .card-box input { all: unset; width: 100%; font-size: 17px; color: #8a948f; }
.card-entry-form .card-box input::placeholder { color: #8a948f; }
@media (max-width: 420px) { .card-entry-form .card-field-row { grid-template-columns: 1fr; } }

/* POS subscription: price on signup and the subscribe screen */
.plan-price { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); }
.plan-price strong { font-size: 28px; letter-spacing: -.02em; }
.plan-price span { font-weight: 700; }
.plan-price small { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
#auth-billing-panel .plan-price { margin-bottom: 14px; }
.auth-form .agree-check { grid-template-columns: 22px 1fr; align-items: start; gap: 10px; font-weight: 600; line-height: 1.45; }
.auth-form .agree-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }

/* POS subscription card and statements */
.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.billing-actions .secondary-button { flex: 1 1 auto; }
.billing-actions #billing-cancel { color: var(--danger); }
.billing-actions .text-button { margin-right: 0; }
.statement-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.statement-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.statement-list li:last-child { border-bottom: 0; }
.statement-list small { color: var(--muted); }
.statement-list .links { grid-column: 1 / -1; display: flex; gap: 14px; }
.statement-list .links a { color: var(--brand-text); font-weight: 700; text-decoration: none; }
.statement-status { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.statement-status.paid { background: var(--ok-soft, #e2f3ea); color: var(--ok); }
.statement-status.open { background: var(--warn-soft, #fdf1d8); color: var(--warn, #9a6a00); }
