:root {
  /* Light appearance */
  --brand: #0071e3;
  --brand-dark: #0062c4;
  --brand-soft: rgb(0 113 227 / 10%);
  --accent: #ff9f0a;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --fill: rgb(120 120 128 / 12%);
  --fill-strong: rgb(120 120 128 / 20%);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgb(0 0 0 / 8%);
  --border-strong: rgb(0 0 0 / 16%);
  --input-border: #d2d2d7;
  --glass: rgb(255 255 255 / 72%);
  --glass-sidebar: rgb(246 246 248 / 80%);
  --ok: #248a3d;
  --ok-soft: rgb(52 199 89 / 14%);
  --ok-text: #1a6b2f;
  --warn: #b25000;
  --warn-soft: rgb(255 159 10 / 16%);
  --warn-text: #8a4300;
  --danger: #d70015;
  --danger-dark: #b00012;
  --danger-soft: rgb(255 59 48 / 12%);
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 1px rgb(0 0 0 / 3%), 0 4px 14px rgb(0 0 0 / 5%);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 4%), 0 14px 34px rgb(0 0 0 / 10%);
  --ring: 0 0 0 4px rgb(0 113 227 / 28%);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.008em;
  color: var(--text);
  background: var(--bg);
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #0a84ff;
    --brand-dark: #409cff;
    --brand-soft: rgb(10 132 255 / 18%);
    --bg: #000000;
    --panel: #1c1c1e;
    --panel-2: #232325;
    --fill: rgb(120 120 128 / 24%);
    --fill-strong: rgb(120 120 128 / 36%);
    --text: #f5f5f7;
    --muted: #98989d;
    --border: rgb(255 255 255 / 9%);
    --border-strong: rgb(255 255 255 / 18%);
    --input-border: rgb(255 255 255 / 16%);
    --glass: rgb(22 22 24 / 72%);
    --glass-sidebar: rgb(28 28 30 / 78%);
    --ok: #30d158;
    --ok-soft: rgb(48 209 88 / 16%);
    --ok-text: #4cd964;
    --warn: #ff9f0a;
    --warn-soft: rgb(255 159 10 / 18%);
    --warn-text: #ffb340;
    --danger: #ff453a;
    --danger-dark: #ff6961;
    --danger-soft: rgb(255 69 58 / 18%);
    --shadow: 0 0 0 1px rgb(255 255 255 / 6%);
    --shadow-lift: 0 0 0 1px rgb(255 255 255 / 10%), 0 16px 40px rgb(0 0 0 / 50%);
    --ring: 0 0 0 4px rgb(10 132 255 / 38%);
  }
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 0.75rem; }
h3 { font-size: 1rem; }
code.secret { font-size: 1.1rem; letter-spacing: 0.05em; background: var(--brand-soft); padding: 2px 6px; border-radius: 6px; }
.boot { padding: 2rem; color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong, .strong td { font-weight: 700; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }

/* ---------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  padding: 0.55rem 0.95rem; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); background: var(--fill); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-lg { padding: 0.8rem 1.3rem; font-size: 1.05rem; font-weight: 600; }
.btn-block { width: 100%; }
.icon-btn { border: 1px solid var(--border); background: var(--panel); border-radius: 6px; width: 2rem; height: 2rem; cursor: pointer; font: inherit; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; padding: 0; font: inherit; }
.link-btn.danger { color: var(--danger); }

.form { display: grid; gap: 0.85rem; }
.form label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; }
.form.inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.span-2 { grid-column: span 2; }
input, select, textarea {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label.checkbox { display: flex !important; align-items: center; gap: 0.5rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 1rem; }
.filters label { display: grid; gap: 0.25rem; font-size: 0.85rem; }
.filter-input { width: 100%; max-width: 360px; margin-bottom: 0.75rem; }

/* ---------------------------------------------------------------- badges, callouts, toasts */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; background: var(--fill); color: var(--muted); text-decoration: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.callout { padding: 0.8rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.callout-warn { background: var(--warn-soft); color: var(--warn-text); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 100; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: 0.75rem 1rem; border-radius: 8px; background: var(--text); color: #fff; box-shadow: var(--shadow); }
.toast-success { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warn); }

/* ---------------------------------------------------------------- auth */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-brand { background: linear-gradient(150deg, var(--brand), #1e1b4b); color: #e0e7ff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.auth-brand .logo { font-size: 2.4rem; color: #fff; }
.auth-brand ul { line-height: 2; padding-left: 1.2rem; }
.auth-panel { padding: 3rem; display: flex; flex-direction: column; justify-content: center; max-width: 480px; width: 100%; margin: 0 auto; gap: 1rem; }
.logo { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: #1e1b4b; color: #c7d2fe; padding: 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { color: #fff; padding: 0 0.6rem 1rem; }
.nav-link { display: flex; gap: 0.6rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 8px; color: inherit; text-decoration: none; }
.nav-link:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 0.5rem; padding: 0.6rem; font-size: 0.85rem; }
.sidebar-footer .who { display: grid; }
.sidebar-footer .who span { color: #a5b4fc; }
.sidebar-footer .link-btn { color: #c7d2fe; text-align: left; }
.main { min-width: 0; display: flex; flex-direction: column; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.mobile-bar { display: none; }
.statusbar { display: flex; gap: 1rem; justify-content: flex-end; padding: 0.35rem 1.25rem; font-size: 0.8rem; color: var(--ok); background: var(--panel); border-bottom: 1px solid var(--border); }
.statusbar-offline { color: var(--warn-text); background: var(--warn-soft); }
.view { padding: 1.25rem; flex: 1; min-width: 0; }
.page-header { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------------------------------------------------------------- tables & cards */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); background: var(--panel-2); }
.table.compact th, .table.compact td { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
.table th.num, .table td.num { text-align: right; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--brand-soft); }
.row-warn { background: var(--warn-soft); }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card h2 { margin-top: 0; }
.card .table { box-shadow: none; }
.cards { align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.stat { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.9rem 1rem; display: grid; gap: 0.25rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat strong { font-size: 1.25rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tab { padding: 0.6rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.list { display: grid; gap: 0.35rem; }
.list-item { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); text-align: left; font: inherit; cursor: pointer; }
button.list-item:hover { border-color: var(--brand); }
.location-block { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.location-block ul { margin: 0.4rem 0; }
.steps { line-height: 1.8; }

/* ---------------------------------------------------------------- plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.plan { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.plan h3 { margin: 0; font-size: 1.2rem; }
.plan ul { padding-left: 1.1rem; flex: 1; }
.plan .price { font-size: 1.5rem; font-weight: 700; margin: 0.25rem 0; }
.plan .price small { font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.plan-current { outline: 2px solid var(--brand); }

/* ---------------------------------------------------------------- point of sale */
.pos { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; height: calc(100vh - 4.5rem); }
.pos-products { display: flex; flex-direction: column; gap: 0.75rem; min-height: 0; }
.pos-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pos-toolbar select { flex: 0 1 auto; min-width: 0; }
.pos-products, .pos-cart { min-width: 0; }
.pos-toolbar input { flex: 1 1 220px; font-size: 1.05rem; }
.register-status { display: flex; gap: 0.75rem; align-items: center; min-height: 1.5rem; font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 0.35rem 0.85rem; cursor: pointer; font: inherit; }
.chip-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; overflow-y: auto; align-content: start; padding-bottom: 1rem; }
.product-tile { display: grid; gap: 0.3rem; text-align: left; padding: 0.85rem; min-height: 96px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); cursor: pointer; font: inherit; box-shadow: var(--shadow); }
.product-tile:hover { border-color: var(--brand); }
.product-tile:active { transform: scale(0.98); }
.product-name { font-weight: 600; }
.product-price { color: var(--brand); font-weight: 700; }
.product-stock { font-size: 0.78rem; color: var(--muted); }
.product-stock.low { color: var(--danger); }
.pos-cart { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.cart-customer { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.customer-pill { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cart-lines { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem; }
.cart-empty { text-align: center; margin-top: 2rem; }
.cart-line { padding: 0.55rem 0; border-bottom: 1px dashed var(--border); display: grid; gap: 0.35rem; }
.cart-line-main { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 500; }
.cart-line-controls { display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; flex-wrap: wrap; }
.cart-totals { padding: 0.75rem; border-top: 1px solid var(--border); display: grid; gap: 0.25rem; }
.cart-totals div { display: flex; justify-content: space-between; }
.cart-totals .grand { font-size: 1.3rem; font-weight: 800; margin-top: 0.25rem; }
.cart-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem; padding: 0.75rem; }
.checkout { display: grid; gap: 1rem; }
.checkout-remaining { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.checkout-remaining strong { font-size: 1.6rem; }
.method-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stock-rows { max-height: 50vh; overflow-y: auto; display: grid; gap: 0.35rem; }
.stock-row { display: grid !important; grid-template-columns: 1fr 120px; align-items: center; font-weight: 400 !important; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgb(15 23 42 / 50%); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal { background: var(--panel); border-radius: 14px; width: min(480px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: 0 20px 60px rgb(0 0 0 / 25%); }
.modal-wide { width: min(760px, 100%); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.modal-header h2 { margin: 0; }
.modal-body { padding: 1.25rem; display: grid; gap: 1rem; }

/* ---------------------------------------------------------------- receipt */
.receipt { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9rem; max-width: 340px; margin: 0 auto; text-align: center; }
.receipt h3 { margin: 0 0 0.25rem; }
.receipt p { margin: 0.25rem 0; }
.receipt table { width: 100%; border-collapse: collapse; margin: 0.6rem 0; text-align: left; }
.receipt td { padding: 0.15rem 0; vertical-align: top; }
.receipt-totals { border-top: 1px dashed var(--muted); }

/* ---------------------------------------------------------------- responsive */
/* ---------------------------------------------------------------- cart tools, open bills, cash count */
.cart-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); }
.cart-tools .chip { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
.held-pill { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--warn-soft); color: var(--warn-text); font-size: 0.9rem; }
.service-toggle { font-weight: 400; gap: 0.35rem; }
.denominations { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.denomination { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 0.4rem; font-weight: 400 !important; }
.denomination span { min-width: 3.5rem; text-align: right; color: var(--muted); }

/* ---------------------------------------------------------------- products: variants, labels */
.variant-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr 0.8fr; gap: 0.4rem; margin-bottom: 0.4rem; }
.variant-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
.label { border: 1px dashed var(--border); border-radius: 6px; padding: 0.4rem; text-align: center; display: grid; justify-items: center; gap: 0.15rem; break-inside: avoid; }
.label svg { max-width: 100%; height: auto; }
.label-name { font-size: 0.8rem; font-weight: 600; line-height: 1.2; }
.label-code { font-family: ui-monospace, monospace; font-size: 0.75rem; }
.label-price { font-weight: 700; }
@media print { .label { border-color: #ccc; } }

/* ---------------------------------------------------------------- restaurant */
.chip-accent { background: var(--accent); border-color: var(--accent); color: #1f1300; font-weight: 600; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
.table-tile { display: grid; gap: 0.15rem; padding: 0.8rem 0.5rem; border: 2px solid var(--ok); border-radius: 12px; background: var(--ok-soft); color: var(--ok); font: inherit; cursor: pointer; text-align: center; }
.table-tile strong { font-size: 1.15rem; color: var(--text); }
.table-busy { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.table-current { outline: 3px solid var(--brand); }
.modifier-group { border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0; }
.modifier-group legend { font-weight: 600; padding: 0 0.3rem; }
.modifier-option { display: grid !important; grid-template-columns: auto 1fr auto; gap: 0.5rem; padding: 0.35rem 0; font-weight: 400 !important; }
.option-links { border: 1px solid var(--border); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.option-row { grid-template-columns: 2fr 1fr !important; }
.kitchen-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; align-items: start; }
.kitchen-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.75rem; display: grid; gap: 0.5rem; border-top: 5px solid var(--brand); }
.kitchen-card header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.kitchen-card header span { color: var(--muted); font-size: 0.85rem; }
.kitchen-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; font-size: 1.05rem; }
.kitchen-late { border-top-color: var(--danger); }
.kitchen-empty { text-align: center; font-size: 1.2rem; margin-top: 3rem; }
.kitchen-ticket { font-size: 1rem; }
.ticket-qty { white-space: nowrap; padding-right: 0.5rem; font-weight: 700; }

/* ---------------------------------------------------------------- inventory & purchasing */
.inventory-actions { margin-bottom: 0.75rem; }
.stock-rows-wide .stock-row { grid-template-columns: minmax(0, 1.4fr) 90px minmax(0, 1fr) 150px !important; gap: 0.4rem; }
.stock-rows-wide .stock-row > input[name^="qty-"] { grid-column: 2; }
.stock-row-tracked .serials-input { grid-column: 3 / -1; }
.po-row { display: grid; grid-template-columns: 3fr 1fr 1fr; gap: 0.4rem; margin-bottom: 0.4rem; }

/* ---------------------------------------------------------------- charts, dashboard, portal */
.chart { margin: 0; }
.chart figcaption { font-weight: 600; margin-bottom: 0.5rem; }
.chart-svg { max-width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-mark { fill: var(--brand); }
.chart-hit { fill: transparent; }
.chart-bar:hover .chart-mark { fill: var(--brand-dark); }
.chart-table { margin-top: 0.5rem; font-size: 0.85rem; }
.chart-tip { position: fixed; z-index: 120; background: var(--text); color: #fff; padding: 0.35rem 0.6rem; border-radius: 6px; font-size: 0.85rem; pointer-events: none; }
.stat small { color: var(--muted); font-size: 0.8rem; }
.stat-hero strong { font-size: 1.6rem; }
.share-link { width: 100%; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.mrz-input { font-family: ui-monospace, monospace; font-size: 0.9rem; width: 100%; }
.portal { max-width: 720px; margin: 0 auto; padding: calc(1rem + env(safe-area-inset-top)) 1rem 2rem; }
.portal-header { background: linear-gradient(150deg, var(--brand), #1e1b4b); color: #fff; border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; }
.portal-header .logo { font-size: 1.4rem; }
.portal-header p { margin: 0.25rem 0 0; color: #e0e7ff; }

/* ---------------------------------------------------------------- shared touch & phone-only pieces */
button, a, .chip, .product-tile { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.nav-more, .cart-bar, .cart-sheet-header { display: none; }
.product-tile { position: relative; }
.tile-qty { position: absolute; top: 0.4rem; right: 0.4rem; background: var(--brand); color: #fff; border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.8rem; font-weight: 700; }
.tile-added { animation: tile-pulse 0.25s ease; }
@keyframes tile-pulse { 50% { transform: scale(0.95); background: var(--brand-soft); } }
.more-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.more-link { display: grid; justify-items: center; gap: 0.35rem; padding: 1rem 0.5rem; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 500; }
.more-link span { font-size: 1.6rem; }
.more-who { text-align: center; margin: 0; }
@media (prefers-reduced-motion: reduce) { .tile-added { animation: none; } }

@media (max-width: 960px) {
  /* ---- layout & safe areas (notch, home indicator) */
  .shell { grid-template-columns: 1fr; }
  .view { padding: 0.75rem 0.75rem calc(5.5rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.3rem; }
  .page-header { margin-bottom: 0.75rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }

  /* ---- top bar */
  .mobile-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; padding-top: max(0.5rem, env(safe-area-inset-top)); background: #1e1b4b; color: #fff; position: sticky; top: 0; z-index: 30; }
  .mobile-bar .logo { font-size: 1.1rem; }
  .mobile-who { flex: 1; min-width: 0; display: grid; font-size: 0.8rem; line-height: 1.2; }
  .mobile-who strong, .mobile-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-who span { color: #a5b4fc; }
  .mobile-bar .btn { background: transparent; color: #fff; border-color: rgb(255 255 255 / 40%); }
  .statusbar { justify-content: center; padding: 0.3rem 0.75rem; }
  .statusbar-quiet { display: none; }

  /* ---- bottom navigation: 4 main sections + More */
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; gap: 0; z-index: 40;
    padding: 0.3rem 0.3rem calc(0.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgb(0 0 0 / 15%); }
  .sidebar .logo, .sidebar-footer, .nav-secondary { display: none; }
  .nav-more { display: flex; }
  .nav-link { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0.15rem; font-size: 0.72rem; padding: 0.45rem 0.2rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; border-radius: 10px; }
  .nav-link span { font-size: 1.25rem; line-height: 1; }

  /* ---- touch targets (44px) and no iOS zoom on focus (inputs >= 16px) */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .icon-btn { width: 44px; height: 44px; font-size: 1.1rem; }
  .link-btn { padding: 0.5rem 0.25rem; }
  .chip { padding: 0.55rem 1rem; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  input[type="checkbox"] { min-height: 0; width: 22px; height: 22px; }

  /* ---- forms & filters */
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  /* Short fields (SKU/barcode, price/cost…) stay side by side inside dialogs. */
  .modal .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .modal .grid-2 .span-2 { grid-column: 1 / -1; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; align-items: end; }
  .filters label { min-width: 0; }
  .filters .btn, .filters > span, .filters label:has(select) { grid-column: 1 / -1; }
  .filter-input { max-width: none; }
  .form.inline { display: grid; grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1 1 0; }

  /* ---- tables become compact cards: title row, then details in two columns */
  .table.cards-on-mobile { display: block; background: none; box-shadow: none; }
  .table.cards-on-mobile thead { display: none; }
  .table.cards-on-mobile tbody { display: grid; gap: 0.6rem; }
  .table.cards-on-mobile tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 1rem; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.7rem 0.9rem; }
  .table.cards-on-mobile td { display: grid; gap: 0.05rem; padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .table.cards-on-mobile td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.02em; }
  .table.cards-on-mobile td:first-child { grid-column: 1 / -1; font-weight: 600; font-size: 1.02rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); margin-bottom: 0.15rem; }
  .table.cards-on-mobile td:first-child::before { content: none; }
  .table.cards-on-mobile td:empty { display: none; }
  .table.cards-on-mobile td.num { text-align: left; }
  .table.cards-on-mobile tr.clickable:active { background: var(--brand-soft); }
  .table:not(.cards-on-mobile) { width: 100%; }
  .table:not(.cards-on-mobile) td { padding: 0.5rem 0.4rem; }

  /* ---- cards, stats, tabs */
  .card { padding: 0.9rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .stat { padding: 0.7rem 0.8rem; }
  .stat strong { font-size: 1.05rem; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -0.75rem; margin-right: -0.75rem; padding: 0 0.75rem; }
  .tab { white-space: nowrap; padding: 0.7rem 0.9rem; }
  .plans { grid-template-columns: 1fr; }

  /* ---- dialogs become bottom sheets */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal-wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up 0.2s ease-out; }
  .modal-header { padding: 0.75rem 1rem; }
  .modal-header h2 { font-size: 1.05rem; }
  .modal-body { padding: 1rem; }
  body.modal-open { overflow: hidden; }

  /* ---- toasts at the top, clear of the cart bar and menu */
  #toasts { top: calc(3.6rem + env(safe-area-inset-top)); bottom: auto; left: 0.75rem; right: 0.75rem; max-width: none; }

  /* ---- point of sale: products fill the screen, cart is a bar + full-screen sheet */
  .pos { display: block; height: auto; }
  .pos-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .pos-toolbar input { grid-column: 1 / -1; }
  .pos-toolbar select { min-width: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -0.75rem; padding: 0 0.75rem 0.2rem; }
  .chip { white-space: nowrap; flex: 0 0 auto; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 0.5rem; padding-bottom: 4.5rem; }
  .product-tile { min-height: 84px; padding: 0.7rem; }
  .product-name { font-size: 0.95rem; line-height: 1.25; padding-right: 2.2rem; }
  .cart-bar:not([hidden]) { display: flex; position: fixed; left: 0.6rem; right: 0.6rem; bottom: calc(4.4rem + env(safe-area-inset-bottom)); z-index: 35;
    align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgb(0 113 227 / 35%); cursor: pointer; }
  .cart-bar-count { background: rgb(255 255 255 / 20%); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.85rem; }
  .cart-bar-total { flex: 1; text-align: left; font-size: 1.05rem; }
  .pos-cart { display: none; }
  .pos-cart.cart-open { display: flex; position: fixed; inset: 0; z-index: 45; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .cart-open .cart-sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
  .cart-sheet-header h2 { margin: 0; }
  body.cart-sheet-open { overflow: hidden; }
  .cart-line-main { font-size: 1.02rem; }
  .cart-actions { grid-template-columns: 1fr 2fr; }
  .cart-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cart-tools .chip { flex: 0 0 auto; padding: 0.5rem 0.8rem; }
  .denominations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .variant-row { grid-template-columns: 1fr 1fr; }
  .table-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stock-rows-wide .stock-row { grid-template-columns: 1fr 1fr !important; }
  .stock-row-tracked .serials-input { grid-column: 1 / -1; }
  .po-row { grid-template-columns: 1fr 1fr; }
  .po-row select { grid-column: 1 / -1; }
  .kitchen-board { grid-template-columns: 1fr; }
  .label-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* ---- sign-in screens */
  .auth { grid-template-columns: 1fr; min-height: 100dvh; }
  .auth { display: flex; flex-direction: column; }
  .auth-brand { padding: calc(1.25rem + env(safe-area-inset-top)) 1.5rem 1.25rem; flex: 0 0 auto; }
  .auth-brand .logo { font-size: 1.8rem; }
  .auth-brand p { margin: 0.25rem 0 0; }
  .auth-brand ul { display: none; }
  .auth-panel { padding: 1.5rem; justify-content: flex-start; }

  /* ---- misc */
  .stock-row { grid-template-columns: 1fr 96px; }
  .receipt { font-size: 0.85rem; }
  .callout { font-size: 0.9rem; }
}

@keyframes sheet-up { from { transform: translateY(30%); opacity: 0.6; } }

/* ---------------------------------------------------------------- printing: only the receipt / report */
@media print {
  body * { visibility: hidden; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal, .modal * { visibility: visible; }
  .modal { box-shadow: none; width: 100%; max-height: none; position: absolute; left: 0; top: 0; }
  .modal-header, .no-print { display: none !important; }
}

/* ---------------------------------------------------------------- expenses, setup checklist, billing */
.form-actions.start { justify-content: flex-start; }
.row-muted td { color: var(--muted); text-decoration: line-through; }
.row-muted td:last-child { text-decoration: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-top: 1rem; }
.inline-form label { flex: 1 1 140px; }
.bank-details { white-space: pre-wrap; background: var(--brand-soft); padding: 0.75rem 1rem; border-radius: 8px; font: inherit; }
.setup-card .page-header { margin-bottom: 0.5rem; }
.setup-card h2 { margin: 0; font-size: 1.05rem; }
.setup-card progress { width: 100%; height: 8px; accent-color: var(--brand); }
.setup-steps { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem; }
.setup-steps a { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); min-height: 44px; }
.setup-steps a:hover { border-color: var(--brand); }
.setup-steps small { display: block; color: var(--muted); }
.setup-tick { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 0.8rem; color: #fff; }
.setup-done .setup-tick { background: var(--ok); border-color: var(--ok); }
.setup-done strong { color: var(--muted); }
.table td .badge { width: max-content; max-width: 100%; }

/* ---------------------------------------------------------------- online orders, store settings, integrations, bell */
.grow { flex: 1 1 260px; margin: 0; }
.break { word-break: break-all; }
code { font-family: ui-monospace, monospace; font-size: 0.85em; background: var(--fill); padding: 1px 5px; border-radius: 4px; }
.callout-ok { background: var(--ok-soft); color: var(--ok-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.order-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.order-card { margin: 0; border-top: 4px solid var(--border); }
.order-new { border-top-color: var(--accent); }
.order-accepted, .order-ready { border-top-color: var(--ok); }
.order-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.order-meta { margin: 0.6rem 0; }
.order-items { list-style: none; padding: 0; margin: 0.5rem 0; }
.order-items li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.order-items li.strong { font-weight: 700; border-bottom: 0; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: grid; place-items: center; padding: 0 0.6rem; background: var(--fill); border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.input-prefix input { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; display: grid; gap: 0.5rem; }
legend { padding: 0 0.3rem; font-weight: 600; }
.area-row { display: grid; grid-template-columns: 1fr 7rem 9rem auto; gap: 0.5rem; align-items: center; }
.sidebar-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bell { position: relative; border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; padding: 0.3rem 0.4rem; border-radius: 8px; min-width: 44px; min-height: 40px; }
.bell:hover { background: rgb(255 255 255 / 10%); }
.bell-count { position: absolute; top: 0; right: 2px; min-width: 1.15rem; height: 1.15rem; padding: 0 0.25rem; border-radius: 999px; background: var(--accent); color: #1e1b4b; font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; }
.bell-count[hidden] { display: none; }
.bell-mobile { display: none; }
.notification-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.4rem; }
.notification-list a { display: grid; gap: 0.15rem; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.notification-list .unread a { border-color: var(--brand); background: var(--brand-soft); }

/* ---------------------------------------------------------------- public store */
.store { padding-bottom: 6rem; }
.store-header a { color: #fff; }
.store-ways { font-size: 0.9rem; }
.store-track { margin: 0 0 0.75rem; }
.store-cats { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 0.5rem; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.store-cats .chip { white-space: nowrap; text-decoration: none; }
.store-section h2 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; scroll-margin-top: 3.5rem; }
.store-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 0.5rem; min-height: 64px; }
.store-item > div:first-child { display: grid; gap: 0.15rem; }
.store-item span { color: var(--muted); }
.store-item.sold-out { opacity: 0.6; }
.qty-stepper { display: flex; align-items: center; gap: 0.6rem; }
.qty-stepper span { min-width: 1.5rem; text-align: center; font-weight: 700; }
.store-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--panel); box-shadow: 0 -4px 16px rgb(15 23 42 / 10%); z-index: 5; }
.store-bar .btn { max-width: 688px; margin: 0 auto; display: block; min-height: 48px; font-size: 1rem; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.segmented label { display: flex; gap: 0.5rem; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem; cursor: pointer; }
.segmented label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.store-status h2 { margin: 0.25rem 0; }
.store-status-rejected h2 { color: var(--danger); }
.store-status-ready h2, .store-status-completed h2 { color: var(--ok); }
@media (max-width: 960px) {
  .bell-mobile { display: inline-block; color: #fff; }
  .area-row { grid-template-columns: 1fr 5.5rem auto; }
}

/* ================================================================================================
   Design layer: refined, calm, "premium hardware" look. Neutral surfaces, one blue accent,
   system San Francisco type, frosted-glass bars, soft depth, pill controls, dark mode.
   ================================================================================================ */

/* ---------------------------------------------------------------- type */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.028em; line-height: 1.12; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.018em; }
h3 { font-weight: 600; letter-spacing: -0.012em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn:hover, .tab:hover, .nav-link:hover, .more-link:hover, .setup-steps a:hover, .notification-list a:hover, .store-cats .chip:hover { text-decoration: none; }
::selection { background: var(--brand-soft); }
.num, .stat strong, .product-price, .cart-totals { font-variant-numeric: tabular-nums; }
.icon { display: block; flex: none; }

/* ---------------------------------------------------------------- controls */
.btn {
  border: 0; background: var(--fill); color: var(--text); font-weight: 500; font-size: 0.95rem;
  padding: 0.6rem 1.15rem; min-height: 38px; border-radius: 980px;
  transition: background-color 0.2s var(--ease), transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: var(--fill-strong); border: 0; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { min-height: 50px; font-size: 1.05rem; font-weight: 600; padding: 0.8rem 1.6rem; }
.btn-sm { min-height: 30px; padding: 0.3rem 0.85rem; font-size: 0.85rem; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .nav-link:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible, .product-tile:focus-visible, .list-item:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.icon-btn { border: 0; background: var(--fill); color: var(--text); border-radius: 50%; transition: background-color 0.2s var(--ease); }
.icon-btn:hover { background: var(--fill-strong); }
.link-btn { color: var(--brand); font-weight: 500; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--danger); }

input, select, textarea {
  background: var(--panel); color: var(--text); border: 1px solid var(--input-border); border-radius: 12px;
  padding: 0.65rem 0.85rem; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--brand); }
input[type="checkbox"] { width: 18px; height: 18px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
}
.form { gap: 1rem; }
.form label, .filters label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.form label > input, .form label > select, .form label > textarea, .filters label > input, .filters label > select { color: var(--text); font-weight: 400; }
label.checkbox { color: var(--text) !important; font-size: 0.95rem !important; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); }
.input-prefix > span { background: var(--fill); border-color: var(--input-border); border-radius: 12px 0 0 12px; }
.input-prefix input { border-radius: 0 12px 12px 0; }

/* chips: quiet pills; the selected one is solid */
.chip { border: 0; background: var(--fill); color: var(--text); font-weight: 500; font-size: 0.9rem; padding: 0.42rem 0.95rem; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.chip:hover { background: var(--fill-strong); }
.chip-active, .chip-active:hover { background: var(--text); color: var(--bg); }
.chip-accent { background: var(--accent); color: #1d1d1f; }

/* tabs: a segmented control */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 1.25rem; border: 0; border-radius: 12px; background: var(--fill); max-width: 100%; }
.tab { padding: 0.42rem 1rem; border: 0; border-radius: 9px; color: var(--text); font-size: 0.9rem; font-weight: 500; transition: background-color 0.2s var(--ease); }
.tab:hover { background: rgb(255 255 255 / 40%); }
.tab-active, .tab-active:hover { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 12%), 0 0 0 0.5px rgb(0 0 0 / 4%); }
@media (prefers-color-scheme: dark) { .tab:hover { background: rgb(255 255 255 / 6%); } .tab-active, .tab-active:hover { background: #636366; } }

/* ---------------------------------------------------------------- surfaces */
.card, .stat, .table, .pos-cart, .kitchen-card, .store-item { border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--panel); }
.card { padding: 1.35rem 1.5rem; margin-bottom: 1.25rem; }
.card h2 { font-size: 1.1rem; margin-bottom: 0.9rem; }
.stats { gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.1rem 1.25rem; gap: 0.3rem; }
.stat span { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.stat strong { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.025em; }
.stat small { font-size: 0.8rem; }
.stat-hero { background: linear-gradient(160deg, #1d1d1f, #3a3a3c); color: #f5f5f7; }
.stat-hero span, .stat-hero small { color: rgb(245 245 247 / 70%); }
.stat-hero strong { font-size: 2rem; }
@media (prefers-color-scheme: dark) { .stat-hero { background: linear-gradient(160deg, #0a3a75, #0a84ff); } }

.table { overflow: hidden; }
.table th { background: transparent; text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding-top: 0.8rem; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 0.5rem 0.75rem; }
.clickable { transition: background-color 0.15s var(--ease); }
.clickable:hover { background: var(--fill); }
.card .table { border-radius: 0; background: transparent; }

.badge { background: var(--fill); color: var(--muted); font-weight: 600; font-size: 0.74rem; padding: 0.2rem 0.6rem; letter-spacing: 0; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.callout { border-radius: var(--radius); padding: 0.9rem 1.1rem; }
.callout-warn { background: var(--warn-soft); color: var(--warn-text); }
.callout-ok { background: var(--ok-soft); color: var(--ok-text); }
code { background: var(--fill); }

.list-item { border: 0; background: var(--fill); border-radius: 12px; color: var(--text); transition: background-color 0.15s var(--ease); }
button.list-item:hover { background: var(--fill-strong); }

/* ---------------------------------------------------------------- toasts, tooltips, dialogs */
#toasts { bottom: 1.5rem; right: 1.5rem; }
.toast {
  background: rgb(29 29 31 / 88%); color: #f5f5f7; border-radius: 14px; padding: 0.8rem 1.1rem; font-weight: 500;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%); animation: toast-in 0.35s var(--ease);
}
.toast-success::before { content: "✓  "; color: #30d158; font-weight: 700; }
.toast-error::before { content: "!  "; color: #ff453a; font-weight: 800; }
.toast-warn::before { content: "●  "; color: #ff9f0a; }
.toast-success, .toast-error, .toast-warn { background: rgb(29 29 31 / 88%); }
@keyframes toast-in { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.chart-tip { background: rgb(29 29 31 / 92%); color: #f5f5f7; border-radius: 8px; }

.modal-backdrop { background: rgb(0 0 0 / 28%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in 0.2s var(--ease); }
.modal { border-radius: 22px; background: var(--panel); box-shadow: 0 30px 80px rgb(0 0 0 / 30%), 0 0 0 0.5px rgb(0 0 0 / 8%); animation: modal-in 0.28s var(--ease); }
.modal-header { border-bottom: 0; padding: 1.2rem 1.5rem 0.4rem; background: var(--panel); }
.modal-header h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-header .icon-btn { width: 30px; height: 30px; font-size: 0.8rem; color: var(--muted); }
.modal-body { padding: 0.8rem 1.5rem 1.5rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { transform: translateY(10px) scale(0.98); opacity: 0; } }

/* ---------------------------------------------------------------- sign in */
.auth { background: var(--bg); }
.auth-brand {
  background: radial-gradient(120% 90% at 10% 0%, rgb(10 132 255 / 35%), transparent 60%),
              radial-gradient(90% 80% at 100% 100%, rgb(94 92 230 / 30%), transparent 60%), #000;
  color: rgb(245 245 247 / 75%); padding: 4rem;
}
.auth-brand .logo { font-size: 1.5rem; color: #f5f5f7; }
.auth-headline { color: #f5f5f7; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin: 2.5rem 0 1rem; }
.auth-headline span { background: linear-gradient(90deg, #0a84ff, #bf5af2 60%, #ff375f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand p { font-size: 1.15rem; max-width: 30rem; }
.auth-brand ul { list-style: none; padding: 0; margin-top: 1.5rem; display: grid; gap: 0.6rem; }
.auth-brand li::before { content: "✓"; color: #30d158; font-weight: 700; margin-right: 0.7rem; }
.auth-panel { gap: 1.2rem; }
.auth-panel h1 { font-size: 2.2rem; }
.auth-panel .btn-primary { min-height: 48px; font-size: 1rem; }

.logo { font-weight: 700; letter-spacing: -0.03em; }
.logo span { color: var(--brand); }

/* ---------------------------------------------------------------- app shell (desktop) */
.shell { grid-template-columns: 248px 1fr; }
.sidebar {
  background: var(--glass-sidebar); color: var(--text); border-right: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  padding: 1.5rem 0.85rem 1rem; gap: 2px;
}
.sidebar .logo { color: var(--text); font-size: 1.35rem; padding: 0 0.75rem 1.25rem; }
.nav-link { color: var(--text); font-size: 0.95rem; font-weight: 500; padding: 0.55rem 0.75rem; border-radius: 10px; gap: 0.7rem; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.nav-link .icon { color: var(--brand); width: 20px; height: 20px; }
.nav-link:hover { background: var(--fill); color: var(--text); }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link.active .icon { color: #fff; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 1rem 0.75rem 0.25rem; gap: 0.6rem; }
.sidebar-footer .who strong { color: var(--text); }
.sidebar-footer .who span { color: var(--muted); }
.sidebar-footer .link-btn { color: var(--brand); }
.sidebar-footer .badge-warn { justify-self: start; }
.bell { color: var(--text); display: grid; place-items: center; transition: background-color 0.15s var(--ease); }
.bell:hover { background: var(--fill); }
.bell-count { background: #ff3b30; color: #fff; top: 2px; right: 4px; box-shadow: 0 0 0 2px var(--panel); }
.statusbar { background: transparent; border: 0; color: var(--ok); font-weight: 500; padding: 0.6rem 2rem 0; }
.statusbar-offline { background: var(--warn-soft); color: var(--warn-text); padding-bottom: 0.6rem; }
.view { padding: 1rem 2.25rem 2.5rem; max-width: 1440px; width: 100%; }
.page-header { margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- point of sale */
.pos { gap: 1.25rem; }
.pos-toolbar input { border-radius: 12px; background: var(--panel); }
.product-grid { gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 2px 2px 1rem; }
.product-tile {
  border: 0; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); padding: 1rem; min-height: 108px; gap: 0.35rem; color: var(--text);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.product-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border: 0; }
.product-tile:active { transform: scale(0.97); }
.product-name { font-weight: 600; letter-spacing: -0.01em; }
.product-price { color: var(--text); font-weight: 600; font-size: 1.05rem; }
.product-stock { color: var(--muted); }
.tile-qty { background: var(--brand); box-shadow: 0 2px 6px rgb(0 113 227 / 35%); }
@keyframes tile-pulse { 50% { transform: scale(0.95); } }
.pos-cart { overflow: hidden; }
.cart-customer, .cart-totals, .cart-tools { border-color: var(--border); }
.cart-line { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.cart-totals { padding: 1rem 1.1rem; background: var(--panel-2); }
.cart-totals .grand { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.cart-actions { padding: 0.9rem 1.1rem 1.1rem; background: var(--panel-2); }
.cart-actions .btn { min-height: 50px; font-size: 1rem; }
.held-pill { background: var(--warn-soft); color: var(--warn-text); }
.checkout-remaining strong { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.method-buttons .btn { min-height: 52px; border-radius: 14px; }
.table-tile { border-radius: 16px; border-width: 0; box-shadow: inset 0 0 0 2px var(--ok); }
.table-busy { box-shadow: inset 0 0 0 2px var(--warn); }
.kitchen-card { border-top: 0; box-shadow: var(--shadow), inset 0 4px 0 var(--brand); padding: 1rem; }
.kitchen-late { box-shadow: var(--shadow), inset 0 4px 0 var(--danger); }
.order-card { border-top: 0; box-shadow: var(--shadow), inset 0 4px 0 var(--border-strong); }
.order-new { box-shadow: var(--shadow), inset 0 4px 0 var(--accent); }
.order-accepted, .order-ready { box-shadow: var(--shadow), inset 0 4px 0 var(--ok); }

/* ---------------------------------------------------------------- plans, setup, more */
.plan { border-radius: var(--radius-lg); }
.plan .price { font-size: 2rem; letter-spacing: -0.03em; }
.plan-current { outline: 0; box-shadow: var(--shadow), 0 0 0 2px var(--brand); }
.setup-steps a, .more-link, .notification-list a { border: 0; background: var(--fill); border-radius: 14px; transition: background-color 0.15s var(--ease); }
.setup-steps a:hover, .more-link:hover { background: var(--fill-strong); }
.setup-tick { border-color: var(--border-strong); }
.notification-list .unread a { background: var(--brand-soft); }
.more-link { gap: 0.5rem; padding: 1.1rem 0.5rem; color: var(--text); }
.more-link .icon { width: 28px; height: 28px; color: var(--brand); }
.bank-details { background: var(--fill); border-radius: 12px; }

/* ---------------------------------------------------------------- charts */
.chart figcaption { font-weight: 600; letter-spacing: -0.01em; }
.chart-baseline { stroke: var(--border-strong); }
.chart-bar:hover .chart-mark { fill: var(--brand-dark); }

/* ---------------------------------------------------------------- public pages (store, statement) */
.portal-header {
  background: radial-gradient(120% 120% at 0% 0%, rgb(10 132 255 / 45%), transparent 55%), linear-gradient(160deg, #1d1d1f, #2c2c2e);
  border-radius: 24px; padding: 1.75rem 1.5rem; color: #f5f5f7;
}
.portal-header .logo { font-size: 1.8rem; color: #f5f5f7; }
.portal-header p { color: rgb(245 245 247 / 75%); }
.store-item { border-radius: 18px; padding: 0.95rem 1.1rem; }
.store-cats { background: var(--bg); padding-top: 0.5rem; }
.store-bar { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -1px 0 var(--border); }
.store-bar .btn { border-radius: 14px; min-height: 52px; }
.segmented { background: var(--fill); padding: 3px; border-radius: 12px; gap: 2px; }
.segmented label { border: 0; border-radius: 9px; color: var(--text) !important; }
.segmented label:has(input:checked) { background: var(--panel); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented label:has(input:focus-visible) { box-shadow: var(--ring); }

/* ---------------------------------------------------------------- phones and tablets */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .chip { padding: 0.55rem 1rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #toasts { bottom: auto; left: 0.75rem; right: 0.75rem; }
  .register-status .badge { width: auto; }
  h1 { font-size: 1.75rem; }
  .view { padding: 0.75rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  .statusbar { padding: 0.4rem 1rem; justify-content: center; }

  .mobile-bar {
    background: var(--glass); color: var(--text); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .mobile-bar .logo { color: var(--text); }
  .mobile-who span { color: var(--muted); }
  .mobile-bar .btn { background: transparent; color: var(--brand); border: 0; padding: 0.3rem 0.4rem; font-weight: 500; }
  .bell-mobile { color: var(--text); }

  .sidebar {
    background: var(--glass); border-right: 0; border-top: 1px solid var(--border); box-shadow: none;
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    padding: 0.35rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
  }
  .nav-link { color: var(--muted); font-size: 0.68rem; font-weight: 500; gap: 0.2rem; padding: 0.3rem 0.1rem; background: none !important; }
  .nav-link .icon { color: currentColor; width: 25px; height: 25px; }
  .nav-link span.nav-label { font-size: 0.68rem; line-height: 1.1; }
  .nav-link:hover:not(.active) { color: var(--muted); }
  .nav-link.active, .nav-link.active .icon { color: var(--brand); background: none; }

  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 1rem; padding: 3px; }
  .tab { flex: 0 0 auto; padding: 0.45rem 0.9rem; }
  .card { padding: 1.1rem; border-radius: 18px; }
  .stats { gap: 0.6rem; }
  .stat { padding: 0.9rem 1rem; border-radius: 18px; }
  .stat strong { font-size: 1.2rem; }
  .stat-hero strong { font-size: 1.5rem; }
  .table.cards-on-mobile tr { border-radius: 18px; padding: 0.9rem 1rem; }
  .table.cards-on-mobile td::before { text-transform: none; letter-spacing: 0; font-weight: 500; }
  .table.cards-on-mobile td:first-child { border-bottom-color: var(--border); }

  .modal, .modal-wide { border-radius: 22px 22px 0 0; animation: sheet-up 0.32s var(--ease); }
  /* The grab handle sits inside the sticky title bar, so scrolled content never shows above the title. */
  .modal { position: relative; }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; z-index: 3; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill-strong); }
  .modal-header { padding: 1.3rem 1.1rem 0.5rem; z-index: 2; }
  .modal-body { padding: 0.6rem 1.1rem 1.3rem; }
  #toasts { top: calc(3.9rem + env(safe-area-inset-top)); }

  .product-grid { gap: 0.6rem; }
  .product-tile { border-radius: 16px; min-height: 92px; }
  .product-tile:hover { transform: none; box-shadow: var(--shadow); }
  .cart-bar:not([hidden]) { border-radius: 16px; background: var(--brand); box-shadow: 0 10px 28px rgb(0 113 227 / 35%); bottom: calc(4.6rem + env(safe-area-inset-bottom)); }

  .auth-brand { padding: calc(2rem + env(safe-area-inset-top)) 1.5rem 2rem; }
  .auth-headline { margin: 1.25rem 0 0.5rem; font-size: 2.2rem; }
  .auth-brand p { font-size: 1rem; }
  .auth-panel h1 { font-size: 1.8rem; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

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

/* Receipts and reports always print black on white, even in dark mode. */
@media print {
  :root { --panel: #fff; --panel-2: #fff; --bg: #fff; --text: #000; --muted: #444; --border: #ccc; color-scheme: light; }
  .modal { border-radius: 0; animation: none; }
  .modal::before { display: none; }
}

/* ---------------------------------------------------------------- online orders: payments, progress, deliveries */
.order-filters { margin-bottom: 1.25rem; }
button.tab { font: inherit; font-size: 0.9rem; background: transparent; cursor: pointer; }
.tab-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.35rem; margin-left: 0.25rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; }
.order-card h3 { margin: 0.1rem 0 0; font-size: 1.15rem; }
.order-number { font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.order-contact { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.order-contact .btn .icon { width: 16px; height: 16px; }
.order-note { background: var(--fill); border-radius: 12px; padding: 0.6rem 0.8rem; margin: 0.5rem 0; }
.order-rejected { color: var(--danger); font-weight: 500; margin: 0.6rem 0 0; }
.order-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0.9rem 0 0; counter-reset: step; }
.order-steps li { flex: 1; font-size: 0.7rem; font-weight: 500; color: var(--muted); padding-top: 9px; position: relative; text-align: center; min-width: 0; }
.order-steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--fill-strong); }
.order-steps li.done { color: var(--text); }
.order-steps li.done::before { background: var(--ok); }
.order-steps-lg li { font-size: 0.8rem; padding-top: 12px; }
.order-steps-lg li::before { height: 6px; }
.slip-thumb { display: flex; align-items: center; gap: 0.75rem; width: 100%; margin: 0.5rem 0; padding: 0.5rem; border: 0; border-radius: 14px; background: var(--fill); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.slip-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--panel); }
.slip-thumb:hover { background: var(--fill-strong); }
.slip-full { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: var(--fill); }
.btn-wide { flex: 1 1 100%; min-height: 50px; font-size: 1rem; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state p { margin: 0.25rem 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.pay-card h2 { margin-top: 0; }
.bank-list { display: grid; gap: 0; margin: 0.5rem 0 1.25rem; border-radius: 14px; background: var(--fill); padding: 0.25rem 1rem; }
.bank-list div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.bank-list div:last-child { border-bottom: 0; }
.bank-list dt { color: var(--muted); }
.bank-list dd { margin: 0; text-align: right; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.02em; }
.slip-drop { position: relative; display: grid !important; place-items: center; gap: 0.5rem; min-height: 150px; padding: 1.25rem; border: 1.5px dashed var(--border-strong); border-radius: 18px; background: var(--panel-2); text-align: center; cursor: pointer; color: var(--brand) !important; font-size: 1rem !important; font-weight: 600 !important; }
.slip-drop:hover { border-color: var(--brand); }
.slip-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.slip-drop small { display: block; color: var(--muted); font-weight: 400; font-size: 0.82rem; margin-top: 0.2rem; }
.slip-drop img { max-width: 100%; max-height: 220px; border-radius: 12px; }
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr; }
  .order-filters { display: flex; }
}
.section-title { font-size: 1.05rem; margin: 1.5rem 0 0.75rem; }

/* ---------------------------------------------------------------- online shop: cards, search, basket, my orders */
.store-page .portal.store { max-width: 1100px; padding-top: 0; }
.shop-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 -1rem 0.75rem; padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.shop-name { border: 0; background: none; padding: 0; font: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-bar-actions { display: flex; gap: 0.4rem; }
.shop-icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--fill); color: var(--text); cursor: pointer; }
.shop-icon-btn:disabled { opacity: 0.45; cursor: default; }
.shop-badge { position: absolute; top: -3px; right: -3px; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.shop-badge-inline { position: static; display: inline-grid; margin-right: 0.4rem; background: rgb(255 255 255 / 25%); box-shadow: none; }
.shop-hero { padding: 0.75rem 0 0.25rem; }
.shop-hero h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
.shop-hero p { color: var(--muted); font-size: 1.05rem; margin: 0.4rem 0 0; }
.shop-ways { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.shop-ways .badge { font-size: 0.8rem; padding: 0.3rem 0.7rem; color: var(--text); }
.shop-tools { position: sticky; top: calc(3.6rem + env(safe-area-inset-top)); z-index: 15; background: var(--bg); padding: 0.75rem 0 0.5rem; margin-bottom: 0.25rem; }
.shop-search { position: relative; display: block; }
.shop-search .icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.shop-search input { width: 100%; padding-left: 2.5rem; border-radius: 14px; background: var(--fill); border-color: transparent; font-size: 16px; min-height: 46px; }
.shop-search input:focus { background: var(--panel); }
.shop-cats { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; margin-top: 0.6rem; padding-bottom: 0.1rem; }
.shop-cats .chip { flex: 0 0 auto; white-space: nowrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; padding-bottom: 1rem; }
.shop-card { display: flex; flex-direction: column; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
@media (hover: hover) { .shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); } }
.shop-card.sold-out { opacity: 0.6; }
.shop-card-media { position: relative; aspect-ratio: 1 / 1; background: var(--panel-2); }
.shop-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 0.6rem; }
/* No photo: a calm neutral tile with a small picture glyph (not loud coloured initials). */
.shop-card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--fill); color: var(--muted); }
.shop-card-placeholder .icon { width: 34px; height: 34px; stroke-width: 1.3; opacity: 0.55; }
.shop-flag { position: absolute; left: 0.6rem; top: 0.6rem; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; }
.shop-flag-out { background: #1d1d1f; }
.shop-card-body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 0.9rem 0.9rem; flex: 1; }
.shop-card-body h3 { margin: 0; font-size: 0.98rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card-meta { margin: 0; color: var(--muted); font-size: 0.8rem; min-height: 1.1em; }
.shop-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.shop-price { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.shop-add { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; flex: none; transition: transform 0.12s var(--ease); }
.shop-add:active { transform: scale(0.9); }
.shop-add .icon, .shop-stepper .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.shop-stepper { display: flex; align-items: center; gap: 0.15rem; background: var(--fill); border-radius: 999px; padding: 3px; flex: none; }
.shop-stepper button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--panel); color: var(--text); cursor: pointer; box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }
.shop-stepper span { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-back { margin: 0.25rem 0 0.75rem; font-size: 1rem; }
.shop-page-title { margin: 0.75rem 0 1rem; }
.basket { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.basket li { display: grid; grid-template-columns: 52px 1fr auto; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.basket img, .basket-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: var(--panel-2); }
.basket-thumb { display: grid; place-items: center; color: var(--muted); background: var(--fill); }
.basket-thumb .icon { width: 22px; height: 22px; opacity: 0.55; }
.basket li > div:nth-child(2) { display: grid; gap: 0.1rem; min-width: 0; }
.basket strong { font-weight: 600; font-size: 0.95rem; }
.pay-options { display: grid; gap: 0.6rem; border: 0; padding: 0; }
.pay-options legend { font-size: 0.85rem; color: var(--muted); font-weight: 500; margin-bottom: 0.4rem; }
.pay-option { display: flex !important; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; border-radius: 14px; background: var(--fill); cursor: pointer; color: var(--text) !important; }
.pay-option:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.pay-option input { margin-top: 0.2rem; width: 20px; height: 20px; flex: none; }
.pay-option strong { display: block; font-size: 1rem; }
.pay-option small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-top: 0.15rem; }
.store-status-celebrate { box-shadow: var(--shadow), inset 0 0 0 2px var(--ok); }
.store-status-celebrate h2 { color: var(--ok); font-size: 1.6rem; }
.notify-on { margin: 0.75rem 0 0; }
.my-orders { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.my-order { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 0; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.my-order small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.my-order-open { box-shadow: var(--shadow), inset 4px 0 0 var(--brand); }
@media (max-width: 600px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .shop-card { border-radius: 18px; }
  .shop-card-body { padding: 0.65rem 0.7rem 0.75rem; }
  .shop-card-body h3 { font-size: 0.9rem; }
  .shop-price { font-size: 0.95rem; }
  .shop-add { width: 34px; height: 34px; }
  .shop-stepper button { width: 28px; height: 28px; }
  .shop-stepper span { min-width: 1.2rem; }
}
.message-customer { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0.6rem; }
.message-customer .muted { width: 100%; font-size: 0.85rem; }
.ready-note { margin: 0.6rem 0 0; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--ok-soft); color: var(--ok-text); font-weight: 500; font-size: 0.9rem; }
.product-photo { display: flex; gap: 1rem; align-items: center; }
.photo-pick { position: relative; flex: none; width: 96px; height: 96px; border-radius: 18px; background: var(--fill); display: grid !important; place-items: center; overflow: hidden; cursor: pointer; color: var(--brand) !important; font-weight: 600 !important; font-size: 0.85rem !important; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-photo-text { display: grid; gap: 0.2rem; font-size: 0.9rem; }
.product-photo-text .link-btn { justify-self: start; }

/* ---------------------------------------------------------------- quick "+ New" in forms */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.quick-new { font-size: 0.85rem; padding: 0 !important; }
.quick-create { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.75rem; border-radius: 14px; background: var(--brand-soft); animation: fade-in 0.2s var(--ease); }
.quick-create input { flex: 1 1 200px; min-width: 0; }
label.checkbox input[type="checkbox"] { flex: none; }

/* ---------------------------------------------------------------- operator console */
.admin-auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(120% 80% at 0% 0%, rgb(10 132 255 / 18%), transparent 55%), radial-gradient(90% 70% at 100% 100%, rgb(94 92 230 / 16%), transparent 60%), var(--bg); }
.admin-auth-card { width: min(440px, 100%); background: var(--panel); border-radius: 24px; box-shadow: var(--shadow-lift); padding: 2rem 1.75rem; display: grid; gap: 1rem; }
.admin-auth-card h1 { font-size: 1.7rem; margin: 0; }
.admin-badge { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #1d1d1f, #48484a); }
.admin-badge .icon { width: 26px; height: 26px; }
.admin-auth-foot { font-size: 0.8rem; margin: 0; text-align: center; }
.admin-tag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); vertical-align: middle; padding: 0.15rem 0.45rem; border-radius: 6px; background: var(--fill); }
.admin-shell .nav-link .icon { width: 20px; height: 20px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.checks li { padding: 0.7rem 0.9rem; border-radius: 12px; }
.check-ok { background: var(--ok-soft); color: var(--ok-text); }
.check-warn { background: var(--warn-soft); color: var(--warn-text); }
.plan-editors { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.plan-editor h2 { margin-top: 0; }
[hidden] { display: none !important; }
.coupon-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.coupon-form label { flex: 1 1 200px; }
.price-was { text-decoration: line-through; color: var(--muted); font-size: 0.9rem; margin-left: 0.4rem; font-weight: 400; }
.coupon-form label { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 500; color: var(--muted); }

/* ---------------------------------------------------------------- bank payments (counter link) */
.pos-status-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.bank-pill { text-decoration: none !important; }
.bank-panel { display: grid; gap: 0.4rem; }
.bank-panel-title { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.bank-panel-empty { margin: 0; font-size: 0.85rem; }
.bank-payment { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; width: 100%; padding: 0.7rem 0.9rem; border: 0; border-radius: 14px;
  background: var(--fill); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color 0.15s var(--ease); }
.bank-payment:hover:not(:disabled) { background: var(--fill-strong); }
.bank-payment small { color: var(--muted); }
.bank-payment:disabled { opacity: 0.5; cursor: default; }
.bank-payment-match { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); }
.bank-payment-match small { color: var(--ok-text); }
.bank-payment-partial small { color: var(--warn-text); }
.invoice-link { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; background: none; padding: 0.15rem 0.3rem; margin: -0.15rem -0.3rem; border-radius: 8px; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.invoice-link:hover { background: var(--brand-soft); }
.invoice-link .icon { width: 18px; height: 18px; }
.pair-qr { width: min(300px, 80vw); margin: 0.5rem auto; padding: 0.5rem; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.pair-qr .qr { display: block; width: 100%; height: auto; }
.center { text-align: center; }

/* Bank payments: activity on this device (Settings → Bank payments) */
.activity-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.9rem; }
.activity-log li { padding: 0.45rem 0.7rem; border-radius: 10px; border: 1px solid var(--border); overflow-wrap: anywhere; }
.activity-log small { margin-right: 0.35rem; }
.activity-log .activity-payment, .activity-log .activity-ok { color: var(--ok-text); }
.activity-log .activity-warn, .activity-log .activity-error { color: var(--warn-text); }
/* Payment banners: top of the screen, tap to dismiss */
#toasts-top { position: fixed; top: calc(0.75rem + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: grid; gap: 0.5rem; z-index: 101;
  width: max-content; max-width: min(460px, calc(100vw - 1.5rem)); }
#toasts-top { pointer-events: none; } /* the strip around the banners doesn't block the till */
#toasts-top .toast { cursor: pointer; font-size: 1.05rem; pointer-events: auto; }
/* Till: show / hide the amount on the customer screen */
.screen-toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.5rem; padding: 0.2rem 0.65rem; border: 0; border-radius: 999px; background: var(--fill); color: var(--muted); font: inherit; font-size: 0.78rem; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.screen-toggle .icon { width: 16px; height: 16px; }
.screen-toggle.on { background: var(--brand-soft); color: var(--brand); }
.checkout-screen { display: flex; justify-content: flex-end; margin: -0.25rem 0 0.5rem; }
.checkout-screen .screen-toggle { margin-left: 0; }

/* Login: "Forgot your password?" help */
.forgot { font-size: 0.9rem; color: var(--muted); }
.forgot summary { cursor: pointer; color: var(--brand); font-weight: 500; width: fit-content; }
.forgot p { margin: 0.5rem 0 0; }

/* ---------------------------------------------------------------- till status (register + bank link) */
.pos-status-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.pos-status-row:not(:has(.till-state, .till-pill)) { display: none; }
.register-status { display: flex; align-items: center; gap: 0.6rem; min-height: 0; font-size: 0.88rem; }
.register-status:empty, .bank-link-status:empty { display: none; }
.till-state { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; color: var(--text); }
.till-state-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.till-state strong { font-weight: 600; }
.till-since { color: var(--muted); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tone-ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.tone-warn .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tone-danger .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.till-actions { display: inline-flex; gap: 0.35rem; flex: none; }
.till-btn { border: 0; border-radius: 999px; padding: 0.38rem 0.85rem; background: var(--fill); color: var(--brand); font: inherit; font-size: 0.82rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 0.2s var(--ease); }
.till-btn:hover { background: var(--fill-strong); }
.till-btn-primary, .till-btn-primary:hover { background: var(--brand); color: #fff; }
.bank-link-status { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.till-pill { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; padding: 0.32rem 0.8rem; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 0.8rem; font-weight: 600; text-decoration: none !important; }
.till-pill > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.till-pill.tone-ok { background: var(--ok-soft); color: var(--ok-text); }
.till-pill.tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.till-pill.tone-danger { background: var(--danger-soft); color: var(--danger); }
.bank-link-status .screen-toggle { margin-left: 0; padding: 0.32rem 0.8rem; font-weight: 500; }
.screen-toggle .st-short, .till-pill .st-short { display: none; }

@media (max-width: 600px) {
  /* Store and register pickers: compact, and hidden when there's only one of each. */
  .pos-toolbar select { min-height: 40px; padding-top: 0.4rem; padding-bottom: 0.4rem; font-size: 0.92rem; border-radius: 12px; }
  .pos-single-till select { display: none; }
  /* One tidy card: register on top, bank link and customer-screen switch below. */
  .pos-status-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 0.75rem 0.85rem; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
  .register-status { justify-content: space-between; min-width: 0; }
  .bank-link-status > * { min-width: 0; }
  .till-long { display: none; }
  .till-btn { padding: 0.45rem 0.85rem; }
  .bank-link-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
  .till-state-text > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .register-status:not(:empty) + .bank-link-status { padding-top: 0.6rem; border-top: 1px solid var(--border); }
  .till-pill, .bank-link-status .screen-toggle { min-height: 34px; }
  .bank-link-status .screen-toggle { justify-content: center; }
  .screen-toggle .st-long, .till-pill .st-long { display: none; }
  .screen-toggle .st-short, .till-pill .st-short { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* "Register 1 open" with the time on its own line underneath. */
  .till-state { align-items: flex-start; }
  .till-state .dot { margin-top: 0.4rem; }
  .till-state-text { display: grid; white-space: normal; font-size: 0.95rem; line-height: 1.3; }
  .till-sep { display: none; }
  .till-since { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------------------------------------------------------------- cart lines and checkout */
.cart-line-name { min-width: 0; overflow-wrap: anywhere; }
.cart-line-controls { flex-wrap: nowrap; gap: 0.6rem; }
.stepper { display: inline-flex; align-items: center; flex: none; padding: 2px; border-radius: 999px; background: var(--fill); }
.stepper button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; transition: background-color 0.15s var(--ease); }
.stepper button:hover { background: var(--fill-strong); }
.stepper button:active { transform: scale(0.92); }
.stepper .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.stepper-qty { min-width: 1.9rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-line-each { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cart-line-actions { display: inline-flex; gap: 0.2rem; margin-left: auto; flex: none; }
.line-act { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 32px; height: 32px; padding: 0 0.45rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.line-act .icon { width: 18px; height: 18px; }
.line-act:hover { background: var(--fill); color: var(--brand); }
.line-act.danger:hover { background: var(--danger-soft); color: var(--danger); }
.line-act.has-discount { background: var(--ok-soft); color: var(--ok-text); }
.cart-sheet-count { color: var(--muted); font-size: 0.85em; font-weight: 500; }
#cart-pay .pay-amount { margin-left: 0.3rem; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  /* Cart sheet: the items get the room; totals and buttons stay compact at the bottom. */
  .cart-open .cart-sheet-header { padding: 0.6rem 1rem; }
  .cart-sheet-header h2 { font-size: 1.25rem; }
  .cart-customer { padding: 0.6rem 1rem; }
  .cart-held:not(:empty) { padding: 0.6rem 1rem 0; }
  .cart-lines { padding: 0.15rem 1rem; }
  .cart-line { padding: 0.7rem 0; gap: 0.45rem; }
  .cart-line-main { font-size: 1rem; line-height: 1.3; }
  .stepper button { width: 38px; height: 38px; }
  .line-act { min-width: 38px; height: 38px; }
  .cart-tools { padding: 0.5rem 1rem; gap: 0.4rem; }
  .cart-tools .chip { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .cart-totals { padding: 0.55rem 1rem; gap: 0.15rem; font-size: 0.88rem; color: var(--muted); }
  .cart-totals .grand { display: none; } /* the total is on the Pay button */
  .cart-actions { grid-template-columns: auto 1fr; padding: 0.55rem 1rem 0.8rem; }
  .cart-actions .btn { min-height: 54px; }
  #cart-clear { padding: 0 1.2rem; }
  #cart-pay { font-size: 1.1rem; font-weight: 600; }

  /* Payment window: everything within reach, Complete sale always on screen. */
  .checkout { gap: 0.85rem; }
  .checkout-remaining { font-size: 1rem; }
  .checkout-remaining strong { font-size: 1.9rem; }
  .method-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
  .method-buttons .btn { min-height: 48px; padding: 0.4rem 0.6rem; font-size: 0.95rem; line-height: 1.2; }
  #pay-form input[name="amount"] { min-height: 52px; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
  .quick-cash { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 0.4rem; }
  #pay-form .form-actions .btn { min-height: 44px; background: transparent; border: 1px dashed var(--border-strong); color: var(--brand); font-weight: 500; }
  .quick-cash .chip { padding: 0.55rem 0.3rem; text-align: center; font-variant-numeric: tabular-nums; }
  /* Buttons pinned to the bottom of a sheet: always within reach, however long it is. */
  .sheet-actions { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem;
    margin: 0 -1.1rem -1.3rem; padding: 0.7rem 1.1rem 0.9rem; border-top: 1px solid var(--border); background: var(--panel); }
  .sheet-actions > .btn { min-height: 54px; margin: 0; }
}

/* ---------------------------------------------------------------- receipt screen and product form */
.sale-done { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border-radius: 16px; background: var(--ok-soft); color: var(--ok-text); }
.sale-done-offline { background: var(--warn-soft); color: var(--warn-text); }
.sale-done-tick { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 700; }
.sale-done-offline .sale-done-tick { background: var(--warn); }
.sale-done-text { display: grid; min-width: 0; line-height: 1.3; }
.sale-done-text strong { color: var(--text); }
.sale-done-text span { font-size: 0.85rem; }
.sale-done-change { display: grid; margin-left: auto; text-align: right; line-height: 1.15; }
.sale-done-change span { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.sale-done-change strong { font-size: 1.45rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Receipt buttons: A4 documents in a row, then New sale / Close and Print receipt. */
.receipt-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem; }
.receipt-actions > .btn { margin: 0; }
.receipt-docs { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.5rem; }
.receipt-docs .btn { margin: 0; min-height: 38px; padding: 0.35rem 0.6rem; font-size: 0.88rem; white-space: nowrap; }
/* Deliver this sale (or the delivery it already has): its own row above the main buttons. */
.receipt-delivery { grid-column: 1 / -1; flex-basis: 100%; }
.receipt-delivery:empty { display: none; }
.deliver-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: 100%; margin: 0; }
.deliver-btn svg, .delivery-status > svg { width: 20px; height: 20px; flex: none; }
.delivery-status { margin: 0; flex-wrap: nowrap; justify-content: flex-start; }
.delivery-status > span { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.delivery-status small { color: var(--muted); }
.delivery-status .btn { margin: 0; flex: none; }

.form-section { margin: 0.6rem 0 -0.2rem; padding-top: 0.9rem; border-top: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.check-list { display: grid; border-radius: 14px; background: var(--fill); overflow: hidden; }
.check-list label.checkbox { margin: 0; padding: 0.75rem 0.9rem; min-height: 48px; cursor: pointer; }
.check-list label.checkbox + label.checkbox { border-top: 1px solid var(--border); }
.check-list label.checkbox small { margin-left: auto; padding-left: 0.5rem; text-align: right; }
.check-list input[type="checkbox"] { flex: none; width: 20px; height: 20px; }
.form-extra-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.input-with-btn input { flex: 1; min-width: 0; }

@media (max-width: 960px) {
  .sale-done { margin-bottom: 0.2rem; }
  /* Receipt: the paper preview scrolls; print and the A4 documents stay at the bottom. */
  .receipt-docs .btn { min-height: 40px; }
  .receipt.receipt-frame { padding: 10px 6px; margin-bottom: 0; }
}
@media (max-width: 600px) {
  /* Product form: one column, with short pairs (price/cost, tax/unit, reorder) side by side. */
  .modal .grid-2 > :not(.half) { grid-column: 1 / -1; }
  .form-extra-actions .btn { flex: 1; }
}

/* ---------------------------------------------------------------- online store: shop header, hours, skeleton */
.shop-name { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.shop-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-bar-logo { width: 32px; height: 32px; flex: none; border-radius: 9px; object-fit: cover; background: var(--fill); }
.shop-hero { padding: 0.5rem 0 0.25rem; }
.shop-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 6; max-height: 300px; width: 100%; border-radius: 22px; background: var(--fill); }
.shop-cover img { width: 100%; height: 100%; object-fit: cover; }
.shop-hero-main { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
/* With a cover photo, the logo overlaps the cover's bottom edge and the name sits underneath. */
.shop-hero.has-cover.has-logo .shop-hero-main { display: block; position: relative; margin-top: -42px; padding: 0 1rem; }
.shop-hero.has-cover.has-logo .shop-hero-text { margin-top: 0.65rem; }
.shop-logo { width: 84px; height: 84px; flex: none; border-radius: 22px; object-fit: cover; background: var(--panel); box-shadow: 0 0 0 4px var(--bg), var(--shadow); }
.shop-hero-text { min-width: 0; }
.shop-hero h1 { margin: 0; line-height: 1.1; }
.shop-tagline { margin: 0.35rem 0 0 !important; }
.shop-open { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0.5rem 0 0 !important; font-size: 0.92rem !important; font-weight: 600; }
.shop-open i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.shop-open.is-open { color: var(--ok-text) !important; }
.shop-open.is-open i { box-shadow: 0 0 0 3px var(--ok-soft); }
.shop-open.is-closed { color: var(--danger) !important; }
.shop-closed-note { margin: 0.85rem 0 0; }
.shop-info { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.9rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.9rem; }
.shop-info li { display: inline-flex; align-items: center; gap: 0.4rem; }
.shop-info .icon { width: 17px; height: 17px; flex: none; }
.shop-contacts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.shop-contact { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 42px; padding: 0 1rem; border-radius: 999px; background: var(--fill); color: var(--text) !important; font-weight: 600; font-size: 0.92rem; text-decoration: none !important; transition: background-color 0.15s var(--ease); }
.shop-contact:hover { background: var(--fill-strong); }
.shop-contact .icon { width: 18px; height: 18px; color: var(--brand); }
.shop-hours { margin-top: 0.75rem; font-size: 0.9rem; }
.shop-hours summary { cursor: pointer; color: var(--brand); font-weight: 600; width: fit-content; }
.shop-hours dl { display: grid; gap: 0.2rem; max-width: 320px; margin: 0.6rem 0 0; }
.shop-hours dl div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0.5rem; border-radius: 8px; }
.shop-hours dl div.today { background: var(--fill); font-weight: 600; }
.shop-hours dt, .shop-hours dd { margin: 0; }
.shop-eta { display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; }
.shop-eta .icon { width: 17px; height: 17px; }

/* Photos fade in when they arrive. */
.store img { opacity: 0; transition: opacity 0.35s var(--ease); }
.store img.is-loaded { opacity: 1; }

/* Skeleton loading: grey shapes with a soft moving sheen. */
.skel { position: relative; overflow: hidden; border-radius: 10px; background: var(--fill); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent); animation: skel-sheen 1.4s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { .skel::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 8%), transparent); } }
@keyframes skel-sheen { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.shop-skeleton .shop-bar { margin-bottom: 0.75rem; }
.skel-title { width: 140px; height: 22px; }
.skel-circle { width: 42px; height: 42px; border-radius: 50%; }
.skel-cover { aspect-ratio: 16 / 6; max-height: 300px; border-radius: 22px; }
.skel-heading { width: 55%; max-width: 320px; height: 34px; margin-top: 1rem; }
.skel-line { height: 13px; margin: 0.25rem 0; }
.skel-line.wide { width: 75%; max-width: 480px; height: 15px; margin-top: 0.7rem; }
.skel-line.short { width: 55%; }
.skel-line.price { width: 40%; height: 16px; margin-top: 0.8rem; }
.skel-row-chips { display: flex; gap: 0.5rem; margin: 0.9rem 0; }
.skel-chip { width: 110px; height: 30px; border-radius: 999px; }
.skel-search { height: 46px; border-radius: 14px; margin-bottom: 1rem; }
.skel-media { aspect-ratio: 1 / 1; border-radius: 0; }
.skel-card { box-shadow: none; }
.skel-row { cursor: default; }
.skel-row .skel-line { flex: 1; max-width: 200px; height: 16px; }
.skel-pill { width: 90px; height: 24px; border-radius: 999px; }

/* Store settings: logo / cover pickers and the opening-hours table. */
.store-media-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.store-media { display: flex; gap: 0.85rem; align-items: center; }
.store-media-pick { position: relative; flex: none; display: grid !important; place-items: center; overflow: hidden; border-radius: 16px; background: var(--fill); cursor: pointer; color: var(--brand) !important; font-weight: 600 !important; font-size: 0.85rem !important; }
.store-media-pick span { display: inline-flex; align-items: center; gap: 0.25rem; }
.store-media-pick .icon { width: 16px; height: 16px; }
.store-media-logo .store-media-pick { width: 84px; height: 84px; }
.store-media-cover .store-media-pick { width: 168px; height: 63px; }
.store-media-pick img { width: 100%; height: 100%; object-fit: cover; }
.store-media-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.store-media-text { display: grid; gap: 0.15rem; font-size: 0.88rem; }
.hours-table { display: grid; gap: 0.4rem; margin-top: 0.6rem; }
.hours-row { display: grid; grid-template-columns: 7rem minmax(0, auto) 1fr; gap: 0.5rem 0.75rem; align-items: start; padding: 0.35rem 0; border-top: 1px solid var(--border); }
.hours-row:first-of-type { border-top: 0; }
.hours-day { font-weight: 500; padding-top: 0.55rem; }
.hours-ranges { display: grid; gap: 0.4rem; justify-items: start; }
.hours-range { display: flex; align-items: center; gap: 0.5rem; }
.hours-row input[type="time"] { min-height: 40px; }
.hours-remove { visibility: hidden; }
.hours-range:not(:only-of-type) .hours-remove { visibility: visible; }
.hours-add { font-size: 0.88rem; padding: 0.15rem 0; }
.hours-row label.checkbox { margin: 0; padding-top: 0.5rem; }
.hours-row.is-closed .hours-ranges { opacity: 0.35; pointer-events: none; }
.hours-help { margin: 0; }
@media (max-width: 600px) {
  .shop-cover, .skel-cover { aspect-ratio: 16 / 8; border-radius: 18px; }
  .shop-logo { width: 68px; height: 68px; border-radius: 18px; }
  .shop-hero.has-cover.has-logo .shop-hero-main { margin-top: -34px; padding: 0 0.75rem; }
  .shop-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .shop-contact { justify-content: center; padding: 0 0.6rem; }
  .hours-row { grid-template-columns: 1fr auto; }
  .hours-day { padding-top: 0.4rem; }
  .hours-ranges { grid-column: 1 / -1; grid-row: 2; }
  .hours-row label.checkbox { grid-column: 2; grid-row: 1; padding-top: 0.35rem; }
  .hours-ranges { justify-items: stretch; min-width: 0; }
  .hours-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 32px; gap: 0.35rem; width: 100%; }
  .hours-range input[type="time"] { min-width: 0; width: 100%; padding-inline: 0.5rem; font-size: 0.95rem; }
  .hours-add { justify-self: start; }
  .area-row { grid-template-columns: 1fr 4.5rem 6rem auto; }
}
.order-item-extra { display: block; color: var(--muted); font-size: 0.82rem; }
.order-map { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.order-map .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- online store: product sheet, options, basket lines */
.shop-card-media { display: block; width: 100%; padding: 0; border: 0; font: inherit; color: inherit; cursor: pointer; }
.shop-card-title { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.shop-price small { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.shop-add.has-qty { font-weight: 700; font-size: 0.95rem; }
.shop-sheet-modal { max-width: 520px; }
.shop-sheet { display: grid; gap: 1rem; }
.shop-sheet-media { overflow: hidden; aspect-ratio: 4 / 3; border-radius: 18px; background: var(--panel-2); }
.shop-sheet-media img { width: 100%; height: 100%; object-fit: contain; }
.shop-sheet-media .shop-card-placeholder .icon { width: 48px; height: 48px; }
.shop-sheet-desc { margin: 0; color: var(--muted); line-height: 1.5; }
.shop-choice { display: grid; gap: 0; margin: 0; padding: 0; border: 0; overflow: hidden; border-radius: 16px; background: var(--fill); }
.shop-choice legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0 0.2rem 0.5rem; font-weight: 600; font-size: 0.95rem; }
.shop-choice .req { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.shop-option { display: grid !important; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: center; min-height: 50px; padding: 0.65rem 0.95rem; color: var(--text) !important; font-size: 0.95rem !important; cursor: pointer; }
.shop-option + .shop-option { border-top: 1px solid var(--border); }
.shop-option input { width: 20px; height: 20px; margin: 0; }
.shop-option .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.shop-option.is-out { opacity: 0.5; cursor: default; }
.shop-option small { color: var(--danger); font-size: 0.75rem; }
.shop-note { display: grid !important; gap: 0.35rem; font-size: 0.85rem; }
.shop-note input { width: 100%; }
.shop-note-hint { margin: -0.2rem 0 0; font-size: 0.8rem; line-height: 1.4; color: var(--warn-text); background: var(--warn-soft); border-radius: 10px; padding: 0.45rem 0.65rem; }
#sheet-add { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; padding-left: 1rem; padding-right: 1rem; }
.shop-sheet-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 0.75rem; align-items: center; margin: 0 -1.5rem -1.5rem; padding: 0.8rem 1.5rem; border-top: 1px solid var(--border); background: var(--panel); }
.shop-sheet-actions .btn { flex: 1; min-height: 52px; }
.shop-stepper-lg button { width: 40px; height: 40px; }
.basket-extra { display: block; color: var(--muted); font-size: 0.8rem; }
.shop-location-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 0.45rem; }
.shop-location-btn .icon { width: 18px; height: 18px; color: var(--brand); }
.shop-location { display: flex; align-items: center; gap: 0.4rem; margin: 0; padding: 0.7rem 0.9rem; border-radius: 14px; background: var(--ok-soft); color: var(--ok-text); font-size: 0.9rem; }
.shop-location .icon { width: 18px; height: 18px; flex: none; }
.shop-location span { flex: 1; }
.shop-remember { flex-wrap: wrap; font-size: 0.9rem !important; }
.shop-remember .link-btn { margin-left: auto; font-size: 0.85rem; }
.my-order-card { display: grid; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.my-order-card .my-order { box-shadow: none; border-radius: 0; background: transparent; }
.my-order-card.my-order-open { box-shadow: var(--shadow), inset 4px 0 0 var(--brand); }
.my-order-items { display: -webkit-box !important; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.my-order-again { justify-self: start; margin: -0.35rem 0 0.75rem 1.1rem; font-weight: 600; }
.shop-notice { position: fixed; left: 50%; top: calc(4.2rem + env(safe-area-inset-top)); z-index: 60; transform: translateX(-50%); max-width: min(92vw, 460px); padding: 0.7rem 1rem; border-radius: 14px; background: #1d1d1f; color: #fff; font-size: 0.9rem; box-shadow: var(--shadow-lift); animation: notice-in 0.25s var(--ease); }
@keyframes notice-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (max-width: 960px) {
  .shop-sheet-actions { margin: 0 -1.1rem -1.3rem; padding: 0.75rem 1.1rem 0.9rem; }
}

/* Store settings: promo codes and the live-link actions. */
.store-live-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.store-live-actions .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.store-live-actions .icon { width: 17px; height: 17px; }
.promo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; align-items: end; margin-top: 1rem; }
.promo-form .form-actions { margin: 0; }
.input-pair { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; }
.input-pair select { width: auto; }
/* Shop checkout: promo code and points. */
.promo-entry { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-top: 0.75rem; }
.promo-entry input { text-transform: uppercase; min-height: 44px; }
.promo-error { margin: 0.4rem 0 0; color: var(--danger); font-size: 0.88rem; }
.promo-line { color: var(--ok-text); }
.promo-line .link-btn { margin-left: 0.4rem; font-size: 0.85rem; }
.points-earned { margin: 0.75rem 0 0; padding: 0.7rem 0.9rem; border-radius: 14px; background: var(--ok-soft); color: var(--ok-text); font-size: 0.92rem; }

/* ---------------------------------------------------------------- order page: live progress */
.order-steps-live li { padding-top: 15px; transition: color 0.35s var(--ease) var(--step-delay, 0s); }
.order-steps-live li::before { display: none; }
.order-steps-live .step-bar { position: absolute; top: 0; left: 0; right: 0; height: 6px; overflow: hidden; border-radius: 6px; background: var(--fill-strong); }
/* The fill grows from the left with an ease that starts and lands softly; each segment waits for the one before. */
.order-steps-live .step-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--ok); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1) var(--step-delay, 0s); will-change: transform; }
.order-steps-live li.done .step-bar i { transform: scaleX(1); }
/* The step being worked on: a soft light moving along it, so the page feels alive. */
.order-steps-live li.current { color: var(--text); font-weight: 600; }
.order-steps-live li.current .step-bar::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(52 199 89 / 55%), transparent); animation: step-sheen 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@keyframes step-sheen { to { transform: translateX(100%); } }
.store-status-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.live-dot { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--ok-soft); color: var(--ok-text); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgb(52 199 89 / 55%); } 70%, 100% { box-shadow: 0 0 0 7px rgb(52 199 89 / 0%); } }
/* A new status slides in. */
.status-changed .status-title, .status-changed .status-detail { animation: status-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.status-changed .status-detail { animation-delay: 0.08s; }
@keyframes status-in { from { opacity: 0; transform: translateY(8px); } }
.store-status-completed.status-changed .status-title, .store-status-celebrate.status-changed .status-title { animation: status-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes status-pop { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .order-steps-live .step-bar i, .order-steps-live li { transition: none; }
  .order-steps-live li.current .step-bar::after, .live-dot::before, .status-changed .status-title, .status-changed .status-detail { animation: none; }
}

/* ---------------------------------------------------------------- online store: add-to-basket motion */
.fly-x { position: fixed; z-index: 80; pointer-events: none; will-change: transform; }
.fly-item { display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: var(--panel); color: var(--brand);
  box-shadow: 0 10px 30px rgb(0 0 0 / 22%), 0 0 0 2px var(--panel); will-change: transform, opacity; }
.fly-item img { width: 100%; height: 100%; object-fit: cover; }
.fly-item .icon { width: 55%; height: 55%; }
.shop-stepper.pop-in { animation: stepper-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; transform-origin: right center; }
@keyframes stepper-in { from { opacity: 0; transform: scale(0.6); } }
.store-bar.is-new { animation: bar-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes bar-up { from { transform: translateY(110%); } }
.shop-add:active, .shop-stepper button:active { transform: scale(0.88); }
.shop-add, .shop-stepper button { transition: transform 0.15s var(--ease), background-color 0.2s var(--ease); }

/* ---------------------------------------------------------------- online store: grid / list */
.shop-search-row { display: flex; gap: 0.5rem; align-items: center; }
.shop-search-row .shop-search { flex: 1; min-width: 0; }
.shop-layout { display: flex; flex: none; gap: 2px; padding: 3px; border-radius: 14px; background: var(--fill); }
.shop-layout button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.shop-layout button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
.shop-layout .icon { width: 20px; height: 20px; }
.shop-card-desc { display: none; }
/* List: photo on the left, name, short description and price beside it. */
.shop-grid.is-list { grid-template-columns: 1fr; gap: 0.6rem; }
.shop-grid.is-list .shop-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: stretch; border-radius: 18px; }
.shop-grid.is-list .shop-card-media { aspect-ratio: auto; height: 100%; min-height: 96px; }
.shop-grid.is-list .shop-card-media img { padding: 0.35rem; }
.shop-grid.is-list .shop-flag { left: 0.35rem; top: 0.35rem; font-size: 0.65rem; padding: 0.15rem 0.45rem; }
.shop-grid.is-list .shop-card-body { padding: 0.7rem 0.85rem; gap: 0.15rem; }
.shop-grid.is-list .shop-card-body h3 { -webkit-line-clamp: 1; }
.shop-grid.is-list .shop-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.shop-grid.is-list .shop-card-foot { padding-top: 0.35rem; }
@media (hover: hover) { .shop-grid.is-list .shop-card:hover { transform: none; } }
/* Grid ↔ list: a soft cross-fade (public/js/store.js, setLayout). */
@media (prefers-reduced-motion: reduce) {
  .shop-stepper.pop-in, .store-bar.is-new { animation: none; }
}
/* Status bar: sales waiting to sync stand out. */
/* The number in its own circle, then the words on one line. */
.statusbar-pending { display: inline-flex; flex: none; align-items: center; gap: 0.45rem; padding: 0.2rem 0.75rem 0.2rem 0.2rem; border-radius: 999px; background: var(--warn); color: #fff !important; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none !important; }
.pending-count { display: grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.35rem; border-radius: 999px; background: #fff; color: var(--warn); font-weight: 800; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.statusbar { flex-wrap: wrap; align-items: center; row-gap: 0.35rem; }
.statusbar-note { color: inherit; opacity: 0.8; }
/* Dark mode: the lighter orange needs dark text to stay readable. */
@media (prefers-color-scheme: dark) {
  .statusbar-pending { color: #1d1d1f !important; }
  .pending-count { background: #1d1d1f; color: var(--warn); }
}

/* Sales → Find receipt: box, scan button and Find on one row, also on phones. */
.form.inline.receipt-find { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; gap: 0.5rem; }
.receipt-find input, .receipt-find .btn, .receipt-find .scan-btn { min-height: 48px; }

/* Till on phones: the register card comes first, then search and scan, then categories. */
@media (max-width: 960px) {
  .pos-products .pos-status-row { order: -1; }
}
/* Deliveries waiting for a driver to accept. */
.driver-wait { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.15rem; color: var(--warn-text); font-weight: 600; font-size: 0.88rem; }
.driver-wait::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: live-pulse 2s ease-out infinite; }
.driver-wait.is-late { color: var(--danger); }
.driver-wait.is-late::before { background: var(--danger); animation: none; }
.btn-attention { box-shadow: inset 0 0 0 2px var(--danger); color: var(--danger); }
/* "Turn on notifications" card (deliveries, online orders, settings). */
.push-card { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding: 0.85rem 1rem; border-radius: 16px; background: var(--brand-soft); }
.push-card[hidden] { display: none; }
.push-card-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); color: var(--brand); }
.push-card-icon.is-on { background: var(--ok-soft); color: var(--ok); }
.push-card-icon .icon { width: 20px; height: 20px; }
.push-card-text { display: grid; gap: 0.15rem; flex: 1; min-width: 0; font-size: 0.92rem; }
.push-card-text small { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.push-card .btn { flex: none; }
.card .push-card { margin-bottom: 0; }
/* Shop order page: notifications. */
.notify-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 0.45rem; margin-top: 0.9rem; }
.notify-btn .icon, .notify-on .icon, .notify-hint .icon { width: 18px; height: 18px; flex: none; }
.notify-on { display: flex; align-items: center; gap: 0.45rem; margin: 0.9rem 0 0; color: var(--ok-text); font-size: 0.9rem; font-weight: 500; }
.notify-hint { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.9rem 0 0; padding: 0.75rem 0.9rem; border-radius: 14px; background: var(--fill); font-size: 0.88rem; line-height: 1.4; }
.notify-hint .icon { margin-top: 0.1rem; color: var(--brand); }

/* Owner tools (Reports → Profit, Slow movers) */
.table td.negative { color: var(--danger); }
.muted.small { font-size: 0.85rem; }

/* Inventory: reorder suggestions, supplier price lists, counting by scanning */
.table-scroll { overflow-x: auto; }
.reorder-table .qty-input { width: 5.5rem; text-align: right; }
.reorder-table td:first-child, .reorder-table th:first-child { width: 2.5rem; }
.price-rows { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 7rem auto; gap: 0.5rem; align-items: center; }
.price-row > span { display: flex; flex-direction: column; min-width: 0; }
.price-note { font-size: 0.8rem; }
.count-tools { display: flex; gap: 0.5rem; align-items: center; }
.count-tools .filter-input { flex: 1; }
.stock-row.just-counted { animation: counted 1.2s ease-out; border-radius: 10px; }
@keyframes counted { from { background: var(--ok-soft); } to { background: transparent; } }
@media (max-width: 640px) {
  .price-row { grid-template-columns: 1fr 1fr auto; }
  .price-row > span { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .stock-row.just-counted { animation: none; background: var(--ok-soft); } }

/* Loyalty tiers, birthdays and promotions */
.badge-tier { background: var(--brand-soft); color: var(--brand); }
.tier-line { margin: 0.25rem 0; }
.tier-row { display: grid; grid-template-columns: minmax(0, 1fr) 11rem 7rem auto; gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.inline-label { font-size: 0.8rem; }
.birthday-list, .campaign-list { display: grid; gap: 0.5rem; }
.birthday-row, .campaign-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.birthday-row > span:nth-child(2), .campaign-row > span:first-child { flex: 1; min-width: 10rem; }
.birthday-when { font-weight: 600; min-width: 5.5rem; }
.message-buttons { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.message-sample { background: var(--fill); border-radius: 12px; padding: 0.75rem 1rem; white-space: pre-wrap; margin: 0.5rem 0; }
.campaign-preview { min-height: 1.5rem; }
.campaign-row .sent-mark { visibility: hidden; color: var(--ok); font-weight: 700; }
.campaign-row.is-sent .sent-mark { visibility: visible; }
.campaign-row.is-sent strong { color: var(--muted); }
@media (max-width: 640px) { .tier-row { grid-template-columns: 1fr 1fr auto; } .tier-row > input:first-child { grid-column: 1 / 3; } .tier-row > button { grid-column: 3; grid-row: 1; } .tier-row > label { grid-row: 2; } .tier-row > label:nth-of-type(2) { grid-column: 2 / 4; } }

/* Passkeys */
.or-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin: 1rem 0 0.75rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.passkey-btn svg { width: 1.1rem; height: 1.1rem; }
.passkey-hint { margin-top: 0.5rem; text-align: center; }
.passkey-list { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.passkey-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }

/* Dhivehi: Thaana letters use MV Aaamu FK (only those letters, so numbers and English keep the
   system font), and the app runs right to left. Receipts and documents stay left to right. */
@font-face {
  font-family: "EasyPOS Thaana";
  src: url("/fonts/mv-aaamu-fk.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0780-07BF, U+060C, U+061B, U+061F;
}
html.lang-dv { font-family: "EasyPOS Thaana", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif; }
html.lang-dv body, html.lang-dv button, html.lang-dv input, html.lang-dv select, html.lang-dv textarea { font-family: inherit; }
html.lang-dv { line-height: 1.6; }
html.lang-dv .receipt, html.lang-dv .doc, html.lang-dv .doc-frame, html.lang-dv .receipt-frame { direction: ltr; }
/* Sentences still in English keep their punctuation in the right place. */
html.lang-dv :is(p, li, small, h1, h2, h3, th, td, label, .toast, .callout span) { unicode-bidi: plaintext; text-align: right; }
html.lang-dv .num, html.lang-dv input[inputmode="decimal"], html.lang-dv input[inputmode="numeric"], html.lang-dv input[type="tel"], html.lang-dv input[type="email"] { direction: ltr; unicode-bidi: plaintext; }
html.lang-dv .num { text-align: left; }
.lang-switch { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }
.lang-switch .is-current { font-weight: 700; text-decoration: underline; }
.lang-choice { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Settings → Language */
.lang-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.lang-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 1rem 1.1rem; border-radius: var(--radius-lg, 16px); border: 2px solid var(--border); background: var(--panel); color: var(--text); text-align: start; cursor: pointer; font: inherit; }
.lang-option.is-current { border-color: var(--brand); background: var(--brand-soft); }
.lang-option .lang-name { font-size: 1.35rem; font-weight: 700; font-family: "EasyPOS Thaana", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.lang-option .lang-english { font-size: 0.85rem; color: var(--muted); }
.lang-option small { display: block; width: 100%; color: var(--muted); font-family: "EasyPOS Thaana", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.lang-option .lang-tick { position: absolute; inset-inline-end: 1rem; top: 1rem; color: var(--brand); font-weight: 700; }

/* Plan & billing: how paying works */
.how-to-pay ol { margin: 0; padding-inline-start: 1.25rem; display: grid; gap: 0.35rem; }

/* Where to pay: bank accounts in the payment window, and the admin form */
.pay-accounts { display: grid; gap: 0.6rem; }
.pay-account { display: grid; gap: 0.3rem; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--fill); }
.pay-bank { font-weight: 700; }
.pay-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pay-row small { min-width: 7.5rem; }
.pay-number { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; font-size: 1.05rem; direction: ltr; unicode-bidi: plaintext; }
.bank-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.bank-head h2 { margin: 0 0 0.2rem; }
.bank-head p { margin: 0; }
.bank-accounts { display: grid; gap: 0.6rem; }
.bank-item { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--fill); }
.bank-item-main { display: grid; gap: 0.15rem; min-width: 0; }
.bank-number { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; font-weight: 600; }
.bank-item-actions { display: flex; gap: 0.4rem; }
.bank-note { margin-top: 0.75rem; font-size: 0.9rem; display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: baseline; }
@media (max-width: 640px) { .bank-head .btn { width: 100%; } .bank-item-actions { width: 100%; } .bank-item-actions .btn { flex: 1; } }

/* ------------------------------------------------------------------ Settings
   Computers: a grouped side menu and the open section beside it.
   Phones: a grouped list (profile first); each row opens its section with a back link. */
.settings-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 2rem; align-items: start; }
.settings-nav { position: sticky; top: 1rem; display: grid; gap: 1.1rem; padding: 0.25rem 0; }
.settings-nav-title { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 0.25rem 0.5rem; }
.settings-nav-group { display: grid; gap: 2px; }
.settings-nav-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 0.6rem 0.35rem; }
.settings-nav-link { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0.6rem; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 0.93rem; font-weight: 500; transition: background 0.15s var(--ease); }
.settings-nav-link:hover { background: var(--fill); }
.settings-nav-link.is-active { background: var(--panel); box-shadow: var(--shadow); font-weight: 600; }
.settings-icon { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: #8e8e93; }
.settings-icon svg { width: 16px; height: 16px; }
.tint-gray { background: #8e8e93; } .tint-graphite { background: #636366; } .tint-dark { background: #48484a; }
.tint-blue { background: #0071e3; } .tint-sky { background: #007aff; } .tint-cyan { background: #30b0c7; } .tint-teal { background: #00a693; }
.tint-green { background: #34c759; } .tint-orange { background: #ff9500; } .tint-red { background: #ff3b30; } .tint-pink { background: #ff2d55; }
.tint-purple { background: #af52de; } .tint-indigo { background: #5e5ce6; }
.settings-content { min-width: 0; }
.settings-head { margin: 0.35rem 0 1.25rem; }
.settings-head h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 0.2rem; }
.settings-head p { margin: 0; }
.settings-back { display: none; }
.settings-content #tab-body > .card:first-child, .settings-content #tab-body > section:first-child { margin-top: 0; }

/* Phones */
.settings-home { display: grid; gap: 1.25rem; }
.settings-home .page-header { margin-bottom: 0; }
.settings-profile { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.settings-avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; color: #fff; background: linear-gradient(145deg, #0a84ff, #5e5ce6); }
.settings-profile-text, .settings-row-text { display: grid; gap: 0.1rem; min-width: 0; flex: 1; }
.settings-profile-text strong { font-size: 1.05rem; }
.settings-profile-text small, .settings-row-text small { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.settings-group-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.45rem 1rem; }
.settings-list { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 1rem; color: var(--text); text-decoration: none; position: relative; }
.settings-row + .settings-row::before { content: ""; position: absolute; top: 0; inset-inline-start: calc(1rem + 28px + 0.85rem); inset-inline-end: 0; border-top: 1px solid var(--border); }
.settings-row:active { background: var(--fill); }
.settings-row-text strong { font-weight: 500; font-size: 0.98rem; }
.settings-chevron { color: var(--muted); font-size: 1.4rem; line-height: 1; opacity: 0.6; }
html[dir="rtl"] .settings-chevron { transform: scaleX(-1); }
/* Sheets (More menu, page actions): the same grouped list on the sheet's grey */
.more-sheet { display: grid; gap: 1rem; }
.more-sheet .settings-group-title { margin-top: 0; }
.modal .settings-profile, .modal .settings-list { background: var(--fill); box-shadow: none; }
.modal .settings-row:hover { background: var(--fill-strong); }
.modal .settings-row + .settings-row::before { border-color: var(--border); }
.action-list .settings-row { width: 100%; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; }
a.settings-row:hover, .settings-row:hover { text-decoration: none; }
@media (hover: hover) { .settings-list .settings-row:hover { background: var(--fill); } .modal .settings-list .settings-row:hover { background: var(--fill-strong); } }

@media (max-width: 900px) {
  .settings-layout { display: block; }
  .settings-nav { display: none; }
  .settings-back { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--brand); text-decoration: none; font-weight: 500; margin: 0.25rem 0 0.5rem; }
  .settings-head h1 { font-size: 1.75rem; }
}
.settings-nav-link, .settings-nav-link:hover, .settings-nav-link span, .settings-row, .settings-profile { text-decoration: none; }
/* Figures beside a section menu have less room: wider tiles, amounts kept on one line. */
.settings-content .stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.settings-content .stat strong { white-space: nowrap; }
.section-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .section-actions .btn-primary { flex: 1 1 100%; } }
/* Close register: open bills still to be paid */
.open-bill-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; cursor: default; }
.open-bill-actions { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.text-warn td { color: var(--warn); font-weight: 600; }
@media print { .text-warn td { color: #000; } }
/* A feature the plan doesn't include */
.upgrade-card { text-align: center; display: grid; justify-items: center; gap: 0.5rem; padding: 2rem 1.5rem; }
.upgrade-card h2 { margin: 0; }
.upgrade-card p { margin: 0; max-width: 34rem; }
.upgrade-lock { font-size: 1.8rem; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--fill); }
.upgrade-card .btn { margin-top: 0.5rem; }
.plan-modules { display: grid; gap: 0.35rem; border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1rem; }
.plan-modules legend { font-weight: 600; padding: 0 0.35rem; }
.scan-btn[hidden] { display: none; }
/* Shop checkout: gift card */
.gift-entry { margin-top: 0.75rem; }
.gift-entry summary { cursor: pointer; color: var(--brand); font-weight: 500; }
button.till-pill { border: 0; font: inherit; cursor: pointer; }
/* Shop: reading a transfer slip */
.slip-reading { margin: 0; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--fill); font-size: 0.9rem; }
.slip-reading.is-ok { background: var(--ok-soft); color: var(--ok-text); }
.slip-reading.is-warn { background: var(--warn-soft); color: var(--warn-text); }
.slip-fields { display: grid; gap: 0.75rem; }
.slip-fields[hidden] { display: none; }
.slip-check { display: grid; grid-template-columns: minmax(0, 200px) 1fr; gap: 1rem; align-items: start; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.slip-check h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.slip-check .slip-full { max-height: 320px; width: 100%; object-fit: contain; border-radius: 10px; background: var(--fill); }
.slip-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.slip-checks .check-ok { color: var(--ok-text); }
.slip-checks .check-warn { color: var(--warn-text); }
@media (max-width: 640px) { .slip-check { grid-template-columns: 1fr; } }
.slip-found { display: grid; gap: 0.35rem; margin: 0; padding: 0.75rem 0.9rem; border-radius: 12px; background: var(--fill); }
.slip-found[hidden] { display: none; }
.slip-found div { display: flex; justify-content: space-between; gap: 1rem; }
.slip-found dt { color: var(--muted); }
.slip-found dd { margin: 0; text-align: end; }
.slip-found .slip-tally { padding-top: 0.35rem; border-top: 1px solid var(--border); font-weight: 600; }
.slip-found .slip-tally.is-ok dd { color: var(--ok-text); }
.slip-found .slip-tally.is-warn dd { color: var(--warn-text); }

/* ------------------------------------------------------------------ Online orders (grouped-list look) */
.order-filters { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 1.25rem; padding: 2px; }
.order-filters::-webkit-scrollbar { display: none; }
.order-filter { flex: none; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.9rem; border: 0; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.order-filter .dot { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; }
.order-filter.filter-check .dot { background: #ff9500; }
.order-filter.filter-new .dot { background: #0071e3; }
.order-filter.filter-preparing .dot { background: #5e5ce6; }
.order-filter.filter-ready .dot { background: #34c759; }
.order-filter.filter-out_for_delivery .dot { background: #00a693; }
.order-filter.is-active { background: var(--text); color: var(--panel); box-shadow: none; }
.order-filter-count { min-width: 1.3rem; height: 1.3rem; padding: 0 0.35rem; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; }
.order-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; align-items: start; }
.order-card, .order-card.order-new, .order-card.order-ready, .order-card.order-accepted { margin: 0; padding: 1rem; display: grid; gap: 0.85rem; background: var(--panel); border: 0; border-radius: 20px; box-shadow: var(--shadow); }
.order-head { display: flex; align-items: center; gap: 0.75rem; }
.order-head .settings-icon { width: 40px; height: 40px; border-radius: 12px; }
.order-head .settings-icon svg { width: 22px; height: 22px; }
.order-title { flex: 1; min-width: 0; display: grid; }
.order-card h3, .order-title h3 { margin: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-sub { color: var(--muted); font-size: 0.82rem; }
.order-business { color: var(--text); font-weight: 600; }
.invite-code { font-size: 1.8rem; letter-spacing: 0.12em; text-align: center; margin: 0.5rem 0; }
.invite-qr { display: grid; place-items: center; }
.invite-qr svg { width: 220px; height: 220px; }
.order-status { flex: none; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--fill); color: var(--muted); }
.order-status.status-new { background: rgb(0 113 227 / 12%); color: #0062c4; }
.order-status.status-preparing { background: rgb(94 92 230 / 14%); color: #4b49c9; }
.order-status.status-ready, .order-status.status-out_for_delivery { background: var(--ok-soft); color: var(--ok-text); }
.order-status.status-rejected { background: rgb(255 59 48 / 12%); color: var(--danger); }
.order-card .order-steps { margin: 0; }
.order-rows { background: var(--fill); box-shadow: none; border-radius: 14px; }
.order-rows .settings-row { padding: 0.6rem 0.8rem; gap: 0.7rem; }
.order-rows .settings-row + .settings-row::before { inset-inline-start: calc(0.8rem + 28px + 0.7rem); }
.order-rows .settings-row-text strong { font-size: 0.92rem; }
.order-rows a.settings-row:hover, .order-rows button.settings-row:hover { background: var(--fill-strong); }
.order-slip-row { width: 100%; border: 0; background: transparent; font: inherit; color: var(--text); text-align: start; cursor: pointer; }
.order-slip-thumb { flex: none; width: 28px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--panel); }
.order-rows .order-map { font-size: 0.82rem; margin-top: 0.15rem; }
.pay-ok { color: var(--ok-text); }
.pay-warn { color: var(--warn-text); }
.pay-danger { color: var(--danger); }
.text-warn-strong { color: var(--warn-text) !important; font-weight: 600; }
.order-items { margin: 0; padding: 0; }
.order-items li { padding: 0.35rem 0; font-size: 0.93rem; }
.order-items b { font-weight: 600; color: var(--muted); }
.order-items li.order-total { border-bottom: 0; padding-top: 0.55rem; font-weight: 700; font-size: 1.02rem; }
.order-items li.to-collect .num { color: var(--brand); }
.order-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; }
.order-actions:empty { display: none; }
.order-actions .btn { width: 100%; white-space: normal; line-height: 1.2; min-height: 2.75rem; }
.order-card .ready-note { margin: 0; }
@media (max-width: 640px) { .order-list { grid-template-columns: 1fr; } }
/* Sales → Bank payments: resolving a transfer */
.stat-warn strong { color: var(--warn-text); }
.resolve-list { background: var(--fill); box-shadow: none; }
.resolve-list .settings-row { width: 100%; border: 0; background: transparent; font: inherit; color: var(--text); text-align: start; cursor: pointer; }
.resolve-list .settings-row:hover { background: var(--fill-strong); }
.resolve-action { color: var(--brand); font-weight: 600; }
.danger-zone { box-shadow: var(--shadow), inset 0 0 0 1px rgb(255 59 48 / 25%); }
.danger-zone h2 { color: var(--danger); }
.poster-preview { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }

/* ---------------------------------------------------------------- Settings → Bank payments (grouped list) */
.bank-settings, .bank-form, .bank-form > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.bank-form [hidden] { display: none; }
.settings-group-note { margin: 0.45rem 1rem 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.control-row { cursor: pointer; }
.control-row .settings-row-text { margin-inline-end: 0.5rem; }
button.settings-row { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: start; cursor: pointer; }
/* switch */
.switch { position: relative; flex: none; width: 51px; height: 31px; display: inline-block; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-strong, rgb(120 120 128 / 24%)); transition: background-color 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 18%); transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
/* controls on the right of a row */
.row-select, .row-input { flex: none; max-width: 46%; border: 0; border-radius: 10px; background: var(--fill); color: var(--text); font: inherit; font-size: 0.92rem; padding: 0.45rem 0.65rem; min-height: 36px; }
.row-input { width: 11rem; }
.secret-input { letter-spacing: 0.08em; }
.row-number { width: 5rem; text-align: center; padding-inline: 0.4rem; }
.row-unit { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); }
.volume-range { flex: none; width: 40%; max-width: 220px; accent-color: var(--brand); }
@media (max-width: 520px) {
  .stack-on-phone { flex-wrap: wrap; }
  .stack-on-phone .row-input { width: auto; flex: 1 1 100%; max-width: none; margin-inline-start: calc(28px + 0.85rem); min-width: 0; }
}
/* status dots */
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-inline-end: 0.4rem; vertical-align: 1px; }
.dot-ok { background: #34c759; } .dot-warn { background: #ff9500; } .dot-danger { background: #ff3b30; }
.activity-rows .settings-row { align-items: flex-start; }
.activity-rows .dot { margin-top: 0.45rem; }
.activity-rows .settings-row-text strong { font-size: 0.9rem; font-weight: 400; }
.activity-rows .settings-row + .settings-row::before { inset-inline-start: 2.2rem; }
/* status card */
.bank-hero { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem; display: grid; gap: 0.9rem; }
.bank-hero-head { display: flex; align-items: center; gap: 0.9rem; }
.bank-hero-head h2 { margin: 0; font-size: 1.15rem; }
.bank-hero-head p { margin: 0.15rem 0 0; font-size: 0.88rem; }
.bank-hero-icon { position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.bank-hero-icon .icon { width: 28px; height: 28px; }
.bank-hero-pulse { position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: bank-pulse 2.4s ease-out infinite; z-index: -1; }
.bank-hero-icon { z-index: 0; }
@keyframes bank-pulse { 0% { opacity: 0.45; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(1.5); } }
.bank-hero .settings-list { background: var(--fill); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .bank-hero-pulse { animation: none; } }
/* pairing: QR straight away, code on a number pad */
.pair-qr-loading { width: 240px; aspect-ratio: 1; margin: 1rem auto; border-radius: 12px; background: var(--fill); animation: pair-shimmer 1.2s ease-in-out infinite alternate; }
@keyframes pair-shimmer { to { opacity: 0.45; } }
.pair-lead { text-align: center; }
.code-boxes { display: flex; justify-content: center; gap: 0.45rem; margin: 0.75rem 0 1rem; }
.code-box { width: 2.6rem; height: 3.2rem; border-radius: 12px; background: var(--fill); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; border: 2px solid transparent; }
.code-box.is-next { border-color: var(--brand); }
.code-box.is-filled { background: var(--panel); border-color: var(--border); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; max-width: 300px; margin: 0 auto; }
.numpad-key { height: 56px; border: 0; border-radius: 14px; background: var(--fill); color: var(--text); font: inherit; font-size: 1.45rem; font-weight: 600; cursor: pointer; transition: transform 0.08s, background-color 0.15s; }
.numpad-key:active { transform: scale(0.95); background: var(--fill-strong, rgb(120 120 128 / 24%)); }
.numpad-back { font-size: 1.2rem; }
.pair-done { text-align: center; }
.pair-done-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #34c759; color: #fff; font-size: 1.7rem; font-weight: 700; margin-bottom: 0.4rem; }

/* ---------------------------------------------------------------- Reports → GST return (MIRA) */
.expense-gst[hidden] { display: none; }
.gst-page { display: grid; gap: 1rem; }
.gst-period { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.gst-period select { min-height: 40px; }
.gst-issues ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.gst-issues li { margin: 0.25rem 0; }
.gst-warnings { margin: 0; padding-left: 1.1rem; color: var(--warn-text); font-size: 0.9rem; }
.gst-figures td:first-child { width: 70%; }
.gst-figures .gst-total td { border-top: 2px solid var(--text); font-size: 1.05rem; }
.gst-downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; margin-bottom: 0.8rem; }
.gst-download { display: grid; gap: 0.4rem; align-content: start; padding: 0.9rem; border-radius: 14px; background: var(--fill); }
.gst-download p { margin: 0; font-size: 0.86rem; }
.gst-download .btn { justify-self: start; }
.gst-steps { margin: 0.5rem 0 1rem; }
.row-warn td { background: var(--warn-soft); }

/* ---------------------------------------------------------------- option groups: "Used on" */
.used-on { display: grid; gap: 0.4rem; }
.used-on-cats { display: grid; gap: 0.15rem; max-height: 220px; overflow: auto; }
.used-on-dishes summary { cursor: pointer; font-weight: 500; padding: 0.3rem 0; }
.used-on-search { width: 100%; margin: 0.3rem 0; }
.used-on-list { display: grid; gap: 0.15rem; max-height: 240px; overflow: auto; }
.used-on-list label[hidden] { display: none; }
.used-on-list .via-cat { display: none; }
.used-on-list .is-covered { opacity: 0.6; }
.used-on-list .is-covered .via-cat { display: inline; }
.option-links .is-locked { opacity: 0.75; }

/* ---------------------------------------------------------------- product options (online store and till)
   One section per group: name and whether it's required, then rows. One-choice groups are radio
   rows (tap the chosen one again to clear an optional group); others have − n + steppers, so the
   same extra can be added more than once, up to the group's maximum. */
.opt-group { display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.opt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; padding: 0 0.15rem; }
.opt-head h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.opt-req { flex: none; font-size: 0.74rem; font-weight: 600; color: var(--muted); background: var(--fill); padding: 0.2rem 0.55rem; border-radius: 999px; }
.opt-req.is-required { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.tried .opt-group.is-needed .opt-req { color: #fff; background: var(--danger); }
.opt-list { display: grid; border-radius: 16px; background: var(--fill); overflow: hidden; }
.opt-row { position: relative; display: flex; align-items: center; gap: 0.75rem; min-height: 54px; padding: 0 0.95rem; border: 0; background: transparent; color: var(--text); font: inherit; text-align: start; width: 100%; transition: background-color 0.15s; }
button.opt-row { cursor: pointer; }
.opt-row + .opt-row::before { content: ""; position: absolute; top: 0; left: 0.95rem; right: 0; border-top: 1px solid var(--border); }
.opt-row.is-on { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.opt-name { flex: 1; min-width: 0; font-size: 0.97rem; }
.opt-row.is-on .opt-name { font-weight: 600; }
.opt-price { flex: none; color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.opt-row.is-on .opt-price { color: var(--text); }
.opt-radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong, rgb(120 120 128 / 45%)); display: grid; place-items: center; transition: border-color 0.15s, background-color 0.15s; }
.opt-row.is-on .opt-radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--panel); }
.opt-main { flex: 1; display: flex; align-items: center; gap: 0.75rem; min-width: 0; min-height: 54px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.opt-main:disabled { cursor: default; opacity: 0.45; }
.opt-stepper { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.opt-stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); font-size: 1.1rem; cursor: pointer; padding: 0; }
.opt-stepper .icon { width: 16px; height: 16px; }
.opt-stepper .opt-plus { background: var(--brand); color: #fff; box-shadow: none; }
.opt-stepper button:disabled { opacity: 0.35; cursor: default; }
.opt-count { min-width: 1.4rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.modifier-form .opt-group { margin-bottom: 0.4rem; }

/* ---------------------------------------------------------------- driver delivery bonuses */
.bonus-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: end; margin-bottom: 0.5rem; }
.bonus-row .icon-btn { margin-bottom: 0.3rem; }
.bonus-card { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); padding: 0.9rem 1rem; margin-bottom: 1rem; display: grid; gap: 0.5rem; }
.bonus-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.bonus-head span { color: var(--muted); font-size: 0.9rem; }
.bonus-bar { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bonus-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34c759, #30b0c7); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.bonus-card p { margin: 0; font-size: 0.92rem; }
.used-on-cats .depth-1 { padding-inline-start: 1.2rem; } .used-on-cats .depth-2 { padding-inline-start: 2.4rem; }
.used-on-cats .depth-3 { padding-inline-start: 3.6rem; } .used-on-cats .depth-4 { padding-inline-start: 4.8rem; }

/* Expenses: upload the supplier's invoice (read on the device) */
.invoice-upload { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem; border: 1px dashed var(--border); border-radius: 10px; }
.invoice-pick { cursor: pointer; }
.invoice-upload #invoice-status { flex: 1 1 14rem; }
.expense-actions { white-space: nowrap; }
.expense-actions .link-btn + .link-btn { margin-left: 0.5rem; }
/* Product form: margin ⇄ price */
.margin-note { margin: -0.25rem 0 0; }
/* Free trial badge: calm until the last 3 days */
.badge-trial { background: rgb(255 255 255 / 12%); color: #c7d2fe; }
.mobile-who a { color: inherit; }
.mobile-who a.trial-soon { color: var(--warn); font-weight: 600; }
