/* Savorily brand, applied to the dashboard, the kitchen, the platform page and the sign-up pages.
   Loaded after glass.css: it keeps the same variable names and gives them the brand's values, then flattens the
   glass (no blur, no gradients) into calm, solid surfaces. See docs/brand/ for the brand book and the UI prototype.
   Rules: tokens only (no hard-coded hex in screens), one accent dot, status never by colour alone, Arabic mirrored. */

:root {
  --sv-paper: #F8F1E4; --sv-sand: #EFE3D0; --sv-ink: #0E2F33; --sv-teal: #1F6F6B; --sv-clay: #9A4529; --sv-sun: #F0B44C;
  --sv-blush: #E8C4B0; --sv-night: #0A2024;
  --sv-dot: var(--sv-clay);

  --f-head: 'Bricolage Grotesque', 'Alexandria', system-ui, sans-serif;
  --f-body: 'Inter', 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
  /* surfaces */
  --bg: #F4F1EA;
  --glass: #FFFFFF; --glass-strong: #FFFFFF; --glass-line: #E4DCCB;
  --field: #FFFFFF; --surface: #FFFFFF; --surface-2: #FAF7F1; --card: #FFFFFF;
  --line: #E4DCCB;
  --shadow: 0 1px 2px rgba(14, 47, 51, .05), 0 8px 24px -16px rgba(14, 47, 51, .22);
  --shadow-lift: 0 1px 2px rgba(14, 47, 51, .06), 0 18px 36px -20px rgba(14, 47, 51, .30);
  /* text */
  --text: #0E2F33; --muted: #586B6B;
  /* brand */
  --brand: #1F6F6B; --on-brand: #FFFFFF; --brand-soft: #E3EFEC; --accent: #9A4529;
  /* state colours: text and soft background */
  --ok: #14543A;     --ok-bg: #DDF2E6;
  --danger: #8C2B17; --danger-bg: #FBDDD3;
  --warn: #7A4B00;   --warn-bg: #FBE9C2;
  --info: #1F5E8E;   --info-bg: #DCEBF7;
  --bar: #1F6F6B;
  /* shape */
  --r: 14px; --r-sm: 10px; --blur: 0px;
  /* the sidebar / rail is always deep */
  --side: #0B1B1E; --side-text: #9DB8B3; --side-on: #F4EBDC; --side-line: #1B3338; --side-raised: #173238;
}

:root[data-theme=dark] {
  color-scheme: dark;
  --sv-dot: var(--sv-sun);
  --bg: #081518;
  --glass: #0F2226; --glass-strong: #0F2226; --glass-line: #1F3A40;
  --field: #13292E; --surface: #0F2226; --surface-2: #13292E; --card: #0F2226;
  --line: #1F3A40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -16px rgba(0, 0, 0, .6);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .45), 0 20px 40px -20px rgba(0, 0, 0, .7);
  --text: #EDE6D8; --muted: #8FAAA6;
  --brand: #F0B44C; --on-brand: #0A2024; --brand-soft: #1A3037; --accent: #E9906E;
  --ok: #7BD3A0;     --ok-bg: #12332A;
  --danger: #FF9A7E; --danger-bg: #3E1D15;
  --warn: #F0B44C;   --warn-bg: #3A2D10;
  --info: #8DBBE6;   --info-bg: #14304A;
  --bar: #F0B44C;
  --side: #050F11; --side-line: #122326; --side-raised: #10262a;
}

html[lang=ar] {
  --f-head: 'Alexandria', 'Bricolage Grotesque', system-ui, sans-serif;
  --f-body: 'Noto Sans Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Type ---------- */
body, body.ui2, button, input, select, textarea { font-family: var(--f-body); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[lang=ar] body { line-height: 1.7; }
.ui2 h1, .ui2 h2, .ui2 h3, .ui2 h4, .ui2 .u-top .u-hello strong, .ui2 .tile strong, .ui2 .u-widget .big, .ui2 .u-hero-nums strong, header h1 {
  font-family: var(--f-head);
}
.ui2 h1, .ui2 h2 { font-weight: 800; letter-spacing: -.02em; }
.ui2 h3 { font-weight: 700; }
html[lang=ar] .ui2 :is(h1, h2, h3, h4) { font-weight: 700; letter-spacing: 0; }
/* numbers in IBM Plex Mono, tabular, so columns and totals line up */
.ui2 .tile strong, .ui2 .u-widget .big, .ui2 .u-hero-nums strong, .ui2 table.data td:last-child, .ui2 .num, #clock, .t-age {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.ui2 .tile strong { font-weight: 500; }
.ui2 .u-widget .big, .ui2 .u-hero-nums strong { font-weight: 500; }
html[lang=ar] .ui2 :is(.tile strong, .u-widget .big, .u-hero-nums strong) { letter-spacing: 0; }

/* ---------- Flat, solid surfaces: no gradient background, no blur ---------- */
body.ui2 { background: var(--bg); }
body.ui2::before { display: none; }
.ui2 .card, .ui2 .tile, .ui2 .u-rail, .ui2 .u-top, .ui2 .u-pop, .ui2 dialog, .ui2 .u-widget, .ui2 .toast, .ui2 .save-bar, .ui2 .u-tabs, .ui2 .settings-tabs,
header, .ktabs button, .ticket {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ui2 .card, .ui2 .tile, .ui2 .u-widget, .ui2 .u-top, .ui2 .u-pop, .ui2 dialog, .ui2 .u-tabs { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.ui2 .card .card, .ui2 .opt-card, .ui2 .coach-row, .ui2 .qr-tile { background: var(--surface-2); box-shadow: none; }
.ui2 .tile:hover, .ui2 .u-widget:hover { transform: none; box-shadow: var(--shadow); }
.ui2 dialog::backdrop { background: rgba(8, 21, 24, .5); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ui2 .u-top, .ui2 .u-rail { background: var(--surface); }
.ui2 .u-top { border-radius: var(--r); }

/* ---------- Controls ---------- */
.ui2 .btn { border-radius: var(--r-sm); box-shadow: none; font-weight: 600; background: var(--surface); }
.ui2 .btn:not(:disabled):hover { transform: none; border-color: var(--brand); }
.ui2 .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: none; }
.ui2 .btn.primary:not(:disabled):hover { filter: brightness(1.08); border-color: var(--brand); }
.ui2 .btn.ghost { background: transparent; }
.ui2 input, .ui2 select, .ui2 textarea { border-radius: var(--r-sm); background: var(--surface); }
.ui2 input:focus-visible, .ui2 select:focus-visible, .ui2 textarea:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }
.ui2 .pill { font-weight: 600; }
.ui2 .meter i { background: var(--ok); }
.ui2 .u-tab.active { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.ui2 .u-tabs { padding: 4px; border-radius: 14px; }
.ui2 .u-tab { border-radius: 10px; }
.ui2 .u-bars i { background: color-mix(in srgb, var(--brand) 24%, transparent); }
.ui2 .u-bars i.today { background: var(--brand); }
.ui2 .u-seg button[aria-checked=true], .ui2 .segmented button.active, .ui2 .nav button.active { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.ui2 .toast { background: var(--text); color: var(--bg); border: 0; box-shadow: var(--shadow-lift); }
.ui2 .toast.err { background: var(--danger); color: var(--surface); }
.ui2 .ai-btn { background: var(--brand-soft); }

/* ---------- The rail: deep, with the accent bar on the current screen ---------- */
.ui2 .u-rail { background: var(--side); border: 1px solid var(--side-line); border-radius: 20px; box-shadow: none; }
.ui2 .u-rail .u-logo { color: var(--side-on); --sv-dot: var(--sv-sun); }
.ui2 .u-rail button, .ui2 .u-rail a { color: var(--side-text); }
.ui2 .u-rail button:hover, .ui2 .u-rail a:hover { background: var(--side-raised); color: var(--side-on); }
.ui2 .u-rail button.active, .ui2 .u-rail a.active { background: var(--side-raised); color: var(--side-on); box-shadow: inset 3px 0 0 var(--sv-sun); }
[dir=rtl] .ui2 .u-rail button.active, [dir=rtl] .ui2 .u-rail a.active { box-shadow: inset -3px 0 0 var(--sv-sun); }
.ui2 .u-rail .u-sep { background: var(--side-line); }
.ui2 .u-rail .u-dot { box-shadow: 0 0 0 2px var(--side); background: var(--sv-sun); }
.ui2 .u-rail [data-tip]::after { background: var(--text); color: var(--bg); border: 0; }
@media (max-width: 899px) { .ui2 .u-rail { border-radius: 20px; } }

/* ---------- Sign-in and small pages ---------- */
.ui2 .auth-card { border-radius: 18px; }
.sv-auth-brand { display: flex; justify-content: center; color: var(--text); margin: 4px 0 6px; }
.sv-auth-brand [data-sv-wordmark] { display: block; }

/* ---------- Kitchen: read from across the room ---------- */
header { background: var(--surface); border: 1px solid var(--line); box-shadow: none; border-radius: var(--r); }
.ticket { background: var(--surface); border-color: var(--line); box-shadow: none; }
.t-head b, .ticket .t-head b { font-family: var(--f-mono); font-weight: 500; }

@media (prefers-reduced-motion: reduce) { .ui2 .btn { transition: none; } }

.sv-k-logo { color: var(--text); display: grid; place-items: center; }

/* ---------- Overview (home) ---------- */
.ui2 .u-hero-nums { gap: 44px; }
.ui2 .u-trend { font-family: var(--f-mono); font-weight: 500; font-size: .82rem; }
.u-hours { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 10px; }
.u-hours i { flex: 1; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--brand) 30%, transparent); min-height: 3px; }
.u-hours i.now { background: var(--brand); }
.u-hours-axis { display: flex; justify-content: space-between; color: var(--muted); font: 500 .72rem var(--f-mono); margin-top: 6px; }
.u-toplist, .u-attn { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.u-toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.u-toplist li:last-child { border-bottom: 0; }
.u-attn li { padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.u-attn li:last-child { border-bottom: 0; }
.u-empty { color: var(--muted); padding: 10px 0 4px; }

/* The platform is a different place from a café's dashboard: its rail says so. */
.ui2 .u-rail .sv-mode { font: 500 .6rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sv-sun); text-align: center; margin: -2px 0 8px; }
html[lang=ar] .ui2 .u-rail .sv-mode { letter-spacing: 0; font-family: var(--f-body); font-size: .68rem; }
@media (max-width: 899px) { .ui2 .u-rail .sv-mode { display: none; } }

/* ---------- Small shared pieces (see /ui/components.html) ---------- */
.sv-skeleton { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sv-shimmer 1.4s linear infinite; min-height: 14px; }
@keyframes sv-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sv-skeleton { animation: none; } }
.sv-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.sv-empty b { color: var(--text); font-family: var(--f-head); }
.sv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 600; }
.sv-chip.on { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); color: var(--brand); }
.ui2 input.sv-switch { appearance: none; -webkit-appearance: none; width: 42px; min-width: 42px; height: 24px; padding: 0; margin: 0; flex: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; border: 0; transition: background .15s; }
.sv-switch::after { content: ''; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ui2 input.sv-switch:checked { background: var(--brand); }
.sv-switch:checked::after { transform: translateX(18px); }
[dir=rtl] .sv-switch:checked::after { transform: translateX(-18px); }
.sv-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Segmented sub-tabs (settings, customers): the current one reads like the main tabs */
.ui2 .seg { background: var(--surface); border: 1px solid var(--line); box-shadow: none; padding: 4px; gap: 2px; }
.ui2 .seg button { border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 600; min-height: 40px; }
.ui2 .seg button.on, .ui2 .seg button.active { background: var(--brand); color: var(--on-brand); }
.ui2 .settings-tabs { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
.sv-templates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.sv-templates .sv-chip { cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600; min-height: 36px; }
.sv-templates .sv-chip:hover { border-color: var(--brand); }

/* ---------- Rail: the section name sits under its icon on a desktop screen ---------- */
.ui2 .u-rail .u-lbl { display: none; }
@media (min-width: 900px) {
  .ui2 .u-rail { padding: 12px 8px; }
  .ui2 .u-rail button[data-section] { width: 64px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 14px; }
  .ui2 .u-rail .u-lbl { display: block; font: 600 .66rem/1.1 var(--f-body); letter-spacing: .01em; max-width: 58px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ui2 .u-rail button[data-section][data-tip]::after { display: none; }
  .ui2 .u-rail .u-dot { inset-block-start: 8px; inset-inline-end: 14px; }
}
.u-start { margin-top: 18px; display: grid; gap: 14px; justify-items: start; max-width: 34em; }
.u-start p { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* Orders: the state shows on the card's edge and in a word */
.ui2 .order { border-inline-start: 4px solid var(--line); }
.ui2 .order.status-new { border-inline-start-color: var(--danger); }
.ui2 .order.status-preparing { border-inline-start-color: var(--warn); }
.ui2 .order.status-ready { border-inline-start-color: var(--ok); }
.ui2 .pill.st-new { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.ui2 .pill.st-preparing { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.ui2 .pill.st-ready { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

/* Money and counts read in the number face everywhere, so columns line up */
.ui2 .order-total, .ui2 .row .price, .ui2 .badge-count, .ui2 .pay-pill b, .ui2 .order-lines li > span.muted, .ui2 .plan-card .price, .ui2 .stat-num, .ui2 table.top-table td:not(:first-child) {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
html[lang=ar] .ui2 .order-total, html[lang=ar] .ui2 .row .price { letter-spacing: 0; }
.ui2 table.top-table td:not(:first-child), .ui2 table.top-table th:not(:first-child) { text-align: end; }

/* Empty states: calm, centred, with the ring and its dot */
.ui2 p.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 16px; margin: 8px 0; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.ui2 p.empty::before { content: ''; width: 30px; height: 30px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='42.5' fill='none' stroke='%238FAAA6' stroke-width='11'/%3E%3Ccircle cx='60' cy='42' r='11' fill='%23F0B44C'/%3E%3C/svg%3E"); opacity: .8; }

/* ---------- Motion: small, quick, and off when the person asks for less ---------- */
@keyframes sv-rise { from { opacity: 0; transform: translateY(8px); } }
.ui2 .u-grid > .u-widget { animation: sv-rise .32s cubic-bezier(.2, .8, .2, 1) backwards; }
.ui2 .u-grid > .u-widget:nth-child(2) { animation-delay: .04s; }
.ui2 .u-grid > .u-widget:nth-child(3) { animation-delay: .08s; }
.ui2 .u-grid > .u-widget:nth-child(4) { animation-delay: .12s; }
.ui2 .u-grid > .u-widget:nth-child(n+5) { animation-delay: .16s; }
.ui2 .btn, .ui2 .u-tab, .ui2 .seg button { transition: transform .12s ease, background-color .15s ease, border-color .15s ease, filter .15s ease; }
.ui2 .btn:not(:disabled):active, .ui2 .u-tab:active { transform: scale(.97); }
.ui2 .u-hours i, .ui2 .u-bars i { transition: height .4s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .ui2 .u-grid > .u-widget { animation: none; } .ui2 .btn:not(:disabled):active, .ui2 .u-tab:active { transform: none; } }

/* ---------- Worst-case data: long names, unbroken words, huge totals never break the layout ---------- */
.ui2 .order, .ui2 .order * { min-width: 0; overflow-wrap: anywhere; }
.ui2 .order-head { flex-wrap: wrap; }
.ui2 .row, .ui2 .row .grow, .ui2 .card h2, .ui2 .card h3, .ui2 .u-widget { overflow-wrap: anywhere; }
.ui2 .u-hero-nums { gap: 14px 44px; }
.ui2 .u-hero-nums strong { font-size: clamp(1.5rem, 2.4vw, 2.1rem); overflow-wrap: anywhere; }

/* Platform: the businesses list reads as a table — aligned figures, fixed-width stat columns */
.ui2 .r-stat { min-width: 74px; text-align: center; color: var(--muted); font-size: .78rem; }
.ui2 .r-stat b { display: block; font: 500 1.1rem var(--f-mono); color: var(--text); letter-spacing: -.03em; }
.ui2 .state-dot { box-shadow: none; }

/* ---------- Phone: the bottom dock names its sections and marks the current one underneath ---------- */
@media (max-width: 899px) {
  .ui2 .u-rail { border-radius: 22px; padding: 6px 8px; }
  .ui2 .u-rail button[data-section] { height: 54px; max-width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; }
  .ui2 .u-rail .u-lbl { display: block; font: 600 .62rem/1.1 var(--f-body); max-width: none; text-align: center; overflow: visible; white-space: nowrap; }
  .ui2 .u-rail button.active, .ui2 .u-rail a.active { box-shadow: inset 0 -3px 0 var(--sv-sun); }
  [dir=rtl] .ui2 .u-rail button.active, [dir=rtl] .ui2 .u-rail a.active { box-shadow: inset 0 -3px 0 var(--sv-sun); }
  .ui2 .u-rail .u-dot { inset-block-start: 6px; inset-inline-end: 18px; }
  .ui2 .u-shell { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .ui2 .settings-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ui2 .settings-tabs::-webkit-scrollbar { display: none; }
  .ui2 .settings-tabs button { flex: none; white-space: nowrap; }
}

/* ---------- Form controls and the platform's plan editor ---------- */
.ui2 input[type=checkbox], .ui2 input[type=radio] { accent-color: var(--brand); }
.ui2 .plan-row { padding: 18px 0; }
.ui2 .plan-row .feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ui2 .plan-row .feats .check { padding: 6px 8px; border-radius: 8px; }
.ui2 .plan-row .feats .check:hover { background: var(--surface-2); }
@media (max-width: 640px) { .ui2 .u-widget .big { font-size: clamp(1.4rem, 7vw, 2rem); } }
.ui2 .plan-row .feats .check { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.ui2 .plan-row .feats .check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }

/* =====================================================================
   Product shell (desktop): full-height dark sidebar, a top bar with breadcrumb, search, bell and account,
   as in the approved product UI. On a phone the dock of sections stays (see above).
   ===================================================================== */
.sv-side, .sv-search, .sv-bell, .sv-avatar { display: none; }
@media (min-width: 900px) {
  .ui2 .u-shell { grid-template-columns: 248px minmax(0, 1fr); gap: 0; padding: 0; max-width: none; align-items: start; }
  .ui2 .u-rail, .ui2 #subnav { display: none !important; }
  .ui2 .u-main { padding: 0 clamp(20px, 2.4vw, 36px) 56px; min-width: 0; }
  .sv-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; background: var(--side); color: var(--side-text); padding: 22px 14px 14px; overflow-y: auto; scrollbar-width: thin; border-inline-end: 1px solid var(--side-line); }
  .ui2 .sv-logo { display: block; padding: 2px 12px 14px; color: var(--side-on); --sv-dot: var(--sv-sun); }
  .sv-biz { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; background: var(--side-raised); color: var(--side-on); border: 1px solid var(--side-line); }
  .sv-biz-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--sv-sun); color: var(--sv-night); display: grid; place-items: center; font: 800 15px var(--f-head); flex: none; }
  .sv-biz-text { min-width: 0; display: grid; }
  .sv-biz-text b { font: 700 14px/1.2 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sv-biz-text small { color: var(--side-text); font-size: 12px; }
  .sv-loc { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
  .sv-nav { display: grid; gap: 2px; align-content: start; flex: 1; padding-bottom: 12px; }
  .sv-nav h6 { margin: 18px 12px 6px; font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--side-text) 70%, transparent); }
  html[lang=ar] .sv-nav h6 { letter-spacing: 0; font-family: var(--f-body); font-size: 12px; }
  .sv-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font: 500 14.5px/1.2 var(--f-body); text-decoration: none; position: relative; }
  .sv-nav a .ic { width: 18px; height: 18px; flex: none; margin: 0; }
  .sv-nav a:hover { background: var(--side-raised); color: var(--side-on); }
  .sv-nav a.active { background: var(--side-raised); color: var(--side-on); box-shadow: inset 3px 0 0 var(--sv-sun); }
  [dir=rtl] .sv-nav a.active { box-shadow: inset -3px 0 0 var(--sv-sun); }
  .sv-nav a.locked { opacity: .55; }
  .sv-count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--sv-sun); color: var(--sv-night); font: 700 12px/22px var(--f-mono); text-align: center; }
  .sv-foot { border-top: 1px solid var(--side-line); padding-top: 12px; }
  .sv-foot a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--side-text); font-size: 13px; text-decoration: none; }
  .sv-foot a:hover { color: var(--side-on); }

  /* the top bar */
  .ui2 .u-top { position: sticky; top: 0; z-index: 30; margin: 0 calc(-1 * clamp(20px, 2.4vw, 36px)) 22px; padding: 14px clamp(20px, 2.4vw, 36px); border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); gap: 18px; }
  .ui2 .u-top .brand-wrap { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .ui2 .u-top .brand-wrap strong { font: 500 15px var(--f-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
  .ui2 .topbar .brand-wrap .view-title { display: inline !important; font: 700 15px var(--f-body); color: var(--text); }
  .ui2 .view-title::before { content: '/ '; color: var(--muted); font-weight: 400; }
  .sv-search { display: flex; align-items: center; gap: 10px; position: relative; margin-inline-start: auto; width: min(380px, 34vw); height: var(--ctl); padding-inline: 14px; border: 1px solid var(--line); border-radius: var(--ctl-r); background: var(--surface); color: var(--muted); }
  .sv-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 100%; font-size: 14px; color: var(--text); }
  .sv-search input::-webkit-search-cancel-button { display: none; }
  .sv-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
  .sv-search kbd { font: 500 11px var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
  .sv-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; z-index: 40; display: grid; }
  .sv-results button { text-align: start; padding: 9px 12px; border-radius: 8px; font: 500 14px var(--f-body); color: var(--text); background: transparent; }
  .sv-results button:hover, .sv-results button.on { background: var(--brand-soft); }
  .ui2 .u-top .u-actions { margin-inline-start: 0; }
  .sv-bell { display: inline-grid; position: relative; }
  .sv-bell-dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
  .sv-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 15px var(--f-head); cursor: pointer; border: 0; }
  .ui2 #accountBtn, .ui2 .u-more-only { display: none; }
}
@media (max-width: 899px) { .sv-side { display: none; } }

/* ---------- Overview (the product UI's layout) ---------- */
.sv-page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sv-page-h h1 { font-size: clamp(26px, 2.6vw, 34px); margin: 0 0 4px; }
.sv-page-h p { margin: 0; }
.sv-page-a { display: flex; gap: 10px; }
.sv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.sv-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 16px; display: grid; gap: 8px; }
.sv-kpi-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 500 13.5px var(--f-body); }
.sv-kpi-h .ic { width: 18px; height: 18px; margin: 0; }
.sv-kpi strong { font: 500 clamp(26px, 2.4vw, 34px)/1.1 var(--f-mono); letter-spacing: -.04em; color: var(--text); overflow-wrap: anywhere; }
html[lang=ar] .sv-kpi strong { letter-spacing: 0; }
.sv-kpi small { color: var(--muted); font-size: 13px; min-height: 1.3em; }
.sv-row { display: grid; gap: 16px; margin-bottom: 16px; }
.sv-row-main { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.sv-row-small { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; min-width: 0; }
.sv-card-flush { padding: 0; overflow: hidden; }
.sv-card-flush .sv-card-h { padding: 20px 22px 14px; margin: 0; }
.sv-card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sv-card-h h3 { font-size: 17px; margin: 0; }
.sv-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sv-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-start: 8px; }
.sv-legend i.a { background: var(--brand); } .sv-legend i.b { background: var(--line); }
.sv-chart { width: 100%; height: auto; display: block; }
.sv-chart text { font: 500 10.5px var(--f-mono); fill: var(--muted); }
.sv-chart .g { stroke: var(--line); stroke-width: 1; }
.sv-chart .today { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.sv-chart .last { fill: none; stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 2; stroke-dasharray: 5 5; }
.sv-chart .area { fill: color-mix(in srgb, var(--brand) 12%, transparent); stroke: none; }
.sv-chart .now { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.sv-attn { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; margin-bottom: 10px; border-radius: 14px; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 18%, transparent); }
.sv-attn > .ic { width: 22px; height: 22px; color: var(--warn); margin: 0; }
.sv-attn b { display: block; font-size: 15px; color: var(--text); }
.sv-attn small { color: var(--muted); font-size: 13px; }
.sv-table { width: 100%; border-collapse: collapse; }
.sv-table th { text-align: start; font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 22px; background: var(--surface-2); border-block: 1px solid var(--line); }
html[lang=ar] .sv-table th { letter-spacing: 0; font-family: var(--f-body); font-size: 12px; }
.sv-table td { padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.sv-table tr:last-child td { border-bottom: 0; }
.sv-table td.num, .sv-table th:last-child { font-family: var(--f-mono); text-align: end; }
.sv-table th:last-child { font-family: inherit; }
.sv-items { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-top { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sv-top:last-child { border-bottom: 0; }
.sv-top b { font-size: 15px; display: block; margin-bottom: 7px; }
.sv-top .num { font: 500 15px var(--f-mono); color: var(--text); }
.sv-sw { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 800 16px var(--f-head); color: var(--sv-night); }
.sv-sw.sun { background: var(--sv-sun); } .sv-sw.clay { background: #B5573A; color: #fff; } .sv-sw.teal { background: var(--sv-teal); color: #fff; } .sv-sw.blush { background: var(--sv-blush); }
.sv-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.sv-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.sv-row-small .u-widget { margin: 0; }
@media (max-width: 1100px) { .sv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sv-row-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .sv-kpis { gap: 10px; } .sv-kpi { padding: 14px; } .sv-table th, .sv-table td { padding-inline: 14px; } .sv-items { display: none; } .sv-table th:nth-child(3) { display: none; } }
.sv-table td.num:first-child { text-align: start; }

/* ---------- Menu editor: categories pane, one table per category, and the item form as a side panel ---------- */
.sv-cats { display: none; }
@media (min-width: 1100px) {
  .ui2 #view-items:not([hidden]) { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .ui2 #view-items > * { grid-column: 2; }
  .ui2 #view-items > .sv-cats { grid-column: 1; grid-row: 1 / span 12; display: grid; gap: 2px; align-content: start; position: sticky; top: 90px; padding: 16px; }
  .sv-cats h3 { font-size: 17px; margin: 0 0 10px 4px; }
  .sv-cat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-align: start; background: transparent; color: var(--text); font: 500 14.5px var(--f-body); }
  .sv-cat:hover { background: var(--surface-2); }
  .sv-cat.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
  .sv-cat b { font: 500 12px var(--f-mono); color: var(--muted); }
}
.ui2 #itemsList .group-title { font: 700 17px var(--f-head); margin: 22px 0 10px; color: var(--text); }
.ui2 #itemsList .group-title small { font: 500 12px var(--f-mono); color: var(--muted); }
.ui2 #itemsList .sort-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ui2 #itemsList .sort-box .row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; box-shadow: none; background: transparent; padding: 12px 16px; }
.ui2 #itemsList .sort-box .row:last-child { border-bottom: 0; }
.ui2 #itemsList .sort-box .row:hover { background: var(--surface-2); }
.ui2 #itemsList .thumb { border-radius: 10px; width: 46px; height: 46px; }
.ui2 #itemsList .sort-box > p { padding: 16px; margin: 0; }
@media (min-width: 900px) {
  .ui2 #itemDialog { position: fixed; inset: 0 0 0 auto; margin: 0; max-width: none; width: min(520px, 100vw); height: 100dvh; max-height: none; border-radius: 0; border: 0; border-inline-start: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(8, 21, 24, .5); overflow-y: auto; animation: sv-slide .24s cubic-bezier(.2, .8, .2, 1); }
  [dir=rtl] .ui2 #itemDialog { inset: 0 auto 0 0; border-inline-start: 0; border-inline-end: 1px solid var(--line); box-shadow: 24px 0 60px -30px rgba(8, 21, 24, .5); animation-name: sv-slide-rtl; }
  .ui2 #itemDialog::backdrop { background: rgba(8, 21, 24, .35); }
  .ui2 #itemDialog .grid { grid-template-columns: 1fr; }
}
@keyframes sv-slide { from { transform: translateX(36px); opacity: 0; } }
@keyframes sv-slide-rtl { from { transform: translateX(-36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ui2 #itemDialog { animation: none; } }
.sv-cat { border: 0; cursor: pointer; }
.sv-title { display: none; font-size: clamp(26px, 2.6vw, 34px); margin: 6px 0 18px; }
@media (min-width: 900px) { .ui2 .sv-title:not([hidden]) { display: block; } }

/* tables: caps header band, roomy rows, figures aligned */
.ui2 table.top-table, .ui2 table.data { width: 100%; border-collapse: collapse; }
.ui2 table.top-table th, .ui2 table.data th { text-align: start; font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; background: var(--surface-2); border-block: 1px solid var(--line); }
html[lang=ar] .ui2 table.top-table th, html[lang=ar] .ui2 table.data th { letter-spacing: 0; font-family: var(--f-body); font-size: 12px; }
.ui2 table.top-table td, .ui2 table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.ui2 table.top-table tr.clickable:hover td { background: var(--surface-2); cursor: pointer; }
.sv-person { display: flex; align-items: center; gap: 12px; }
.sv-person > div { display: grid; line-height: 1.3; }
.sv-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 13px var(--f-head); color: #fff; }
.sv-av.av0 { background: var(--sv-teal); } .sv-av.av1 { background: #B5573A; } .sv-av.av2 { background: #6B3F5B; } .sv-av.av3 { background: #2F6BA3; }
.ui2 .pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.ui2 .pill.ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; margin-inline-end: 6px; }
@media (min-width: 900px) { .ui2 #ordersList { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; align-items: start; } .ui2 #ordersList > .empty { grid-column: 1 / -1; } .ui2 #ordersList .order { margin: 0; } }

/* Kitchen: the action buttons read as in the product UI (dark text on the state colour) */
.col .t-actions .go { color: var(--sv-night); border-radius: 12px; font-weight: 700; }
.col.preparing .t-actions .go { background: var(--ready); }
.col.ready .t-actions .go { background: var(--sv-sand); color: var(--sv-night); }
.col .t-actions .ico { border-radius: 12px; }
.ticket { border-radius: 16px; }
.t-head b { letter-spacing: -.03em; }

/* Customers (and any screen with a row of figures): the intro is plain text and the tiles read as KPI cards */
.ui2 #view-customers > .card:first-child { background: transparent; border: 0; padding: 0 0 4px; }
.ui2 #view-customers > .card:first-child > h2 { display: none; }
.ui2 .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.ui2 .tiles .tile { padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ui2 .tiles .tile strong, .ui2 .tiles .tile b { font: 500 clamp(24px, 2.2vw, 32px)/1.1 var(--f-mono); letter-spacing: -.04em; }
@media (max-width: 1000px) { .ui2 .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.r-row .sv-av { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
@media (min-width: 900px) { .ui2 .u-hello + .u-actions { margin-inline-start: auto; } }
.sv-row > * { min-width: 0; }
@media (max-width: 640px) { .sv-row-small { grid-template-columns: minmax(0, 1fr); } .sv-page-h { align-items: flex-start; } }

/* Orders board: New / Preparing / Ready / Done as columns (desktop) */
.ui2 .o-boardbtn { display: none; }
@media (min-width: 900px) {
  .ui2 .o-boardbtn { display: inline-flex; }
  .ui2 #ordersList:has(.o-board) { display: block; }
  .ui2 .o-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .ui2 .o-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: grid; gap: 12px; min-width: 0; }
  .ui2 .o-col h3 { margin: 4px 6px 0; font: 700 14px var(--f-head); display: flex; align-items: center; gap: 8px; }
  .ui2 .o-col .o-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
  .ui2 .o-new .o-dot { background: var(--warn); } .ui2 .o-preparing .o-dot { background: var(--info); } .ui2 .o-ready .o-dot { background: var(--ok); }
  .ui2 .o-col .o-n { margin-inline-start: auto; font: 600 12px var(--f-mono); color: var(--muted); background: var(--surface); border-radius: 999px; padding: 2px 9px; }
  .ui2 .o-col .order { margin: 0; padding: 14px; }
  .ui2 .o-col .order-actions .btn { flex: 1 1 auto; }
  .ui2 .o-col > .empty { text-align: center; margin: 6px 0 10px; }
}
@media (min-width: 900px) and (max-width: 1299px) { .ui2 .o-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .ui2 .o-col .order-head .pill[class*="st-"] { display: none; } }

/* Platform overview: health card and tab strip */
.ui2 .sv-health ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.ui2 .sv-health li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.ui2 .sv-health li .state-dot { grid-row: 1 / 3; }
.ui2 .sv-health li .muted { grid-column: 2; }
.ui2 .sv-tabs { margin: 4px 0 14px; max-width: 100%; overflow-x: auto; }

/* Campaigns: the message preview sits beside the form */
.ui2 .sv-camp { display: grid; gap: 18px 28px; }
.ui2 .sv-camp-prev h4 { margin: 0 0 10px; font: 700 13px var(--f-head); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ui2 .sv-phone { background: #E9DFC9; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 14px 14px; border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: grid; gap: 8px; }
.ui2 .sv-bubble { background: #D8F0C8; color: #10200A; border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.12); max-width: 92%; }
@media (min-width: 1000px) {
  .ui2 .sv-camp { grid-template-columns: minmax(0, 1fr) 320px; }
  .ui2 .sv-camp-prev { position: sticky; top: 90px; align-self: start; }
  .ui2 .sv-camp-note { grid-column: 1 / -1; }
}
.ui2 .sv-health .state-dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.ui2 .sv-health .state-dot.warn { background: var(--warn); } .ui2 .sv-health .state-dot.bad { background: var(--danger); }

/* ---------- One control system ----------
   Every button, tab, chip and field shares one height, one corner and one text size, so a row of mixed controls lines up.
   Standard 40px; small 32px (dense lists); icon buttons are 40px squares. Only badges and avatars are round. */
:root { --ctl: 40px; --ctl-sm: 32px; --ctl-r: 10px; }
.ui2 .btn, .ui2 .u-tab { min-height: var(--ctl); padding: 0 16px; border-radius: var(--ctl-r); font-size: .92rem; font-weight: 600; line-height: 1.15; }
.ui2 .btn.sm { min-height: var(--ctl-sm); padding: 0 12px; font-size: .85rem; }
.ui2 .u-icon-btn { width: var(--ctl); height: var(--ctl); min-height: 0; padding: 0 !important; border-radius: var(--ctl-r) !important; }
.ui2 .lang-switch { display: flex; margin: 10px auto 0; }
.ui2 .seg, .ui2 .segmented, .ui2 .qr-tabs { align-items: stretch; gap: 2px; padding: 3px; min-height: var(--ctl); border-radius: var(--ctl-r); box-sizing: border-box; }
.ui2 .seg button, .ui2 .segmented button, .ui2 .qr-tabs button { display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--ctl) - 8px); padding: 0 14px; border-radius: calc(var(--ctl-r) - 3px); font-size: .88rem; font-weight: 600; line-height: 1.15; }
.ui2 .qr-studio .chips button, .ui2 .chips button { min-height: var(--ctl-sm); padding: 0 12px; border-radius: var(--ctl-r); }
.ui2 .qr-studio .icon-chips button { min-height: 0; padding: 7px; }
.ui2 input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=range]):not([type=hidden]), .ui2 select { height: var(--ctl); min-height: var(--ctl); padding-block: 0; box-sizing: border-box; }
.ui2 .u-start { margin-bottom: 18px; }
/* The row a toolbar's controls sit in: the same height all along, wrapping neatly. */
.ui2 .qr-studio-head .qr-head-tools, .ui2 .top-actions, .ui2 .actions { align-items: center; }
