:root {
  --bg: #f4f6f9;
  --card: #fff;
  --ink: #1b2430;
  --muted: #6b7686;
  --line: #e3e7ee;
  /* Browser-default blue, white, yellow for alerts, red for danger. */
  --brand: #0075ff;
  --primary: #0075ff;
  --accent: #0075ff;
  --tint: #e8f1ff;
  --warn: #ffc107;
  --warn-bg: #fff8db;
  --danger: #dc3545;
  --radius: 12px;
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Geeza Pro', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
/* No column grows because of what is inside it: everywhere, for every component to come (the default
   min-width: auto lets a long word, a no-wrap line or a wide child stretch its grid or flex parent, and so the
   whole section). Buttons keep their words; a table scrolls in its own box. A long word breaks instead. */
:where(*:not(button, table, thead, tbody, tr, td, th, svg, svg *, img)) { min-width: 0; }
:where(.sb-foot, .form-grid) { grid-template-columns: minmax(0, 1fr); }
body { overflow-wrap: break-word; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
/* Tablets: no rubber-band stretch at the end of a list and no double-tap zoom; lists scroll when their
   content needs it. Only the page and the up/down lists get overscroll-behavior — a horizontal strip
   (chips, a wide table, tabs) must keep the default, or an up/down swipe that starts on it scrolls nothing. */
html, body { overscroll-behavior: none; }
:where(.auth, .grid, .lines, .picker-list, .modal-body, .admin-body, .cust-list, .sb-nav, .page-body, .picker-page, .wallet-history) { overscroll-behavior-y: none; }
body { touch-action: manipulation; }
body { -webkit-tap-highlight-color: transparent; }
#app { height: 100%; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Anything that can be pressed shows the hand; what can't be pressed right now doesn't. */
button:not(:disabled), a[href], summary, select:not(:disabled), input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled),
input[type="file"]:not(:disabled), input[type="color"]:not(:disabled), input[type="range"]:not(:disabled),
label:has(input[type="checkbox"]:not(:disabled)), label:has(input[type="radio"]:not(:disabled)),
[role="button"], [role="tab"], [role="radio"], [role="checkbox"], [role="switch"], [role="option"], [role="menuitem"], .clickable { cursor: pointer; }
button:disabled, select:disabled, input:disabled, [aria-disabled="true"] { cursor: default; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring, #0075ff33); }
.muted { color: var(--muted); }
/* numbers keep their sign/order inside RTL text */
.sum-row > span:last-child, .r-val, .kpi strong, .line-total, .tile-price, .pay-total { direction: ltr; unicode-bidi: isolate; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: plaintext; }
.empty { text-align: center; padding: 40px 10px; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line, #ffe08a); padding: 14px; border-radius: var(--radius); }
.notice p { margin: 4px 0 0; }

/* buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: var(--soft-2, #f0f3f7); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--card); border-color: var(--danger-line, #f0c4c4); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 16px; font-size: 18px; width: 100%; }
.btn.primary:hover { filter: brightness(1.05); }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.danger-text { color: var(--danger); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.chip-danger { color: var(--danger); border-color: var(--danger-line, #f3b4b4); }
.chip.chip-danger.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.danger-zone { display: grid; gap: 16px; }
.tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
}
.tab.on { background: var(--tint); color: var(--primary); }

/* auth */
.auth { flex: 1; display: grid; place-items: center; padding: 20px; background: var(--bg); overflow-y: auto; }
/* the other language in the top corner (sign-in / sign-up): room kept above the card, so nothing moves under it */
.auth.with-lang { position: relative; padding-top: 64px; }
.auth-lang { position: absolute; top: 16px; inset-inline-end: 16px; background: var(--card); }
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 18px;
  padding: 26px;
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 50px #0004;
}
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.brand img { width: 44px; height: 44px; }
.brand h1 { margin: 0; font-size: 24px; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; background: var(--tint); border-radius: 10px; padding: 10px 12px; margin: 0; }
.auth-note.warn { background: var(--warn-bg); display: block; }
.link-btn { justify-self: start; background: none; border: none; padding: 2px 0; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 20px; font-weight: 700; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; }
.auth-tabs .tab { flex: 1; color: var(--muted); }
.auth-tabs .tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px #0001; }
.lang { justify-self: center; }
/* align-content: start — in a row whose neighbour carries a hint, the taller cell must not stretch this
   one's label/input rows apart (the input would sink and leave a gap under the label). */
.field { display: grid; gap: 5px; font-size: 14px; align-content: start; }
.field > span { font-weight: 600; }
.field small { color: var(--muted); }
/* the field's gap already spaces it from the title: no extra margin, or it sits lower than its neighbours */
.field > .chips { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tb-start { display: flex; align-items: center; gap: 10px; }
.tb-start .logo { width: 28px; height: 28px; }
.tb-mid { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tb-end { display: flex; align-items: center; gap: 8px; }
.tb-end .btn.ghost { color: var(--ink); border-color: var(--line); }
.tb-end .btn.ghost:hover { background: var(--bg); }
.user { opacity: 0.85; font-size: 14px; }
.branch-select { width: auto; padding: 5px 10px; border-radius: 8px; }
.branch-select option { color: var(--ink); }
.branch-name { font-size: 14px; background: var(--bg); padding: 4px 10px; border-radius: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--bg); padding: 4px 10px; border-radius: 999px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.status.off i { background: #ffb020; }
.status b { font-weight: 600; color: var(--warn-ink, #8a6100); }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* POS */
.pos { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px; }
.catalog { display: flex; flex-direction: column; gap: 12px; padding: 12px; /* (one space everywhere: its edges, between its rows, between the squares — M 2026-11-21) */ min-height: 0; min-width: 0; /* (a long row of categories scrolls inside it, never stretches the page) */ }
.search { font-size: 17px; padding: 12px 14px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex-shrink: 0; }
.grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: max-content; /* (a row is as tall as its squares) */
  gap: 12px; /* (= .catalog's) */
  align-content: start;
  /* A window with rounded corners (M 2026-11-21): the gap under the categories stays put, the squares scroll inside it
     and are cut round at its corners. The first and last rows touch its edges; the squares' corners are its own. */
  padding: 0;
  border-radius: 10px;
}
.grid > .tile { border-radius: 10px; }
.grid > .tile:hover { transform: none; } /* (no lift: the window would cut it) */
.tile {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  text-align: start;
  transition: transform 0.05s;
}
.tile:active { transform: scale(0.97); background: var(--tint); }
.tile { -webkit-touch-callout: none; user-select: none; }
/* A photo is square with the words under it; a product without one stays short, even beside one with a photo.
   Every tile of a kind is the same size, whatever its name. */
.grid:not(.style-list) > .tile { overflow: hidden; align-self: start; }
.grid:not(.style-list) > .tile:not(.has-img) { height: 96px; }
.tile-name { font-weight: 600; font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A long name: smaller, to show as much as fits, then «…». A tile never grows for it. */
.grid:not(.style-list) .tile-name.long { font-size: 13px; line-height: 1.3; -webkit-line-clamp: 3; }
.grid:not(.style-list) .tile-name.longer { font-size: 12px; line-height: 1.3; -webkit-line-clamp: 3; }
.tile-price { color: var(--primary); font-weight: 700; }
.tile-price small { color: var(--muted); font-weight: 400; }
.tile-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.tile-stock { font-size: 12px; color: var(--muted); background: var(--soft-2, #f0f3f7); border-radius: 6px; padding: 1px 6px; direction: ltr; }
.tile-stock.out { color: var(--danger); background: var(--danger-bg, #fdecec); }
.qty-val { min-width: 34px; border: none; background: none; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline dotted; }
.cart {
  background: var(--card);
  border-inline-start: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.lines { flex: 1; overflow-y: auto; padding: 6px 8px; }
/* One sale line: name and what belongs to it on one side; its total over its quantity on the other; remove at the edge. */
.line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'name total del' 'name qty del';
  gap: 4px 10px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--line-soft, #eef1f5);
  border-radius: 10px;
}
.line:last-child { border-bottom-color: transparent; }
.line-name { grid-area: name; align-self: start; display: grid; justify-items: start; gap: 3px; font-weight: 600; line-height: 1.35; }
.line-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.line-name small { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.line-total { grid-area: total; justify-self: end; font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.line > .qty { grid-area: qty; justify-self: end; gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.line > .qty .icon-btn { width: 34px; height: 32px; border: none; border-radius: 0; background: var(--soft, #f3f5f8); }
.line > .qty .icon-btn:hover { background: var(--tint); }
.line > .qty .qty-val { min-width: 36px; height: 32px; padding: 0 4px; border: none; border-radius: 0; background: var(--card); font-variant-numeric: tabular-nums; }
.line > .icon-btn { grid-area: del; width: 28px; height: 28px; border: none; background: var(--danger-bg, #fdf1f1); }
.line > .icon-btn:hover { background: var(--danger-bg, #fbdcdc); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty span { min-width: 24px; text-align: center; font-weight: 700; }
.table tr.low td { background: var(--warn-soft, #fff7e6); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-lines td input { padding: 6px 8px; }
.doc-lines .num input { width: 110px; text-align: end; }
.picker { position: relative; }
.picker-list { position: absolute; inset-inline: 0; top: 100%; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px #0002; }
.picker-list button { display: flex; justify-content: space-between; width: 100%; padding: 9px 12px; border: none; background: none; cursor: pointer; text-align: start; }
.picker-list button:hover, .picker-list button.on { background: var(--tint-soft, #eef3fb); }
.modal-xl { width: min(980px, 100%); }
.sums { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; }
.sum-row.grand { font-size: 24px; font-weight: 800; padding-top: 6px; border-top: 1px solid var(--line); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.np-key { padding: 14px 0; font-size: 22px; font-weight: 700; border: 1px solid var(--line); border-radius: 10px; background: var(--soft, #f7f9fb); cursor: pointer; }
.np-key:active { background: var(--soft-2, #e6edf5); }
.np-clear { grid-column: 1 / -1; padding: 8px 0; font-size: 16px; color: var(--danger); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-grid .field.on input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring, #0075ff33); }
.remaining { text-align: center; font-weight: 700; margin-top: 8px; }
.remaining.bad { color: var(--danger); }
.shift-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 12px; background: var(--tint); border-bottom: 1px solid var(--line); font-size: 13px; }
.shift-bar.closed { background: var(--warn-bg); }
.pay.three { grid-template-columns: 1fr 1fr auto; }
.diff-pos { color: var(--primary); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.open { background: var(--tint); color: var(--primary); }
.pill.closed { background: var(--soft-2, #eef1f5); color: var(--muted); }
.check small { font-weight: 400; }
.diff-neg { color: var(--danger); }
.receipt-editor { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.receipt-editor .receipt-preview { position: sticky; top: 0; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-row img { max-height: 48px; max-width: 140px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: var(--card); }
@media (max-width: 860px) { .receipt-editor { grid-template-columns: 1fr; } }
.big-input { font-size: 26px; text-align: center; font-weight: 700; }
.change { font-size: 22px; font-weight: 800; text-align: center; margin-top: 12px; color: var(--primary); }
.change.bad { color: var(--danger); }
.pay-total { font-size: 40px; font-weight: 800; text-align: center; padding: 20px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: #0008; display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: min(440px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px #0005; }
.modal-wide { width: min(560px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px; overflow-y: auto; }
/* A window or a sliding sheet: what scrolls inside it, reaching its end, never pushes the page behind (the page
   itself is held still while a window is open: dom.js pinPage). */
.modal-backdrop, .modal-body, .page-sheet, .sidebar, .pos.cart-open > .cart { overscroll-behavior: contain; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.form-grid { display: grid; gap: 12px; }

/* toasts */
/* «هذا الجهاز» (device-panel.js) */
.device-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.dp-col { display: grid; gap: 12px; min-width: 0; }
.dp-col > .dp-sec { background: var(--tint); border-radius: 12px; padding: 4px 14px 14px; }
.dp-col > .dp-sec:empty { display: none; }
.dp-col > .dp-sec .btn-row { margin-top: 4px; }
@media (max-width: 720px) { .device-panel { grid-template-columns: minmax(0, 1fr); } }
.device-panel .cpay-tiles { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.cpay-tiles .pay-method { padding: 10px 4px; }
.cpay-spot { position: relative; display: block; width: 56px; height: 36px; border: 2px solid currentColor; border-radius: 7px; direction: ltr; }
.cpay-spot::after { content: ''; position: absolute; width: 18px; height: 14px; border-radius: 3px; background: currentColor; }
.cpay-spot.ABSOLUTE_CENTER::after { left: 17px; top: 9px; }
.cpay-spot.CENTER_RIGHT::after { right: 3px; top: 9px; }
.cpay-spot.CENTER_LEFT::after { left: 3px; top: 9px; }
.cpay-spot.TOP_CENTER::after { left: 17px; top: 3px; }
.cpay-wait { display: grid; justify-items: center; gap: 12px; padding: 12px 0; text-align: center; }
.cpay-step { font-size: 20px; min-height: 30px; }
.dp-sec { display: grid; gap: 6px; }
.dp-sec .sum-head { display: flex; align-items: center; gap: 6px; }
.dp-sec > p { margin: 0; display: flex; align-items: center; gap: 6px; }
.dp-ok { color: var(--ink); font-weight: 600; }
.dp-ok > svg { color: var(--brand); }
.dp-bad { color: var(--danger); }
.dp-raw { width: 100%; min-height: 50vh; font-family: monospace; font-size: 12px; }
.sb-device { justify-content: flex-start; }
/* The bar at the top centre (top-pill.js): the app's update, a scan that found nothing. Over the bars' empty
   middle and under any window (z-index below .modal-backdrop's 50). */
.top-pills { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; max-width: calc(100vw - 24px); }
.top-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(20, 34, 49, .12); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; animation: top-pill-in .18s ease-out; }
[dir="rtl"] .top-pill { padding: 0 12px 0 4px; }
.top-pill > svg { color: var(--brand); flex: none; }
.top-pill-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-pill.danger { border-color: var(--danger-line, #f3b4b4); background: var(--danger-bg, #fff5f5); }
.top-pill.danger > svg { color: var(--danger); }
.top-pill .icon-btn { width: 30px; height: 30px; }
@keyframes top-pill-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 560px) { .top-pill:not(.danger) .top-pill-text { display: none; } }
#toasts { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; max-width: 90vw; }
.toast { background: #1b2430; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: 0 8px 24px #0003; transition: opacity 0.3s; font-weight: 600; }
.toast-success { background: var(--primary); }
.toast-error { background: var(--danger); }
.toast.hide { opacity: 0; }

/* admin */
.admin { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 6px; padding: 10px 14px 0; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs .tab { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin-bottom: 8px; color: var(--ink); background: var(--card); white-space: nowrap; }
.tabs .tab.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.admin-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.admin-body > * { flex-shrink: 0; }
.toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.toolbar > input[type='search'] { max-width: 320px; }
.toolbar .field { min-width: 150px; }
.spacer { flex: 1; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; background: var(--soft, #fafbfc); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .actions { text-align: end; white-space: nowrap; }
.table .actions .btn + .btn { margin-inline-start: 6px; }
.table tr.voided td { color: var(--muted); text-decoration: line-through; }
.table tr.voided td.actions { text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.kpi small { color: var(--muted); }
.kpi strong { font-size: 20px; }
.kpi.main { background: var(--brand); color: #fff; }
.kpi.main small { color: #ffffffcc; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-col .table, .table.bordered { border: 1px solid var(--line); border-radius: var(--radius); }
h4 { margin: 6px 0; }
.settings-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; max-width: 760px; }
.settings-form .form-grid { grid-template-columns: 1fr 1fr; }
.checks { display: grid; gap: 10px; }
.receipt-preview { display: grid; place-items: center; background: var(--bg); padding: 12px; border-radius: 10px; }
.receipt-preview .receipt { background: var(--card); padding: 10px; box-shadow: 0 2px 8px #0001; }

@media (max-width: 860px) {
  .pos { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cart { border-inline-start: none; border-top: 1px solid var(--line); max-height: 52vh; }
  .two-col, .settings-form .form-grid { grid-template-columns: 1fr; }
  .tb-mid { order: 3; flex-basis: 100%; }
  .user { display: none; }
}

/* receipt (80mm) */
/* (printed documents keep the Arabic layout whatever the screen's language: right to left) */
.receipt, .a4 { direction: rtl; }
.receipt { width: 72mm; font-size: 12px; color: #000; line-height: 1.35; padding: 0; margin: 0; box-sizing: border-box; }
.kitchen .k-number { font-size: 30px; font-weight: 900; margin: 4px 0; }
.kitchen .k-flag { font-size: 18px; font-weight: 900; border: 2px solid #000; margin: 4px auto 0; padding: 2px 10px; width: max-content; }
.k-item { display: flex; gap: 6px; font-size: 17px; font-weight: 700; padding: 3px 0; border-bottom: 1px dotted #000; }
.k-qty { min-width: 9mm; }
.k-mods { font-size: 13px; font-weight: 500; }
.k-note { font-size: 15px; font-weight: 700; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.r-center { text-align: center; }
.r-title { font-size: 16px; font-weight: 800; }
.r-kind { font-weight: 700; margin-top: 4px; }
/* order type (and table) on paper: boxed, big — read at a glance */
.r-otype { margin: 6px auto 0; padding: 3px 10px; border: 2px solid #000; border-radius: 6px; width: fit-content; max-width: 100%; display: grid; line-height: 1.3; }
.r-otype strong { font-size: 1.25em; font-weight: 900; }
.r-otype small { font-size: .8em; }
.r-otype.big strong { font-size: 1.7em; }
.kitchen .k-otype { margin: 4px auto; padding: 4px 12px; border: 3px solid #000; border-radius: 8px; width: fit-content; display: grid; line-height: 1.25; }
.kitchen .k-otype strong { font-size: 26px; font-weight: 900; }
.r-branch { font-weight: 700; }
.r-void { font-size: 16px; font-weight: 800; border: 2px solid #000; margin: 4px 0; }
.r-row { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.r-big { font-size: 15px; font-weight: 800; }
.r-val { white-space: nowrap; }
.bi { display: inline-flex; gap: 4px; align-items: baseline; }
.bi small { font-size: 9px; }
.r-items { width: 100%; border-collapse: collapse; }
.r-items th { font-weight: 700; font-size: 10px; }
.r-items th .bi { flex-direction: column; gap: 0; }
.r-items td, .r-items th { padding: 2px 1px; text-align: start; vertical-align: top; }
.r-items td:not(:first-child), .r-items th:not(:first-child) { text-align: end; white-space: nowrap; padding-inline-start: 2.2mm; font-variant-numeric: tabular-nums; }
.r-qr { width: 34mm; height: 34mm; image-rendering: pixelated; margin-top: 6px; }
.r-footer { margin-top: 6px; white-space: pre-line; }
/* a repair's number on its receipt and its label: read from across the counter */
.r-repair-no { font-size: 26px; font-weight: 900; letter-spacing: 1px; margin: 4px 0; }
.r-wrap { white-space: normal; overflow-wrap: anywhere; }
.r-repair-label .r-repair-no { font-size: 30px; }

#print-area { display: none; }
.paper-58mm .receipt { width: 48mm; font-size: 10.5px; }
.paper-58mm .r-items td:not(:first-child), .paper-58mm .r-items th:not(:first-child) { padding-inline-start: 1.2mm; }
.paper-a4 .receipt { width: 100%; font-size: 13px; }
.paper-a4 .r-title { font-size: 20px; }
.paper-a4 .r-qr { width: 30mm; height: 30mm; }
.r-logo { max-width: 60%; max-height: 22mm; margin-bottom: 4px; }
@media print {
  /* The app locks the page height on screen; printing must flow over as many pages as needed. */
  html, body { height: auto !important; overflow: visible !important; background: var(--card); }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: static; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area thead { display: table-header-group; }
  #print-area tr { break-inside: avoid; page-break-inside: avoid; }
  #print-area td, #print-area th { word-break: break-word; overflow-wrap: anywhere; }
  .a4-lines { table-layout: fixed; }
  .a4-lines th:first-child, .a4-lines td:first-child { width: 6mm; }
  .a4-lines th:nth-child(2), .a4-lines td:nth-child(2) { width: auto; }
  .a4-lines td:not(:nth-child(2)) { white-space: normal; }
  /* Thermal printers print ~72mm (80mm roll) / ~48mm (58mm roll) from the left edge: no padding,
     or the right side is cut off. */
  #print-area.paper-80mm { width: 72mm; padding: 0; margin: 0; }
  #print-area.paper-58mm { width: 48mm; padding: 0; margin: 0; }
  #print-area .page-break { break-before: page; page-break-before: always; height: 0; }
  #print-area.paper-a4 { width: 100%; }
  #app, #toasts, .modal-backdrop { display: none !important; }
}

/* customers at the till */
.cust-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 46px; }
.cust-chip { display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.cust-chip strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.ghost-dark { background: var(--soft-2, #f0f3f7); border-color: transparent; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: var(--warn-ink, #3d2c00); }
.pay.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.pay.four .btn.big { padding: 14px 4px; font-size: 16px; }
.cust-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.cust-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; text-align: start; }
.cust-row:hover { background: var(--tint-soft, #eef3fb); }
.cust-row .pill { margin-inline-start: 6px; }
/* the picker: choose on the row, «تعديل» at its end */
.cust-pick { display: flex; align-items: stretch; gap: 8px; }
.cust-pick > .cust-row { flex: 1; min-width: 0; }
.cust-pick > .cust-edit { flex: none; min-height: 48px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.split-grid.three { grid-template-columns: 1fr 1fr 1fr; }
input.bad { border-color: var(--danger); }
.r-small { font-size: 10px; }
@media (max-width: 860px) { .form-grid.two, .split-grid.three { grid-template-columns: 1fr; } }

/* A4 invoice */
.a4 { --a4: #1b2430; color: #000; font-size: 12px; line-height: 1.45; width: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.receipt-preview .a4 { background: var(--card); padding: 16px; width: 760px; max-width: 100%; }
/* Settings → A4: half the page is the form, half the paper (kept at its width and scaled to fit by a4Tab) */
.set-split.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.a4-preview { overflow: hidden; }
.a4-preview .a4 { max-width: none; }
.a4-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 3px solid var(--a4); padding-bottom: 10px; margin-bottom: 12px; }
/* A4 editor: the store's colour on the head, the titles and the table's head; the logo beside the name or centred above it */
.a4-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.a4-doc { text-align: end; }
.a4-number { font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.a4.logo-center .a4-head { display: grid; grid-template-columns: 1fr auto 1fr; }
.a4-mid { display: flex; justify-content: center; }
.a4-item { display: flex; align-items: center; gap: 8px; }
.a4-pic { width: 9mm; height: 9mm; object-fit: cover; border-radius: 2mm; flex: none; }
.a4-note { border: 1px solid #ccc; border-radius: 2mm; padding: 6px 8px; margin-bottom: 10px; }
.a4-text { white-space: pre-line; margin-bottom: 10px; }
.a4-note .a4-text { margin: 0; }
.a4-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 18px 0 6px; }
.a4-sign > div { border-top: 1px solid #000; padding-top: 6px; min-height: 22mm; text-align: center; }
.a4-title { font-size: 20px; font-weight: 800; color: var(--a4); }
.a4-title .bi { flex-direction: column; }
.a4-logo { max-height: 60px; max-width: 200px; }
.a4-store { font-size: 18px; font-weight: 800; }
.a4-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; margin-bottom: 10px; }
.a4-kv { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #bbb; padding: 2px 0; }
.a4-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.a4-party { border: 1px solid #000; padding: 8px; }
.a4-party-title { font-weight: 800; margin-bottom: 4px; color: var(--a4); }
.a4-lines { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.a4-lines th, .a4-lines td { border: 1px solid #000; padding: 4px 6px; text-align: center; vertical-align: middle; }
.a4-lines th:nth-child(2), .a4-lines td:nth-child(2) { text-align: start; }
.a4-lines th { background: #e9ebee; background: color-mix(in srgb, var(--a4) 12%, var(--card)); font-size: 11px; }
.a4-lines th .bi { flex-direction: column; gap: 0; }
.a4-lines td:not(:nth-child(2)) { white-space: nowrap; }
.a4-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.a4-bottom .r-qr { width: 34mm; height: 34mm; }
.a4-totals { min-width: 300px; }
.a4-footer { margin-top: 14px; border-top: 1px solid #000; padding-top: 6px; white-space: pre-line; text-align: center; }

/* auth (self-service) */
.auth-card .brand { text-decoration: none; color: inherit; }
.auth-intro { text-align: center; }
.auth-intro h2 { margin: 0; font-size: 20px; }
.auth-intro p { margin: 4px 0 0; }
.center { text-align: center; justify-self: center; }
.store-pill { display: grid; gap: 2px; text-align: center; background: var(--bg); border-radius: 10px; padding: 10px; }
.auth-card.lock h2 { margin: 0; text-align: center; }
.auth-card.lock > p { text-align: center; margin: 0; }

/* plan */
.offer { display: grid; gap: 2px; background: var(--tint); border: 1px solid var(--tint-line, #b9d6ff); border-radius: 12px; padding: 12px 14px; }
.offer span { font-size: 22px; font-weight: 800; color: var(--primary); }
.big-num { font-size: 26px; direction: ltr; unicode-bidi: isolate; }
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.meter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.meter-head, .meter-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar { height: 8px; background: var(--soft-2, #eef1f5); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); }
.bar.full i { background: var(--danger, #dc3545); }
@media (max-width: 860px) { .meters { grid-template-columns: 1fr; } }

/* onboarding */
.onboarding { margin: 12px 14px 0; background: var(--card); border: 1px solid var(--ok-line, #bfe8d5); border-radius: var(--radius); padding: 12px 14px; flex-shrink: 0; }
.ob-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ob-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.ob-step { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; font: inherit; font-weight: 600; }
.ob-step.done { color: var(--muted); text-decoration: line-through; }
.ob-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; }
.ob-step.done .ob-n { background: var(--primary); }

/* Everything clickable looks like a button (no bare text links). */
.link {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.link:hover { background: var(--tint); }
.btn.outline { background: var(--card); border: 2px solid var(--primary); color: var(--primary); }
details summary { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card); list-style: none; }
details[open] summary { margin-bottom: 8px; }
.auth-foot { display: grid; gap: 8px; }
.auth-legal { margin: 0; text-align: center; }
.auth-legal a { color: var(--primary); }
.auth-foot .btn { width: 100%; }
.embed .brand, .embed .auth-lang { display: none; }
.embed .auth { background: var(--card); place-items: start center; padding: 8px 16px; }
.embed .auth-card { box-shadow: none; border: 0; }

/* products with photos, empty till */
.tile.has-img { padding: 0; overflow: hidden; }
.tile.has-img .tile-name, .tile.has-img .tile-foot { padding: 0 10px; }
.tile.has-img .tile-foot { padding-bottom: 8px; }
.tile-img { flex: none; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg); display: block; }
/* (a fixed row for the name: the same height with any name, and no half line under the «…») */
.grid:not(.style-list) > .tile.has-img { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 58px auto; }
.tile.has-img .tile-name { align-self: start; margin-top: 6px; }
.tile.has-img .tile-foot { flex: none; margin-top: auto; padding-top: 4px; }
/* (many photos: a letter where one is missing; few, as the point of sale's look says: a photo fills its tile, the words
   over it, a shadow on the words only, so the photo stays clear and a white one still reads (M 2026-11-25) — or the plain
   tile, its photo square in the corner) */
.tile.has-cover { position: relative; isolation: isolate; color: #fff; justify-content: flex-end; gap: 2px; border-color: transparent; }
.tile-cover { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.tile.has-cover .tile-name, .tile.has-cover .tile-price { color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 0, 0, 0.6); }
/* (the name clips at two lines — overflow hidden — so its box gets room around the words for the shadow, given back by
   the margin: nothing moves, the shadow is whole) */
.tile.has-cover .tile-name { padding: 6px 8px 0; margin: -6px -8px 0; line-height: 1.35; }
.tile.has-cover .tile-variants, .tile.has-cover .tile-price small { color: inherit; }
.tile.has-thumb { position: relative; }
.tile-thumb { position: absolute; top: 8px; inset-inline-end: 8px; width: var(--thumb, 64px); height: var(--thumb, 64px); border-radius: 8px; object-fit: cover; background: var(--bg); }
.tile.has-thumb .tile-name { padding-inline-end: calc(var(--thumb, 64px) + 6px); }
.grid.size-l > .tile { --thumb: 80px; }
.grid.style-compact > .tile { --thumb: 44px; }
.tile-letter { display: grid; place-items: center; font-size: 44px; font-weight: 700; color: var(--muted); }
.add-tile { border: 2px dashed var(--primary); color: var(--primary); font-weight: 700; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.add-tile .plus { font-size: 30px; line-height: 1; }
.first-product { grid-column: 1 / -1; display: grid; place-items: center; padding: 60px 10px; }
.btn.huge { font-size: 22px; padding: 22px 34px; border-radius: 14px; }
.cart-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.cart-icon { font-size: 40px; display: block; opacity: 0.5; }
.cart-empty p { margin: 6px 0 0; font-size: 16px; }
.big-field { font-size: 18px; padding: 12px 14px; }
.thumb-cell { width: 52px; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--bg); }
details.help summary { display: inline-block; color: var(--primary); font-weight: 600; cursor: pointer; }
details.help { margin: 4px 0; }
.tb-mid .tab, .auth-tabs .tab { border: 1px solid var(--line); background: var(--card); }
.tb-mid .tab.on, .auth-tabs .tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
/* no button may look like plain text */
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.ghost:hover { background: var(--tint); }
.qty-val { min-width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); text-decoration: none; }
.shift-bar:empty { display: none; }

.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px #dc354522; }
.field-err { color: var(--danger) !important; font-weight: 600; }

/* ── polish: one button look, icons, motion, skeletons ───────────────── */
:root { --shadow-sm: 0 1px 2px #10182814; --shadow: 0 4px 14px #1018281a; --shadow-lg: 0 18px 48px #10182829; --ease: cubic-bezier(.2, .8, .2, 1); }
.ic { flex-shrink: 0; vertical-align: middle; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; box-shadow: var(--shadow-sm); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { box-shadow: 0 2px 8px var(--primary-shadow, #0075ff40); }
.btn.primary:hover { background: var(--primary-hover, #0066e0); filter: none; }
.btn.outline:hover { background: var(--tint); }
.btn.danger:hover { background: var(--danger-bg, #fdecee); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 8px; }
.btn.small.icon-only { padding: 6px; }
.icon-btn { display: inline-grid; place-items: center; transition: background .15s, transform .08s; }
.icon-btn:hover { background: var(--tint); }
.icon-btn:active { transform: scale(.94); }
.tab { display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s; }
.pay .btn.big { flex-direction: column; gap: 4px; padding: 12px 6px; font-size: 15px; min-height: 70px; }
.pay-confirm { display: grid; justify-items: center; gap: 4px; color: var(--primary); padding-top: 8px; }
.pay-field > span { display: inline-flex; align-items: center; gap: 6px; }
.split-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.search-wrap { position: relative; }
.search-wrap .search-ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .search { padding-inline-start: 42px; }
/* A code in a barcode field reads left to right, on the same side of the field as the text around it. */
.scan-code { unicode-bidi: plaintext; }
[dir=rtl] .scan-code { text-align: right; }
.cart-icon { color: var(--primary); opacity: .35; }
.add-tile { gap: 6px; }
.status .ic { color: var(--primary); }
.status.off .ic { color: var(--warn-ink, #b07a00); }
.cart { box-shadow: var(--shadow-sm); }
.tile { box-shadow: var(--shadow-sm); transition: transform .12s var(--ease), box-shadow .15s, border-color .15s; }
.tile:hover { box-shadow: var(--shadow); border-color: var(--tint-line, #b9d6ff); transform: translateY(-1px); }
.kpi, .meter, .table-wrap, .settings-form { box-shadow: var(--shadow-sm); }
.modal { box-shadow: var(--shadow-lg); }
.thumb.empty { padding: 0; color: var(--muted); }
.choice.thumb-tap { display: block; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; cursor: pointer; }
.choice.thumb-tap:has(.thumb.empty) { border: 1px dashed var(--line-strong, #c4ccd8); }
.choice.thumb-tap:hover, .choice.thumb-tap:focus-visible { border-color: var(--primary); color: var(--primary); }
.thumb-tap .thumb { width: 100%; height: 100%; border-radius: 0; background: none; color: inherit; }
.thumb-tap.busy { opacity: .5; cursor: progress; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 40px 10px; color: var(--muted); text-align: center; }
.empty-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--primary); }
/* The currency's sign beside an amount said (calc.js currencySign): smaller and quieter than the number. */
.cur-sign { margin-inline-start: .25em; font-size: .72em; font-weight: 600; color: var(--muted); }
.empty-state.page-empty { gap: 12px; padding-block: 48px; }
.empty-state.page-empty p { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
/* A chart's day: its number, the month under it (a blank keeps every bar on the same line). */
.bar-day { display: grid; justify-items: center; line-height: 1.25; }
.bar-day b { font-weight: 600; color: var(--ink); }
.bar-day span { font-size: 10px; white-space: nowrap; }
.bars-wrap { position: relative; }
.bars-empty { position: absolute; inset: 0 0 34px; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 14px; pointer-events: none; }

@keyframes wl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wl-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wl-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes wl-in { from { opacity: 0; transform: translateX(var(--dx, 8px)); } to { opacity: 1; transform: none; } }
@keyframes wl-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.modal-backdrop { animation: wl-fade .15s ease-out; }
.modal { animation: wl-pop .2s var(--ease); }
.modal-backdrop.no-anim, .modal.no-anim { animation: none; }
/* A window docked in an element's place (dom.js modal dock: the till's ⚙ over its cart): no veil, it slides in */
.modal-backdrop.docked { background: transparent; pointer-events: none; padding: 0; display: block; animation: none; }
.modal-backdrop.docked > .modal { position: fixed; pointer-events: auto; max-height: none; border-radius: 0; box-shadow: -8px 0 24px #0002; animation: wl-in .2s var(--ease); --dx: -24px; }
[dir='rtl'] .modal-backdrop.docked > .modal { box-shadow: 8px 0 24px #0002; --dx: 24px; }
.modal-backdrop.docked .modal-body { flex: 1; min-height: 0; overflow: auto; }
.modal-backdrop.docked .form-grid.two { grid-template-columns: minmax(0, 1fr); }
.modal-backdrop.docked .style-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* (three choices: one row of three, none left alone on a line) */
.modal-backdrop.docked .style-pick.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modal-backdrop.docked .style-pick.three .style-opt { padding-inline: 4px; font-size: 14px; }
/* …and meanwhile a press on a product adds nothing (the cart is under the window) */
.till.till-editing .grid > .tile { pointer-events: none; }
.toast { animation: wl-slide .2s var(--ease); }
.line-new { animation: wl-in .18s var(--ease), wl-line-flash .7s ease-out; }
.line-bump { animation: wl-line-flash .7s ease-out; }
.line-bump .qty-val, .line-bump .line-total { animation: wl-num-bump .28s var(--ease); }
@keyframes wl-line-flash { from { background-color: var(--tint-line, #cfe2ff); } }
@keyframes wl-num-bump { 40% { transform: scale(1.16); } }
/* The till's keys: the key beside its button; the line + - * act on. Only with a real keyboard (pos.js). */
.till-keys [data-key]::after { content: attr(data-key); flex: none; direction: ltr; padding: 1px 5px; border: 1px solid currentColor; border-radius: 5px; font-size: 10.5px; font-weight: 600; line-height: 1.3; opacity: .55; }
.till-keys .line-current { background: var(--tint); border-bottom-color: transparent; }
.keys-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 32px; align-items: start; }
.keys-group { display: grid; gap: 6px; }
.keys-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.keys-row kbd { direction: ltr; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft, #f5f7fa); font: 600 13px var(--font, inherit); }
[dir='rtl'] .line { --dx: -8px; }
.admin-body > * { animation: wl-fade .2s ease-out; }

.sk { background: linear-gradient(90deg, var(--soft-2, #eef1f5) 25%, var(--soft, #f7f9fb) 37%, var(--soft-2, #eef1f5) 63%); background-size: 400% 100%; animation: wl-shimmer 1.3s ease-in-out infinite; border-radius: 10px; }
.sk-page { display: grid; gap: 14px; }
.sk-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sk-kpi { height: 66px; }
.sk-table { display: grid; gap: 8px; }
.sk-row { height: 42px; }
.sk-tile { height: 96px; }
.sk-lines { display: grid; gap: 10px; padding: 6px 0; }
.sk-line { height: 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.pm-list { display: grid; gap: 8px; }
.pm-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.pm-row.off { opacity: .6; }
.tpay-card { margin-bottom: 12px; }
/* Salla (admin-salla.js): the two linking steps and the code to paste. */
.salla-steps { display: grid; gap: 16px; margin: 4px 0 12px; padding-inline-start: 20px; }
.salla-steps li > * + * { margin-top: 6px; }
.salla-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.salla-code code { font-size: 22px; font-weight: 700; letter-spacing: 2px; padding: 8px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card); }
.loops-branch { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 260px) minmax(200px, 2fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.loops-branch:last-child { border-bottom: 0; }
.loops-apps { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.loops-app-row { display: inline-flex; align-items: center; gap: 8px; }
.loops-app { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 720px) { .loops-branch { grid-template-columns: 1fr; } }
.loops-new-branch { padding: 12px 0; border-top: 1px solid var(--line); }
.loops-new-branch .check { margin-bottom: 8px; }
.loops-map { display: flex; gap: 8px; align-items: center; }
.loops-map .ctl { flex: 1; min-width: 0; }
/* A partner's logo in an icon's place (ui.js icon): its own shape, shrunk to the box it sits in. */
.ic-logo { width: auto; max-width: 100%; object-fit: contain; flex: none; }
/* (its box grows to the wordmark instead of shrinking it: a logo too small to read helps nobody) */
.pm-ic:has(.ic-logo), .set-ic:has(.ic-logo) { width: auto; padding: 0 10px; background: var(--card); border: 1px solid var(--line); }
.pm-row:has(.pm-ic .ic-logo) { grid-template-columns: auto 1fr auto auto; }
.pm-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; background: var(--card); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick .icon-btn { width: 42px; height: 42px; }
.icon-pick .icon-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pm-checks .check { gap: 6px; }

.mod-picker { display: grid; gap: 12px; }
/* how many of the product: over the price, the same − n + as an option's */
.mod-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; }
.mod-count + .sum-row.grand { border-top: 0; }
.mod-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.mod-head .req { color: var(--warn-ink, #8a6100); font-weight: 600; }
.mod-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
/* an option: one card — its name and price, and at its side what it holds (+ / the count with − / a mark); the same
   size whatever it holds. Chosen: tinted, ringed in the main colour (a ring, not a thicker border: nothing moves). */
.mopt-wrap { position: relative; min-width: 0; display: grid; } /* (the card fills its row's height: a row's cards are one height) */
.mopt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 72px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.mopt:hover { background: var(--soft, #f5f7fa); }
.mopt:active { transform: scale(.98); }
.mopt-wrap.on .mopt { background: var(--tint); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.mopt-wrap.full .mopt { opacity: .5; }
.mopt-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mopt-name { font-size: 15px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; } /* (no «…»: modifiers-ui.js fitNames makes it smaller) */
.mopt-name.three { -webkit-line-clamp: unset; display: block; overflow: visible; }
.mopt-price { color: var(--muted); font-weight: 600; font-size: 12.5px; direction: ltr; justify-self: start; }
/* the side: kept for − and the count (touch screens: a finger's size), a + alone while it is 0 */
.mopt-side { flex: none; width: 92px; display: flex; justify-content: flex-end; align-items: center; }
.mopt-plus, .mopt-n, .mopt-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; }
.mopt-plus { border: 1.5px solid var(--line-strong, #c5ccd6); color: var(--muted); }
.mopt:hover .mopt-plus { border-color: var(--primary); color: var(--primary); }
.mopt-n { background: var(--primary); color: #fff; font-size: 17px; font-variant-numeric: tabular-nums; }
.mopt-n.pop { animation: mopt-pop .18s var(--ease, ease-out); } /* (only the one just changed) */
@keyframes mopt-pop { from { transform: scale(.6); } to { transform: none; } }
.mopt-mark { border: 1.5px solid var(--line-strong, #c5ccd6); color: #fff; }
.mopt-mark.box { border-radius: 9px; }
.mopt-wrap.on .mopt-mark { background: var(--primary); border-color: var(--primary); }
/* − : over the card, at the far end of its side (the count sits beside it) */
.mopt-minus.icon-btn { position: absolute; top: 50%; inset-inline-end: 12px; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--primary); background: var(--card); color: var(--primary); }
.mopt-minus.icon-btn:hover { background: var(--primary); color: #fff; }
.mopt-side:not(.multi) { width: 40px; } /* (a tick alone: the name has the rest) */
/* a rule not met: the group flashes where it is (its cards / field ringed in red twice), its rule red until it is met */
.mod-group.need .mod-head small { color: var(--danger); font-weight: 700; }
.mod-group.flash .mopt, .mod-group.flash .mod-field { animation: mod-flash .7s ease-in-out; }
.mod-group.flash .mod-head small { animation: mod-flash-text .7s ease-in-out; }
@keyframes mod-flash { 0%, 50%, 100% { box-shadow: none; } 25%, 75% { box-shadow: 0 0 0 3px var(--danger); } }
@keyframes mod-flash-text { 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: .35; } }
.mopt-wrap.on .mopt-side.multi { justify-content: flex-start; }
/* a cart line whose choices open again: its name and choices one press (a pencil says so) */
.line-remod { display: grid; gap: 2px; justify-items: start; width: 100%; min-width: 0; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.line-remod:hover { background: var(--hover); }
.line-remod .line-mods { display: grid; justify-items: start; }
/* a line's choices: one to a line; a count first, whole («2×»), in the screen's direction */
.line-mods .line-mod { display: block; }
.line-mods .mod-n { unicode-bidi: isolate; font-weight: 700; }
.line-remod .line-mods .ic { vertical-align: -1px; }
.line-remod .line-mods .ic { color: var(--primary); flex: none; }
/* the window's foot (wider than a phone): how many and the price at its start, the buttons at its end — one row */
.modal-actions:has(> .mod-foot) { align-items: center; flex-wrap: nowrap; }
.mod-foot { display: flex; align-items: center; gap: 24px; margin-inline-end: auto; min-width: 0; }
.mod-foot .mod-count { margin: 0; padding: 0; border: 0; gap: 12px; }
.mod-foot .sum-row.grand { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 0; border: 0; font-size: 22px; } /* (the count at the side's start, − at its end) */
/* the modifiers window's buttons: «إضافة للسلة» big (a finger, a busy till), «إلغاء» as tall beside it */
.modal:has(.mod-picker) .modal-actions .btn { min-height: 56px; font-size: 17px; border-radius: 12px; }
.modal:has(.mod-picker) .modal-actions .btn.primary { min-width: 240px; font-size: 19px; font-weight: 800; }
@media (max-width: 640px) { .modal:has(.mod-picker) .modal-actions .btn.primary { min-width: 0; flex: 2; } }
/* how many of the product: the same round − and + as the cards', the number between them */
.mod-count .mod-opt-qty .qty { gap: 14px; border: 0; border-radius: 0; overflow: visible; }
.mod-count .mod-opt-qty .icon-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--primary); background: var(--card); color: var(--primary); }
.mod-count .mod-opt-qty .icon-btn:hover { background: var(--primary); color: #fff; }
.mod-count .mod-opt-qty .qty-val { min-width: 32px; height: 44px; background: transparent; font-size: 20px; font-weight: 800; }
.mod-opt-qty { display: inline-flex; align-items: center; gap: 6px; }
.mod-opt-qty .qty { gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mod-opt-qty .icon-btn { width: 36px; height: 38px; border: none; border-radius: 0; background: var(--soft, #f3f5f8); }
.mod-opt-qty .icon-btn:hover { background: var(--tint); }
.mod-opt-qty .icon-btn:disabled { opacity: .35; cursor: default; background: var(--soft, #f3f5f8); }
.mod-opt-qty .qty-val { min-width: 32px; height: 38px; display: grid; place-items: center; border: none; border-radius: 0; background: var(--card); font-variant-numeric: tabular-nums; text-decoration: none; cursor: default; }
.mod-field { max-width: 360px; }
.line-mods { color: var(--primary) !important; }
/* (what already went to the kitchen: it stays on the order) */
.line-sent { display: inline-flex; align-items: center; gap: 3px; color: var(--muted, #64748b); font-size: 12px; }
.held-taken { color: var(--warn-ink, #b45309); }
.held-kitchen { color: var(--primary); }
.pay > [aria-busy] { opacity: .6; pointer-events: none; }
/* a button at work (M 2026-11-21): a quick spinner alone in it, its own size kept and what it says hidden; back as it
   was once done. Put [data-loading] on any .btn. */
.btn[data-loading], .modal:has(.pay-sheet) .modal-actions .btn.loading { position: relative; pointer-events: none; opacity: 1 !important; color: transparent !important; }
.btn[data-loading] > *, .btn[data-loading]::after, .modal:has(.pay-sheet) .modal-actions .btn.loading::after { visibility: hidden; }
.btn[data-loading]::before, .modal:has(.pay-sheet) .modal-actions .btn.loading::before { content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2.5px solid var(--spin, var(--ink)); border-inline-end-color: transparent; animation: wl-spin .6s linear infinite; }
.btn.primary { --spin: #fff; }
/* the printer button while this till prints nothing («بدون طباعة»): faint, crossed */
[data-rail=printer].print-off { position: relative; }
[data-rail=printer].print-off .ic { opacity: .45; }
[data-rail=printer].print-off::after { content: ''; position: absolute; top: 50%; left: 50%; width: 26px; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(-45deg); opacity: .8; pointer-events: none; }
/* a point of sale's sound volume: its icon, the slider (in the main colour), the number */
.vol-row { display: flex; align-items: center; gap: 12px; min-height: 42px; color: var(--ink-2); }
.vol-range { flex: 1; min-width: 0; height: 28px; accent-color: var(--primary); cursor: pointer; }
.vol-range:disabled { cursor: default; opacity: .45; }
.vol-row:has(.vol-range:disabled) { color: var(--muted); }
.vol-val { min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; font-size: 16px; color: var(--ink); }
/* (the pay window's «إتمام الدفع» at work — a card terminal, Tamara…: the same spinner alone in it) */
.r-mods { font-size: 10px; }
.r-alt { font-size: 11px; font-weight: 400; }
/* One add-on per box (its own text direction), so «+ جبن إضافي 3.00» never mixes with the next one. */
.r-mod { display: inline-block; unicode-bidi: isolate; margin-inline-end: 6px; }
.mod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mod-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; box-shadow: var(--shadow-sm); }
.mod-edit-list { display: grid; gap: 8px; }
.mod-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto auto; gap: 8px; align-items: center; }

.rep-section h4 { margin: 4px 0 10px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px; margin-bottom: 8px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
/* The rest: light rows in one panel per section (the four on top are the cards). */
.rep-card { display: grid; grid-template-columns: 38px 1fr 16px; align-items: center; gap: 10px; text-align: start; background: transparent; border: 0; border-radius: 10px; padding: 10px; cursor: pointer; font: inherit; transition: background .15s; }
.rep-card:hover { background: var(--tint); }
.rep-card .rep-ic { width: 38px; height: 38px; border-radius: 10px; }
.rep-card .rep-txt small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.rep-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 18px; }
.rep-top-card { display: grid; justify-items: start; align-content: start; gap: 6px; text-align: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; font: inherit; transition: transform .12s var(--ease), box-shadow .15s; }
.rep-top-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rep-top-card .rep-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 4px; }
.rep-top-card strong { font-size: 17px; }
.rep-top-card small { color: var(--muted); }
.rep-top-card.tone-blue .rep-ic { background: var(--tint); color: var(--primary); }
.rep-top-card.tone-green .rep-ic { background: var(--ok-bg, #e6f6ec); color: var(--ok-ink, #16a34a); }
.rep-top-card.tone-violet .rep-ic { background: #f0ebff; color: #7c3aed; }
.rep-top-card.tone-orange .rep-ic { background: #fff1e6; color: #ea6a0c; }
@media (max-width: 640px) { .rep-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .rep-top-card { padding: 14px; } .rep-top-card small { display: none; } }
.rep-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.rep-txt { display: grid; gap: 2px; }
.rep-txt small { color: var(--muted); }
.rep-go { color: var(--muted); }
[dir='ltr'] .rep-go { transform: scaleX(-1); }
.rep-back { display: flex; align-items: center; gap: 12px; }
.rep-back h3 { margin: 0; }
[dir='ltr'] .rep-back .ic { transform: scaleX(-1); }
.table tfoot td { font-weight: 800; background: var(--soft, #fafbfc); border-top: 2px solid var(--line); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
.bar-col { flex: 1 0 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-fill { width: 100%; max-width: 46px; background: linear-gradient(180deg, #3d95ff, var(--primary)); border-radius: 8px 8px 3px 3px; animation: wl-grow .5s var(--ease); transform-origin: bottom; }
.bar-val { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar-col small { font-size: 11px; color: var(--muted); }
@keyframes wl-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ── app shell: sidebar (start side = right in Arabic) + page ───────────── */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { background: var(--card); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 30; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sb-brand img { width: 30px; height: 30px; }
.sb-brand div { display: grid; min-width: 0; }
.sb-brand strong, .sb-brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 6px; }
.sb-group { display: grid; gap: 2px; }
/* the top items (point of sale, home, reports): spaced like the sections under them */
.sb-group.sb-top { gap: 8px; }
.sb-title { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px 2px; }
.sb-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink); text-align: start; text-decoration: none; box-sizing: border-box; }
.sb-item:hover { background: var(--bg); }
.sb-item.on { background: var(--tint); color: var(--primary); }
.sb-item.sb-pos { background: var(--primary); color: #fff; margin: 2px 0 4px; }
.sb-item.sb-pos:hover { filter: brightness(1.05); }
.sb-foot { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; }
.sb-user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.sb-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.page { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pagebar { display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 56px; box-sizing: border-box; }
.pagebar h2 { margin: 0; font-size: 19px; }
.pagebar .branch-select { width: auto; min-width: 140px; }
.hamburger { display: none !important; }
.scrim { display: none; }
.spacer { flex: 1; }
.page-body { flex: 1; overflow-y: auto; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(290px, 86vw); transform: translateX(100%); transition: transform 0.22s ease; box-shadow: 0 0 40px #0003; }
  [dir='ltr'] .sidebar { transform: translateX(-100%); }
  .sidebar.open, [dir='ltr'] .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: #0005; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 25; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .hamburger { display: inline-flex !important; }
  .pagebar { padding: 8px 10px; gap: 8px; }
  .pagebar h2 { font-size: 17px; }
  .pagebar .status { display: none; }
  .admin-body { padding: 10px; }
  .two-col { grid-template-columns: 1fr !important; }
  .toolbar .field { min-width: 0; flex: 1 1 140px; }
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .modal { width: 100% !important; max-height: 94vh; border-radius: 16px 16px 0 0 !important; align-self: end; }
  .modal-backdrop { align-items: end !important; padding: 0 !important; }
}

/* ── point of sale header + start screen ─────────────────────────────── */
.pos-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 52px; }
.pos-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pos-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-entry { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker-page { flex: 1; overflow-y: auto; padding: 18px; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; max-width: 980px; margin: 0 auto; }
.reg-card { display: grid; justify-items: center; gap: 6px; padding: 22px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; text-align: center; transition: transform 0.12s, box-shadow 0.12s; }
.reg-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px #0001; }
.reg-card .reg-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--tint); color: var(--primary); }
.reg-card.busy { border-color: var(--warn-line, #ffe08a); }
.reg-card.busy .reg-ic { background: var(--warn-bg); color: var(--warn-ink, #8a6100); }
.reg-card.here { border-color: var(--primary); }
.reg-card strong { font-size: 17px; }

/* ── home ─────────────────────────────────────────────────────────────── */
.home { display: grid; gap: 14px; }
.home h4 { margin: 4px 0 0; }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-weight: 700; font-size: 15px; text-align: start; }
.quick:hover { box-shadow: 0 6px 18px #0001; }
.quick .quick-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--tint); color: var(--primary); flex-shrink: 0; }
.quick.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.quick.primary .quick-ic { background: #ffffff26; color: #fff; }
.kpi .kpi-ic { color: var(--primary); display: inline-flex; }
.kpi.good strong { color: var(--ok-ink, #198754); }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.card-box h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.home-reg { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.home-reg:last-of-type { border-bottom: none; }
.grow { flex: 1; min-width: 0; }
.home-bars { height: 170px; }
.bar-col.today .bar-fill { background: var(--primary); }
.warn { color: #c78a00; }
@media (max-width: 900px) { .quick-row { grid-template-columns: repeat(2, 1fr); } }

/* ── shared dashboard pieces ──────────────────────────────────────────── */
.sub-body { display: grid; gap: 12px; }
.table tr.clickable { cursor: pointer; }
.mod-card.clickable { cursor: pointer; }
.mod-card.clickable:hover { background: var(--tint-soft, #f7faff); }
.table tr.clickable:hover td { background: var(--tint-soft, #f7faff); }
.row-gap { display: flex; gap: 6px; align-items: center; }
.row-gap select { flex: 1; }
.form-grid.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-grid.narrow { max-width: 560px; }
@media (max-width: 700px) { .form-grid.three, .form-grid.two { grid-template-columns: 1fr !important; } }
.notice.soft { background: var(--tint); border-color: var(--tint-line, #cfe2ff); }
.notice.locked-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 20px 0; font-weight: 600; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.section-head h4 { margin: 0; display: flex; align-items: center; gap: 6px; }
.reg-list { display: grid; gap: 8px; }
.reg-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: start; width: 100%; }
.reg-row:hover { border-color: var(--primary); }
.reg-row.off { opacity: 0.6; }
.reg-row .reg-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--tint); color: var(--primary); flex-shrink: 0; }
.reg-row .grow { display: grid; gap: 2px; }
/* One card for every choice of a look (register-editor.js optCard, M 2026-11-25): cards of one size side by side, the
   drawing in a box of one size, the word under it, big enough for anyone; the chosen one: the main colour around it, its
   tint inside and a tick in its corner. (the border never changes width: the colour comes as an inner line) */
.style-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.style-opt { position: relative; display: grid; grid-template-rows: 64px auto; justify-items: center; align-items: center; gap: 8px; min-height: 118px; padding: 14px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, box-shadow .15s; }
.style-opt:hover { border-color: var(--tint-line, #b9d6ff); }
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.style-opt .opt-art { display: grid; place-items: center; width: 100%; height: 64px; color: var(--muted); }
.style-opt .opt-label { text-align: center; line-height: 1.3; }
.style-opt:has(input:checked) { border-color: var(--primary); background: var(--tint); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.style-opt:has(input:checked) .opt-art { color: var(--primary); }
.style-opt:has(input:checked)::after { content: '✓'; position: absolute; top: 8px; inset-inline-start: 8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
/* the look, from the till's ⚙: a card at the top of its window, opening it beside the products */
.look-entry { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--primary); border-radius: 14px; background: var(--tint); color: var(--ink); text-align: start; cursor: pointer; box-shadow: var(--shadow-sm); font: inherit; }
.look-entry:hover { box-shadow: var(--shadow); }
.look-split { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.look-entry-ic { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: #fff; }
.look-entry-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.look-entry-text strong { font-size: 16px; }
.look-entry-text small { color: var(--muted); }
.look-entry > .ic:last-child { color: var(--primary); }
/* the photo tiles' two looks, each a small tile with a drawing for its photo (register-editor.js photoDemo) */
.photo-demo { position: relative; isolation: isolate; width: 88px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 7px 8px; text-align: start; font-size: 12px; line-height: 1.2; box-shadow: var(--shadow-sm); }
.photo-demo .pd-art { position: absolute; z-index: -1; display: block; }
.photo-demo .pd-art svg { display: block; width: 100%; height: 100%; }
/* (the words are placeholders — bars: a name of two lines and a price) */
.photo-demo i { display: block; height: 6px; border-radius: 3px; }
.photo-demo .pd-text { display: grid; gap: 4px; }
.photo-demo .pd-name { width: 62%; background: var(--ink); opacity: .75; }
.photo-demo .pd-name.short { width: 40%; }
.photo-demo .pd-price { width: 32%; height: 7px; background: var(--primary); }
.photo-demo.cover { justify-content: flex-end; gap: 5px; border-color: transparent; }
.photo-demo.cover .pd-art { inset: 0; }
.photo-demo.cover .pd-name, .photo-demo.cover .pd-price { background: #fff; opacity: 1; box-shadow: 0 0 4px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.5); }
.photo-demo.big { padding-top: 0; }
.photo-demo.big .pd-art { position: relative; z-index: 0; flex: none; height: 34px; margin: 0 -8px 2px; }
.photo-demo.thumb .pd-art { top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 6px; overflow: hidden; }
.photo-demo.thumb .pd-text { padding-inline-end: 34px; }
/* the categories' two looks, drawn small: a row of tabs, one underlined — or a grid of category tiles, one chosen */
.cat-demo { display: flex; width: 96px; height: 40px; align-items: center; }
.cat-demo.tabs { border: 1px solid var(--line); border-radius: 7px; background: var(--card); overflow: hidden; height: 26px; }
.cat-demo.tabs i { flex: 1; height: 100%; border-inline-end: 1px solid var(--line); background: linear-gradient(var(--muted), var(--muted)) center / 50% 4px no-repeat; opacity: .8; }
.cat-demo.tabs i:last-child { border: 0; }
.cat-demo.tabs i.on { background: linear-gradient(var(--primary), var(--primary)) center / 50% 4px no-repeat; box-shadow: inset 0 -3px 0 var(--primary); opacity: 1; }
.cat-demo.squares { display: grid; grid-template-columns: repeat(2, 30px); gap: 5px; width: auto; height: auto; justify-content: center; }
.cat-demo.squares i { width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--card) radial-gradient(circle at 50% 50%, var(--tint) 6px, transparent 6.5px); }
.cat-demo.squares i.on { border-color: var(--primary); background: var(--tint) radial-gradient(circle at 50% 42%, var(--primary) 7px, transparent 7.5px); }
/* the tiles' size: each square a little grid of tiles (4, 3, 2 a row), «مخصص» a slider under them */
.size-pick-wrap { display: grid; gap: 10px; }
.size-demo { display: grid; gap: 3px; width: 44px; height: 44px; }
.size-demo i { border-radius: 3px; background: var(--muted); opacity: .45; }
.style-opt:has(input:checked) .size-demo i { background: var(--primary); opacity: .8; }
.size-demo.n4 { grid-template-columns: repeat(4, 1fr); gap: 2px; }
.size-demo.n3 { grid-template-columns: repeat(3, 1fr); }
.size-demo.n2 { grid-template-columns: repeat(2, 1fr); gap: 4px; }
.size-demo.custom { place-items: center; border: 1.5px dashed var(--line); border-radius: 8px; color: var(--muted); }
.style-opt:has(input:checked) .size-demo.custom { border-color: var(--primary); color: var(--primary); }
.sub-list { display: grid; gap: 6px; }
.sub-row { display: flex; gap: 6px; align-items: center; }
.sub-row input:not(.grow) { width: 110px; flex-shrink: 0; }
.sub-row select.line-unit { width: 96px; flex-shrink: 0; }
/* (a unit with nothing to switch to: the same box, without the arrow) */
.sub-row > select.line-unit.ctl:disabled { background-image: none; color: var(--ink); opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-x { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 2px; display: inline-flex; vertical-align: middle; }
.btn.disabled { opacity: 0.45; pointer-events: none; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.copy-row input { font-size: 12px; color: var(--muted); }

/* accounting */
.statement { gap: 0; }
.st-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.st-row.sub { font-weight: 700; border-bottom: 1px solid var(--ink); }
.st-row.grand { font-weight: 800; font-size: 17px; border-bottom: none; padding-top: 10px; }
.st-row.grand.pos .mono { color: var(--ok-ink, #198754); }
.st-row.grand.neg .mono, .st-row .mono:has(+ *) { color: inherit; }
.st-row.grand.neg .mono { color: var(--danger); }
.st-head { font-weight: 800; color: var(--muted); font-size: 13px; padding: 12px 0 2px; }
.st-check { display: flex; align-items: center; gap: 6px; font-weight: 700; padding: 8px 10px; border-radius: 10px; margin-top: 8px; }
.st-check.ok { background: #e8f7ee; color: #146c43; }
.st-check.bad { background: var(--danger-bg, #fdecec); color: var(--danger); }
.acc-group h4 { margin: 8px 0 6px; }
.jv-lines { display: grid; gap: 6px; }
.jv-line { display: grid; grid-template-columns: 1fr 120px 120px; gap: 6px; }
@media (max-width: 700px) { .jv-line { grid-template-columns: 1fr 1fr; } .jv-line select { grid-column: 1 / -1; } }
.remaining.bad { color: var(--danger); }

/* purchases */
.pl-head { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pl-lines { display: grid; gap: 8px; margin: 10px 0; }
.pl-line { display: grid; grid-template-columns: 1fr 90px 110px 80px auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.pl-line .pl-name { align-self: center; }
.pl-extra { grid-column: 1 / -1; display: flex; gap: 6px; }
@media (max-width: 700px) { .pl-line { grid-template-columns: 1fr 1fr; } .pl-name { grid-column: 1 / -1; } }

/* till additions */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.pick { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; cursor: pointer; font-weight: 600; display: grid; gap: 4px; justify-items: center; text-align: center; }
.pick:hover { border-color: var(--primary); }
.pick.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pick.variant span { color: var(--primary); font-weight: 700; }
/* Serial / IMEI chips: 15+ digit numbers wrap inside their chip instead of running into the next one. */
.pick-grid:has(.pick.mono) { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.pick.mono { min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; letter-spacing: -0.2px; padding: 10px 6px; }
.line-offer { color: var(--ok-ink, #198754); display: inline-flex; align-items: center; gap: 2px; }
/* a line sold under its cost (till, office invoice) */
.line-low, .line-name small.line-low { color: var(--danger); display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.line-low[hidden] { display: none; }
.offer-row { color: var(--ok-ink, #198754); }
.note-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 13px; max-width: 180px; overflow: hidden; }
.tile-variants { color: var(--muted); font-weight: 500; font-size: 12px; }
.redeem-row { display: flex; gap: 8px; align-items: end; }
.wallet-history { display: grid; max-height: 220px; overflow-y: auto; }
.cust-bar { flex-wrap: wrap; }

/* sale layouts */
.grid.style-list { grid-template-columns: 1fr !important; gap: 6px; }
.grid.style-list .tile { flex-direction: row; align-items: center; justify-content: space-between; min-height: 0; padding: 12px 14px; aspect-ratio: auto; }
.grid.style-list .tile-name { -webkit-line-clamp: 1; }
.grid.style-list .tile-foot { gap: 10px; }
.grid.style-compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important; gap: 6px; }
.grid.style-compact > .tile:not(.has-img) { height: 72px; padding: 8px; }
.grid.style-compact .tile-name.long, .grid.style-compact .tile-name.longer { font-size: 11.5px; -webkit-line-clamp: 2; }
.grid.style-compact .tile-name { font-size: 13px; }
.grid.size-s { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.grid.size-l { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.size-l .tile-name { font-size: 17px; }
.grid.size-l:not(.style-list) > .tile:not(.has-img) { height: 120px; }
.grid.covers:not(.style-list) > .tile:not(.has-img) { height: 124px; }
.grid.covers.size-l:not(.style-list) > .tile:not(.has-img) { height: 156px; }
/* (photos small in a corner: every tile a little taller, with one or without, so the photo can be seen) */
.grid.thumbs:not(.style-list) > .tile:not(.has-img) { height: 124px; }
.grid.thumbs.size-l:not(.style-list) > .tile:not(.has-img) { height: 150px; }
.grid.thumbs.style-compact > .tile:not(.has-img) { height: 88px; }
.grid.size-l:not(.style-list) > .tile.has-img { grid-template-rows: auto 60px auto; }
.grid.style-compact.size-s { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important; }
.grid.style-compact.size-l { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }
/* «مخصص»: the tiles' width from the look's slider (pos.js sets --tile-*), their heights after it; a phone keeps its own */
@media (min-width: 861px) {
  .grid.size-c:not(.style-list) { grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)) !important; }
  .grid.size-c:not(.style-list) > .tile:not(.has-img) { height: var(--tile-h); }
  .grid.size-c.covers:not(.style-list) > .tile:not(.has-img), .grid.size-c.thumbs:not(.style-list) > .tile:not(.has-img) { height: var(--tile-hp); }
  .grid.size-c > .tile { --thumb: var(--tile-th); }
  .grid.size-c.big-names .tile-name { font-size: 17px; }
}

/* public invoice page */
.public-invoice { overflow: auto !important; height: auto !important; }
.public-invoice #app { height: auto; }
.public-wrap { max-width: 820px; margin: 0 auto; padding: 16px; display: grid; gap: 12px; }
.public-bar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
/* Everything tappable looks tappable: menu items are light buttons, ghost buttons in bars get a border. */
.sb-item { background: var(--soft, #f5f7fa); }
.sb-item:hover { background: var(--soft-2, #edf1f6); }
.pos-bar .btn.ghost, .sb-actions .btn.ghost, .pagebar .btn.ghost, .cust-bar .btn.ghost { border-color: var(--line); }
.pos-title .branch-name::before { content: ' · '; }
.pos-title .pos-user { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; }
@media (max-width: 700px) { .pos-title .branch-name, .pos-bar .status { display: none; } }
/* customer at the till: name + small figures on one line, the buttons below */
.cust-bar .cust-chip { flex: 1 1 100%; flex-wrap: wrap; row-gap: 2px; }
.cust-chip small { white-space: nowrap; direction: rtl; unicode-bidi: isolate; font-family: inherit; }
[dir='ltr'] .cust-chip small { direction: ltr; }
@media (max-width: 860px) {
  .pos-bar .btn.danger span, .pos-bar .back-btn span { display: none; }
  .pos-title small { display: none; }
  .pos-title strong { max-width: 46vw; }
  .cart { max-height: 60vh; min-width: 0; }
  .pos { grid-template-columns: minmax(0, 1fr) !important; }
  .catalog { min-width: 0; }
}

/* ── The label page (labels.js) ── */
.lb-screen { height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.lb-tabs { display: none; padding: 8px 12px 0; }
.lb-tabs .segmented { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.lb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .9fr) minmax(340px, 1fr); gap: 12px; padding: 12px; }
.lb-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.lb-search { padding: 10px 10px 0; }
.lb-search input { width: 100%; }
.lb-cats { padding: 8px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.lb-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 10px 10px; align-content: start; scrollbar-width: none; }
.lb-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; padding-inline-end: 34px; text-align: start; min-height: 92px; }
.lb-tile strong { line-height: 1.3; }
.lb-tile.on { border-color: var(--brand); background: var(--tint); }
.lb-tile-price { font-weight: 700; color: var(--brand); margin-top: auto; }
.lb-badge { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.lb-nocode { color: var(--warn-ink, #b45309); font-size: 12px; }
.lb-queue-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 42px; }
.lb-rows { flex: 1; overflow: auto; scrollbar-width: none; }
.lb-row { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.lb-row-main { flex: 1; min-width: 0; }
.lb-row-main > strong { font-weight: 700; }
.lb-row-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.lb-exp { color: var(--ink); }
.lb-stepper { display: flex; align-items: center; gap: 2px; }
.lb-qty { width: 58px; text-align: center; }
.lb-all { min-width: 28px; text-align: center; font-weight: 700; }
.lb-summary { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.lb-sum-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; }
.lb-design { overflow: auto; scrollbar-width: none; }
.lb-preview-card { position: sticky; top: 0; z-index: 1; padding: 16px 12px 10px; background: repeating-conic-gradient(var(--soft-2, #eef1f5) 0 25%, var(--card) 0 50%) 50% / 16px 16px; border-bottom: 1px solid var(--line); display: grid; justify-items: center; gap: 8px; }
.lb-preview { width: 100%; display: flex; justify-content: center; overflow: hidden; }
.lb-stage { transform-origin: top center; }
.lb-stage .lbl-row { box-shadow: 0 2px 12px rgba(20, 34, 49, .16); }
.lb-design-body { padding: 0 14px 14px; }
.lb-sec { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.lb-sec:last-child { border-bottom: 0; }
.lb-sec h4 { margin: 0; font-size: 14px; }
.lb-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.lb-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.lb-inline > .field, .lb-inline > select { flex: 1; min-width: 110px; }
.lb-num { width: 100%; }
.lb-note { color: var(--warn-ink, #b45309); margin: 0; }
.lb-pur-list { max-height: 60vh; overflow: auto; display: grid; gap: 6px; }
.lb-pur-list .pick { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: start; }
@media (max-width: 1100px) {
  .lb-tabs { display: block; }
  .lb-body { grid-template-columns: 1fr; }
  .lb-body > .lb-pane { display: none; }
  .lb-body.tab-products .lb-products, .lb-body.tab-queue .lb-queue, .lb-body.tab-design .lb-design { display: flex; }
}

/* One label (label-render.js): mm all through, black on white — the same on screen, on paper and to a label printer. */
.lbl { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2mm; text-align: center; overflow: hidden; flex: none; background: var(--card); color: #000; font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif; line-height: 1.15; }
.lbl.bordered { border: .3mm solid #000; border-radius: 1mm; }
.lbl .lf { width: 100%; white-space: nowrap; overflow: hidden; }
.lbl .lf-name, .lbl .lf-price, .lbl .lf-date.exp { font-weight: 700; }
.lbl .lf-name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.2; overflow-wrap: anywhere; }
.lbl .lf-price.big { font-weight: 800; }
.lbl .lf-code { letter-spacing: .15mm; }
.lbl .lf-bars { display: flex; justify-content: center; width: 100%; }
.lbl.dates-only .lf-date { font-weight: 800; }
.lbl-qr { flex-direction: row; justify-content: flex-start; gap: 1.5mm; }
.lbl-qr .lbl-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .2mm; }
.lbl-row { display: flex; direction: ltr; background: var(--card); }
.lb-measure { position: fixed; left: -10000px; top: 0; }
#print-area .lb-roll-page { break-after: page; page-break-after: always; }
#print-area .lb-sheet { display: grid; width: 210mm; height: 297mm; box-sizing: border-box; align-content: start; break-after: page; page-break-after: always; }
#print-area .lb-roll-page:last-child, #print-area .lb-sheet:last-child { break-after: auto; page-break-after: auto; }
.form-grid.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .form-grid.four { grid-template-columns: 1fr 1fr; } }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.g-slot { width: 72px; height: 72px; border: 1px dashed var(--line); border-radius: 10px; position: relative; display: grid; place-items: center; overflow: hidden; }
.g-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-slot .btn { position: relative; z-index: 1; }
.line-price { border: none; background: #f1f4f8; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 3px; align-items: center; width: fit-content; }
.switch-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.switch-chip input { width: 16px; height: 16px; }
.switch-chip:has(input:checked) { background: var(--warn-bg); border-color: var(--warn-line, #ffe08a); }
.coupon-row { display: flex; gap: 8px; align-items: end; }
.coupon-row .field { flex: 1; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.perm-group summary { display: flex; justify-content: space-between; align-items: center; font-weight: 700; cursor: pointer; padding: 4px 0; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.perm input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.perm span { display: grid; gap: 2px; }
.perm small { color: var(--muted); }
.reg-row.static { cursor: default; }
.mod-edit-row .mod-stock { width: 150px; }
.mod-edit-row .mod-qty { width: 64px; }
.jv-line.wide { grid-template-columns: 1fr 110px 110px 1fr 140px; }
@media (max-width: 800px) { .jv-line.wide { grid-template-columns: 1fr 1fr; } .jv-line.wide select:first-child { grid-column: 1 / -1; } }
.sub-account { padding-inline-start: 14px; color: var(--ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink, #8a6100); }
.pill.danger { background: var(--danger-bg, #fdecec); color: var(--danger); }
.attach { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.attach-row { display: flex; align-items: center; gap: 8px; }
.alloc-list { display: grid; gap: 6px; }
.pl-search { align-items: flex-start; }
.r-bc { height: 12mm; margin: 4px 0; }
.r-bc svg { width: 70%; height: 100%; }
/* (on A4, 70% of the page was a barcode across it: one a scanner reads, no bigger) */
.a4 .r-bc { height: 9mm; }
.a4 .r-bc svg { width: 45mm; }
.r-social { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px 10px; margin-top: 6px; }
.r-social-item { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; font-weight: 600; }
.r-credit { margin-top: 6px; text-align: center; font-size: .85em; }
.r-social-mark { flex: none; display: inline-flex; width: 1.25em; height: 1.25em; }
.r-social-mark svg { width: 100%; height: 100%; fill: #000; }
.r-social-name { min-width: 0; overflow-wrap: anywhere; color: inherit; text-decoration: none; }
.social-cell { display: grid; gap: 6px; align-content: start; min-width: 0; }
.social-box { position: relative; }
/* (the boxes are left-to-right whatever the page's language: the picture is before the name) */
.social-box img { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none; }
.social-box input { padding-left: 40px; }
.mo-social-link img { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 6px; }
.r-footer-img { max-width: 50%; max-height: 30mm; margin-top: 4px; }
.kpi.bad strong { color: var(--danger); }
/* label + select rows (routing, payment method accounts): half and half */
.sub-row > span.grow { min-width: 0; }
.sub-row > span.grow + select { flex: 0 0 52%; width: 52%; }
@media (max-width: 600px) { .sub-row:has(> span.grow + select) { flex-wrap: wrap; } .sub-row > span.grow + select { flex-basis: 100%; width: 100%; } }

/* Saudi mobile input: flag + country code + number (always left-to-right). */
.phone-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 12px; cursor: text; }
.phone-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.phone-input .flag { display: inline-flex; flex: none; }
.phone-input .flag svg { border-radius: 2px; box-shadow: 0 0 0 1px #0001; }
.phone-input .cc { color: var(--muted); font-weight: 600; flex: none; }
.phone-input input { border: none !important; box-shadow: none !important; outline: none; background: transparent; padding-inline: 0 !important; flex: 1; min-width: 0; letter-spacing: .04em; }
.phone-input.big input { font-size: 20px; font-weight: 700; }
.phone-input:has(input.bad) { border-color: var(--danger); }

/* Sign-up: confirm the mobile by SMS. */
.verify-card .auth-intro { text-align: center; }
.verify-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--tint); color: var(--primary); margin-bottom: 6px; }
.verify-number { font-size: 26px; font-weight: 700; letter-spacing: .06em; margin: 6px 0; unicode-bidi: isolate; }

/* Points of sale: branch chips + a card per point of sale with its own buttons. */
.reg-branches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.reg-card .reg-actions { display: grid; gap: 6px; width: 100%; margin-top: 6px; }
.reg-card > .btn { width: 100%; margin-top: 6px; }
div.reg-card { cursor: default; }

/* Sidebar accordion: a section header (button) folds its pages; the arrow turns when open. */
.sb-head { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; background: var(--soft, #f5f7fa); border-radius: 10px; padding: 9px 10px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); text-align: start; }
.sb-head:hover { background: var(--soft-2, #edf1f6); color: var(--ink); }
.sb-acc.open .sb-head { color: var(--ink); }
.sb-chev { transition: transform .2s var(--ease, ease); }
.sb-acc.open .sb-chev { transform: rotate(180deg); }
.sb-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s var(--ease, ease); }
.sb-acc.open .sb-items { grid-template-rows: 1fr; }
.sb-items > div { overflow: hidden; display: grid; gap: 2px; padding-inline-start: 6px; }
.sb-acc.open .sb-items > div { padding-top: 2px; }
.sb-items > div { visibility: hidden; transition: visibility 0s .22s; }
.sb-acc.open .sb-items > div { visibility: visible; transition: none; }

/* Home: the filter (period chips, dates, branch) and wide, even summary cards. */
.home-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.home-filter .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.home-custom { display: flex; align-items: center; gap: 8px; }
.home-custom input { width: auto; }
.home-branch { width: auto; min-width: 180px; }
.home-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; gap: 12px; }
.home-kpis .kpi { padding: 18px 20px; gap: 6px; border-radius: 14px; }
.home-kpis .kpi small { font-size: 14px; }
.home-kpis .kpi strong { font-size: 26px; }
.home-kpis .kpi.main { background: var(--primary); border-color: var(--primary); color: #fff; }
.home-kpis .kpi.main small, .home-kpis .kpi.main .kpi-ic { color: #fff; }
.home-bars.dense .bar-col small { font-size: 9px; }
@media (max-width: 640px) { .home-kpis { grid-template-columns: repeat(2, 1fr) !important; } .home-kpis .kpi strong { font-size: 20px; } }

/* Till: one pay button, park + More beside it, all three as tall as Pay. */
.pay { display: flex !important; align-items: stretch; gap: 8px; padding: 0 14px 12px; }
.pay-btn { flex: 1; min-width: 0; width: auto; font-size: 20px; padding: 16px; justify-content: center; }
.pay > .btn:not(.pay-btn) { flex: 0 0 auto; flex-direction: column; justify-content: center; gap: 4px; min-width: 72px; padding: 6px 10px; font-size: 13px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.more-grid .btn { justify-content: flex-start; padding: 14px; background: var(--soft, #f5f7fa); }

/* Pay window: who → total → how → details. */
.pay-sheet { display: grid; gap: 14px; }
.pay-who { display: grid; gap: 8px; }
.pay-who-row { display: flex; align-items: center; gap: 10px; background: var(--soft, #f5f7fa); border-radius: 12px; padding: 8px 12px; min-height: 48px; }
.pay-who-row .grow { flex: 1; min-width: 0; }
.pay-seller { width: auto; min-width: 160px; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.pay-due span { font-weight: 700; font-size: 18px; }
.pay-due strong { font-size: 32px; direction: ltr; unicode-bidi: isolate; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pay-method { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); font: inherit; font-weight: 700; cursor: pointer; }
.pay-method:hover { border-color: var(--tint-line, #b8d4ff); }
.pay-method.on { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.pay-method.warn.on { border-color: #e0a800; background: var(--warn-bg); color: var(--warn-ink, #8a6100); }
.pay-panel { min-height: 120px; }

/* After a sale / quotation / return / drawer cash. */
.done-sheet { display: grid; justify-items: center; gap: 12px; text-align: center; }
.done-ic { color: var(--ok-ink, #198754); }
.done-number { font-size: 20px; font-weight: 800; }
.done-sheet .sums { width: 100%; max-width: 380px; }
.done-big { display: grid; gap: 2px; background: var(--tint); color: var(--primary); border-radius: 14px; padding: 12px 24px; }
.done-big strong { font-size: 34px; direction: ltr; unicode-bidi: isolate; }
.done-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; max-width: 380px; }
.pay-side { display: grid; gap: 14px; align-content: start; }
@media (min-width: 900px) {
  .pay-sheet { grid-template-columns: 1.1fr 1fr; align-items: start; gap: 20px; }
  .pay-panel { border-inline-start: 1px solid var(--line); padding-inline-start: 20px; }
}
/* (.modal comes later in this file, so the wide sizes need the extra class to win.) */
.modal.modal-wide { width: min(560px, 100%); }
.modal.modal-xl { width: min(980px, 100%); }
.modal.modal-xl:has(.pay-sheet) { width: min(880px, 100%); }
.sum-head { font-size: 12px; font-weight: 800; color: var(--muted); padding: 10px 0 2px; border-bottom: 1px solid var(--line); }

/* ── Settings: cards, switches, a save bar that lights up when something changed ── */
.p-section { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.p-section h4 { margin: 0; font-size: 14px; color: var(--muted); }
.set-form { display: grid; gap: 16px; padding-bottom: 8px; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm, 0 1px 2px #0000000d); }
.set-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--soft, #fbfcfe), var(--card)); }
.set-head h3 { margin: 0; font-size: 16px; }
.set-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.set-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--tint); color: var(--primary); }
.set-body { display: grid; gap: 4px; padding: 14px 18px 16px; }
.set-body > .form-grid { margin-top: 6px; }
.set-actions { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.set-link { display: flex; align-items: flex-end; padding-bottom: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 2px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.switch-row:last-child { border-bottom: none; }
.sw-text { display: grid; gap: 2px; }
.sw-text strong { font-weight: 600; }
.sw-text small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; padding: 0; border: none; border-radius: 999px; background: #cfd6e0; position: relative; cursor: pointer; transition: background .18s; }
input.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px #0003; transition: inset-inline-start .18s; }
input.switch:checked { background: var(--primary); }
input.switch:checked::after { inset-inline-start: 21px; }
input.switch:focus-visible { outline: 3px solid var(--ring-strong, #0075ff55); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-top: 4px; background: var(--glass, #ffffffee); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 18px #0000000a; }
.save-bar .save-note { color: var(--muted); font-size: 13px; }
.save-bar .save-ic { color: var(--ok-ink, #198754); }
.save-bar.dirty { border-color: #ffd65a; background: #fffbea; }
.save-bar.dirty .save-note { color: var(--warn-ink, #8a6100); font-weight: 600; }
.save-bar.dirty .save-ic { color: #e0a800; }
.tz-clock { color: var(--muted); }
.set-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.set-preview { position: sticky; top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.set-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-branch { width: auto; max-width: 180px; padding: 6px 10px; }
.pic-slot { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pic-slot:last-child { border-bottom: none; }
.pic-slot .grow { display: grid; gap: 3px; }
.pic-box { flex: none; width: 84px; height: 64px; border: 1px dashed #c9d2de; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--soft, #fafbfd); overflow: hidden; }
.pic-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pic-actions { display: flex; gap: 6px; margin-top: 4px; }
.set-sub { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.set-sub > div { display: grid; }
.set-sub small { color: var(--muted); }
@media (max-width: 960px) { .set-split, .set-split.half { grid-template-columns: 1fr; } .set-preview { position: static; } }

/* ── Points of sale: tidy tiles; ⚙ settings in the corner; the "add" tile ── */
/* The points of sale: their tiles in the middle of the screen (across, and down while they fit), never an empty column
   beside them. (auto margins: a long list still scrolls from its top) */
.picker-page { display: flex; flex-direction: column; }
.picker-page > :first-child { margin-top: auto; }
.picker-page > :last-child { margin-bottom: auto; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 280px)); justify-content: center; gap: 16px; width: 100%; }
.reg-card { position: relative; align-content: start; min-height: 240px; padding-block: 28px 18px; }
.reg-card .reg-ic { width: 60px; height: 60px; border-radius: 16px; }
.reg-card strong { font-size: 18px; }
.picker-page .reg-branches { justify-content: center; }
.reg-card .reg-gear { position: absolute; top: 8px; inset-inline-end: 8px; }
.reg-card.off { opacity: .6; background: var(--soft, #fafbfd); }
.reg-card.fresh { border-color: var(--primary); box-shadow: 0 0 0 4px var(--tint); }
.reg-card.fresh .reg-gear { background: var(--tint); color: var(--primary); }
.reg-add { border: 2px dashed var(--tint-line, #b8d4ff); background: var(--tint-soft, #f7faff); color: var(--primary); font: inherit; justify-content: center; align-content: center; cursor: pointer; }
.reg-add:hover { background: var(--tint); }
.reg-add .reg-ic { background: var(--card); }
.mysr-box { min-height: 120px; } .mysr-box .mysr-form { margin: 0 auto; }
.warn-note { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin: 0; }
/* The one pay window (billing-ui.js checkout): the price big, what it gives, one button. Its foot keeps one height
   whatever it shows — the button, the wait for the payment, that it is paid — so nothing jumps. */
.pay-win { display: grid; gap: 16px; min-width: min(380px, 80vw); }
.pay-win-price { display: grid; justify-items: center; gap: 2px; padding: 18px 12px; background: var(--tint); border-radius: 14px; }
.pay-win-price b { font-size: 44px; font-weight: 800; line-height: 1.1; direction: ltr; unicode-bidi: isolate; }
.pay-win-price small { color: var(--muted); font-weight: 600; }
.pay-win-gives { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pay-win-gives li { display: flex; gap: 8px; align-items: flex-start; font-size: 15.5px; }
.pay-win-gives li svg { flex: none; margin-block-start: 3px; color: var(--ok-ink, #198754); }
.pay-win-lines { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.pay-win-go { display: grid; gap: 8px; justify-items: center; align-content: center; min-height: 104px; text-align: center; }
.pay-win-go.with-cancel { min-height: 148px; }
.pay-win-go .pay-win-btn { font-size: 18px; }
.pay-win-go > small { display: inline-flex; align-items: center; gap: 4px; }
.pay-win-wait, .pay-win-done { display: inline-flex; align-items: center; gap: 10px; font-size: 16.5px; }
.pay-win-done { color: var(--ok-ink, #198754); }
.pay-win-spin { flex: none; width: 18px; height: 18px; border: 2px solid var(--primary); border-inline-end-color: transparent; border-radius: 50%; animation: wl-spin .7s linear infinite; }
.pay-waiting-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pay-waiting-bar .grow { flex: 1 1 220px; min-width: 0; }
/* «الفواتير»: the item on one line, cut short (the whole list on hover) */
.table.bills td.bills-item { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* on a phone each one is a small card: what and how much, then its type and state, then its reference and date */
@media (max-width: 640px) {
  .table.bills thead { display: none; }
  .table.bills, .table.bills tbody { display: block; }
  .table.bills tbody tr:not(.empty-row) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.bills tbody tr:not(.empty-row) td { padding: 0; border: 0; white-space: nowrap; }
  .table.bills td:nth-child(3) { grid-area: 1 / 1; font-weight: 700; max-width: none; }
  .table.bills td:nth-child(5) { grid-area: 1 / 2; font-weight: 700; }
  .table.bills td:nth-child(2) { grid-area: 2 / 1; color: var(--muted); font-size: 13px; }
  .table.bills td:nth-child(6) { grid-area: 2 / 2; justify-self: end; }
  .table.bills td:nth-child(1) { grid-area: 3 / 1; color: var(--muted); font-size: 13px; }
  .table.bills td:nth-child(4) { grid-area: 3 / 2; color: var(--muted); font-size: 13px; justify-self: end; }
  .table.bills td:nth-child(7):not(:empty) { grid-area: 4 / 1 / 5 / 3; }
  .table.bills td:nth-child(7):empty { display: none; }
  .table.bills td:nth-child(7) .sub-row-actions { justify-content: stretch; }
  .table.bills td:nth-child(7) .btn { flex: 1; }
}

/* Sidebar «Point of sale»: stays blue on hover / when current; its ⚙ opens the points of sale. */
.sb-item.sb-pos, .sb-item.sb-pos.on { background: var(--primary); color: #fff; }
.sb-item.sb-pos:hover { background: var(--primary-2, #1a85ff); filter: none; }
.sb-item.sb-pos.on { box-shadow: 0 0 0 3px var(--tint); }
/* «Point of sale»: one blue badge — the till button, «مفتوحة» when open here, and its ⚙ inside */
.sb-pos-wrap { display: flex; gap: 4px; align-items: center; margin: 0; padding: 4px; border-radius: var(--radius); background: var(--primary); }
.sb-pos-wrap:hover { background: var(--primary-2, #1a85ff); }
.sb-pos-wrap.on { box-shadow: 0 0 0 3px var(--tint); }
.sb-pos-wrap .sb-item.sb-pos, .sb-pos-wrap .sb-item.sb-pos:hover { margin: 0; flex: 1; background: inherit; box-shadow: none; }
.sb-pos-state { margin-inline-start: auto; padding: 2px 8px; border-radius: 999px; background: #ffffff2e; color: #fff; font-size: 12px; font-weight: 700; }
.sb-pos-manage { flex: none; border-radius: 10px; background: #ffffff24; color: #fff; border: none; }
.sb-pos-manage:hover { background: #ffffff40; }

/* "?" next to a setting: a round blue button that opens its explanation. */
.help-btn { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font: inherit; font-weight: 800; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px var(--ring-strong, #0075ff55); vertical-align: middle; }
.help-btn:hover { filter: brightness(1.1); }
.help-btn:focus-visible { outline: 3px solid var(--ring-strong, #0075ff55); outline-offset: 2px; }
.help-body p { margin: 0 0 8px; line-height: 1.7; }

.sw-end { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.set-readonly { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft, #fafbfd); align-self: end; }
/* (the "full width" rule for a tile's main button must not stretch its ⚙) */
.reg-card > .btn.reg-gear { width: 34px; height: 34px; margin: 0; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; background: var(--soft, #f5f7fa); }
.reg-card > .btn.reg-gear:hover { background: var(--tint); color: var(--primary); }

/* Sidebar: one text size for every line — pages, the point of sale and the section headers. */
.sb-item, .sb-head, .sb-item.sb-pos { font-size: 15px; font-weight: 600; line-height: 1.4; }
.sb-head { color: var(--ink); }
.sb-head:hover, .sb-acc.open .sb-head { color: var(--ink); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Subscription: yearly / monthly plan cards, the period switch, Tamara, the complete-your-account card. */
.period-switch { display: flex; gap: 6px; }
.tamara-btn { width: 100%; justify-content: center; padding: 12px; background: #fff7f0; border: 1px solid #f5c39a; color: #3a2a1a; }
.tamara-btn strong { font-weight: 900; letter-spacing: .02em; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.complete-card { border-color: var(--tint-line, #b8d4ff); background: linear-gradient(180deg, var(--tint), var(--card) 60%); margin-bottom: 14px; }
.complete-head { display: flex; gap: 10px; align-items: flex-start; color: var(--primary); }
.complete-head h4 { margin: 0; color: var(--ink); }

/* ── one size system: controls and buttons share heights (sm 34 · md 42 · lg 52) ── */
input.ctl:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select.ctl, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select { min-height: 42px; }
input.ctl[type=checkbox], input.ctl[type=radio] { min-height: 0; }
textarea.ctl, textarea { min-height: 84px; }
.btn { min-height: 42px; padding-block: 0; line-height: 1.2; font-size: 15px; }
.btn.small { min-height: 34px; font-size: 13px; padding-block: 0; }
.btn.big { min-height: 52px; font-size: 17px; padding-block: 0; }
.btn.huge { min-height: 60px; }
.btn.icon-only { min-width: 42px; padding-inline: 0; }
.btn.small.icon-only { min-width: 34px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-row > .btn { margin: 0; }
.modal-actions .btn { min-height: 42px; font-size: 15px; padding-inline: 18px; }
.icon-btn.chip-x { width: auto; height: auto; min-height: 0; padding: 0 0 0 2px; background: transparent; }

/* Every text input and select is exactly 42px (big amounts, codes and the till search are their own size). */
input.ctl:not([type=checkbox]):not([type=radio]):not([type=file]):not(.big-input):not(.otp-input):not(.search), select.ctl:not(.big-input) { height: 42px; min-height: 42px; padding-block: 0; box-sizing: border-box; }

/* ═══ Phones (≤ 640px): no zoom, one type scale, full-screen windows, tidy grids ═══ */
@media (max-width: 640px) {
  /* iOS zooms into any field under 16px: every field is 16px on phones. */
  input, select, textarea, .ctl { font-size: 16px !important; }
  /* One type scale: body 15, small 13, buttons 15 (14 small), titles 18/16. */
  body, .btn, .sb-item, .sb-head, .chip, td, th, label, .field > span { font-size: 15px; }
  .btn.small, small, .small, .muted.small { font-size: 13px; }
  .pagebar h2 { font-size: 18px; }
  h3, .modal-head h3 { font-size: 17px; }
  h4 { font-size: 15px; }

  /* Windows: the whole screen; the title stays on top, the buttons stay at the bottom, full width. */
  .modal-backdrop { align-items: stretch !important; padding: 0 !important; }
  .modal, .modal.modal-wide, .modal.modal-xl, .modal.modal-xl:has(.pay-sheet) { width: 100vw !important; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; display: flex; flex-direction: column; animation: wl-sheet-up .22s var(--ease, ease); }
  .modal-head { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
  .modal-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
  .modal-actions { position: sticky; bottom: 0; z-index: 2; background: var(--card); display: flex; gap: 8px; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px #0b1b330d; }
  .modal-actions .btn { flex: 1 1 0; min-height: 46px; margin: 0; }
  .form-grid.two, .form-grid.three, .split-grid, .split-grid.three { grid-template-columns: 1fr; }

  /* Cards: two per row, full width — never one narrow card with empty space beside it. */
  .kpis, .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .plan-card > * { width: auto; min-width: 0; max-width: 100%; }
  .meters, .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .two-col { grid-template-columns: 1fr !important; }
  .rep-grid, .reg-grid, .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .card-box { padding: 14px; }
  .meter { min-width: 0; padding: 12px; }
  .meter > *, .meter-foot > * { min-width: 0; }
  .meter-foot .btn { width: 100%; height: auto; min-height: 40px; white-space: normal; line-height: 1.35; padding-block: 6px; }
  /* an odd last card takes the whole row instead of leaving a hole beside it */
  .meters > :last-child:nth-child(odd), .kpis > :last-child:nth-child(odd), .home-kpis > :last-child:nth-child(odd), .rep-grid > :last-child:nth-child(odd), .more-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .home-filter .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .home-filter .chips::-webkit-scrollbar { display: none; }
  .home-filter .chips .chip { flex: none; }
  .home-kpis .kpi { padding: 14px; gap: 4px; }

  /* Sidebar foot: language · support · sign out on one line. */
  .sb-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sb-actions .btn { padding-inline: 6px; justify-content: center; min-width: 0; }
  .sb-actions .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Toolbars wrap neatly; buttons in them share the row. */
  .toolbar { gap: 8px; }
  .toolbar > .btn, .toolbar > .btn-row { flex: 1 1 auto; }
  .page-body, .admin-body { padding: 12px; }
}
@keyframes wl-sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* Complete-your-details: the same yellow badge as the plan's. */
.sb-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.sb-actions .btn { flex: 1 1 0; min-width: 0; }

/* Settings → Start over: keep tiles, what goes, the undo banner. */
.reset-keep { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.reset-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); text-align: start; cursor: pointer; font: inherit; min-height: 64px; }
.reset-tile.on { border-color: var(--primary); background: var(--tint, #eef5ff); }
.reset-tile-ic { color: var(--muted); display: inline-flex; flex: none; }
.reset-tile.on .reset-tile-ic { color: var(--primary); }
.reset-tile-txt { display: grid; gap: 2px; min-width: 0; }
.reset-tile-txt small { color: var(--muted); font-size: 13px; }
.reset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.reset-chip { background: var(--danger-bg, #fdecee); color: #8a1c1c; border: 1px solid #f3c6cb; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.reset-chip b { font-weight: 800; }
.reset-always, .reset-safe { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.reset-always > svg, .reset-safe > svg { flex: none; margin-top: 3px; color: var(--primary); }
.reset-go { margin-top: 18px; width: 100%; }
.set-ic.danger { color: var(--danger); background: var(--danger-bg, #fdecee); }
.reset-undo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius); background: #fff8e1; border: 1px solid #f1d27a; }
.reset-undo > div { flex: 1; min-width: 0; }
.reset-undo p { margin: 2px 0 0; }
@media (max-width: 640px) {
  .reset-keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reset-keep > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* option rows in the modifiers window: name · price · default, then stock item · qty · delete */
  .mod-edit-row { grid-template-columns: minmax(0, 1fr) 88px auto; }
  .mod-edit-row > .mod-stock { width: 100%; }
  .mod-edit-row > .mod-qty { width: 100%; }
  /* page tabs: one row that slides sideways instead of three wrapped rows */
  .subtabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs > * { flex: none; }
  .reset-undo { flex-wrap: wrap; }
  .reset-undo .btn { width: 100%; }
}

/* this device's printers (printers.js, Wasla One app only) */
.printers { display: grid; gap: 12px; }
.printer-list { display: grid; gap: 8px; }
.printer-row { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.printer-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.printer-info strong, .printer-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.printer-form { display: grid; gap: 10px; }
.printer-roles { display: flex; flex-wrap: wrap; gap: 14px; }
.printer-device { display: flex; align-items: center; gap: 6px; }
.printer-device select { flex: 1; min-width: 0; }

/* ── windows on tablets (and any wide screen) ───────────────────────────
   Always inside what is visible: with the keyboard up the screen is shorter (dvh follows it), the
   body scrolls, the title and buttons stay. Nothing in a window may push it sideways. */
.modal { max-height: calc(100dvh - 32px); max-width: 100%; }
.modal-backdrop { overflow: hidden; }
.modal-body { overflow-x: hidden; }
.modal-body img, .modal-body svg, .modal-body canvas, .modal-body video, .modal-body table { max-width: 100%; }
.modal-body td, .modal-body th { overflow-wrap: anywhere; }
/* Phones: the window is the whole screen (the rule above would leave 32px of the page showing). */
@media (max-width: 640px) {
  .modal, .modal.modal-wide, .modal.modal-xl { max-height: 100dvh; }
}
/* Wide screens: use the width (a tablet in landscape is ~1100px). */
@media (min-width: 900px) {
  .modal { width: min(600px, 100%); }
  .modal.modal-wide { width: min(820px, 100%); }
  .modal.modal-xl { width: min(1100px, 100%); }
}
/* Short screen (landscape tablet with the keyboard up): the window takes the full height, from the top. */
@media (max-height: 520px) {
  .modal-backdrop { place-items: start center; padding: 6px 16px; }
  .modal { max-height: calc(100dvh - 12px); }
  .modal-head { padding: 8px 14px; }
  .modal-body { padding: 12px 14px; }
  .modal-actions { padding: 8px 14px; }
}

/* the device holding a point of sale (device-report.js) */
.reg-device { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; max-width: 100%; min-width: 0; overflow: hidden; box-sizing: border-box; }
.reg-device span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.reg-device .ic, .reg-device svg { flex: none; }
.device-report { display: grid; gap: 2px; }
.device-report .sum-row strong { font-weight: 500; text-align: end; overflow-wrap: anywhere; }
.dev-raw { margin-top: 12px; font-size: 12px; color: var(--muted); }
.dev-raw pre { white-space: pre-wrap; word-break: break-all; background: var(--soft, #f7f8fa); border-radius: 8px; padding: 8px; max-height: 40vh; overflow: auto; }

/* keyboard button in scan boxes (Wasla One app on tablets, kbd.js) */
.kbd-field { position: relative; display: block; min-width: 0; }
.search-wrap .search-ic { z-index: 1; }
.kbd-field > input { width: 100%; padding-inline-end: 46px; }
.kbd-field > .kbd-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap:has(.search-add) .kbd-field > .kbd-btn { inset-inline-end: 48px; }
.search-wrap:has(.search-add) .kbd-field > input { padding-inline-end: 92px; }

/* Adding products: by hand or the whole menu by AI (ai-menu.js). */
.first-product { gap: 16px; }
.first-product-ai { max-width: 100%; display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: 17px; text-align: center; }
.add-choices { display: grid; gap: 12px; }
.choice.add-choice { display: flex; align-items: center; gap: 14px; padding: 18px; text-align: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); width: 100%; }
.choice.add-choice:hover:not(:disabled) { border-color: var(--primary); }
.choice.add-choice:disabled { opacity: .55; cursor: not-allowed; }
.choice.add-choice.ai { border-color: var(--primary); background: var(--tint); }
.add-choice-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--card); color: var(--primary); flex-shrink: 0; }
.add-choice-text { display: grid; gap: 4px; }
.add-choice-text b { font-size: 16px; }
.add-choice-text small { color: var(--muted); line-height: 1.5; }
.ai-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.ai-file { position: relative; display: grid; justify-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.ai-file img, .ai-file-pdf { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.ai-file small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ai-file .btn { position: absolute; top: 4px; inset-inline-end: 4px; }
.choice.ai-file.add { min-height: 132px; place-content: center; border-style: dashed; color: var(--primary); }
.ai-reading .ai-files { opacity: .5; pointer-events: none; }
.ai-reading > p.muted:last-child::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-inline-end: 8px; vertical-align: -2px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-review .table input.ctl { min-width: 0; width: 100%; }
.ai-review .table td:first-child { width: 36px; }
.ai-review .table td.num { width: 120px; }
.ai-review tr.off { opacity: .45; }
.ai-review tr.no-price td.num input { border-color: var(--warn); background: var(--warn-bg); }
.table .name-alt { display: block; }
/* A table shown as tiles (table() in admin-kit.js): the same rows, so search, filters and pages stay as they are. */
.table-wrap.as-tiles { overflow: visible; background: none; border: 0; box-shadow: none; }
.as-tiles .table { display: block; background: none; }
.as-tiles .table thead, .as-tiles .table tfoot { display: none; }
.as-tiles .table tbody, .arrange-list.as-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.as-tiles .table tr { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.as-tiles .table tr.clickable:hover { border-color: var(--primary); }
.as-tiles .table tr.clickable:hover td { background: none; }
.as-tiles .table td { display: block; padding: 0; border: 0; text-align: start; overflow-wrap: anywhere; }
.as-tiles .table td:first-child { font-size: 15px; font-weight: 600; }
.as-tiles .table td:first-child .name-alt { font-size: 13px; font-weight: 400; }
.as-tiles .table td:not(:first-child) { margin-top: auto; font-size: 13px; color: var(--muted); }
.as-tiles .table td:not(:first-child)::before { content: attr(data-label) ': '; }
.view-switch { display: inline-flex; gap: 2px; align-self: center; }
.view-switch .btn.on { background: var(--tint-soft, #f7faff); border-color: var(--primary); color: var(--primary); }
.arrange-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; }
.arrange-list { display: grid; gap: 10px; }
.arrange-item { position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; cursor: grab; user-select: none; -webkit-user-select: none; overflow-wrap: anywhere; }
.arrange-list.as-tiles .arrange-item { min-height: 96px; }
.arrange-item .name-alt { display: block; font-size: 13px; font-weight: 400; }
.arrange-item.dragging { z-index: 20; pointer-events: none; cursor: grabbing; border-color: var(--primary); box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.arrange-grip { flex: none; width: 44px; height: 44px; cursor: grab; touch-action: none; }
.table .low-tag { display: block; font-weight: 600; }

/* ── Product page (/app/products/<id|new>): the product form, one card per section ── */
.sk-form { display: grid; gap: 16px; max-width: 980px; margin-inline: auto; }
.sk-card { height: 190px; border-radius: 16px; }
.sk-card.tall { height: 300px; }
.product-page { display: grid; gap: 16px; width: 100%; max-width: 980px; margin-inline: auto; }
.input-with-btn { display: flex; gap: 8px; align-items: stretch; }
.input-with-btn > :first-child { flex: 1; min-width: 0; }
.input-with-btn > .btn { flex: none; }
.pp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-head h3 { margin: 0; font-size: 18px; }
.pf-main { display: grid; gap: 14px; }
.pf-top { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; align-items: start; }
.cost-slot { display: contents; }
/* A product's price in each sales channel. */
.ch-grid { display: grid; gap: 6px; margin-top: 4px; overflow-x: auto; }
.ch-row { display: grid; grid-template-columns: minmax(90px, 1fr) repeat(var(--ch-cols), minmax(90px, 1fr)); gap: 8px; align-items: center; }
.ch-head strong { font-size: 13px; overflow-wrap: anywhere; }
.ch-label { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.ch-off { padding-top: 6px; border-top: 1px solid var(--line-soft, #eef1f5); }
.channel-row { padding-top: 0; border-bottom: 1px solid var(--line); }
.otype-row:not([hidden]) + .channel-row { padding-top: 8px; }
/* A product's kinds: above, what differs and its values to pick; below, a card for each kind. */
.vk-editor { display: grid; gap: 14px; margin-top: 4px; }
.vk-builder { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: #f6f8fb; }
.vk-axes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vk-axes > strong { margin-inline-end: 6px; }
.choice.vk-pill, .choice.vk-value { height: 34px; padding-inline: 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.choice.vk-value { border-radius: 9px; }
.choice.vk-pill:hover:not(:disabled), .choice.vk-value:hover { border-color: var(--primary); }
.choice.vk-pill:disabled { opacity: .45; cursor: not-allowed; }
.choice.vk-pill.on { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.choice.vk-value.on { border-color: var(--primary); background: var(--primary); color: #fff; }
input.vk-custom { width: 120px; height: 34px !important; min-height: 34px; border-radius: 999px; }
.vk-axis { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: start; }
.vk-axis-name { padding-top: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.vk-values { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
input.vk-add { flex: 0 1 130px; width: 130px; height: 34px !important; min-height: 34px; border-style: dashed; }
.btn.vk-go { justify-self: start; }
.vk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.vk-cards:empty { display: none; }
.vk-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.vk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vk-card-head .icon-btn { flex: none; width: 28px; height: 28px; border: none; background: var(--danger-bg, #fdf1f1); }
.vk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vk-fields .field { margin: 0; }
.vk-fields .field > span { font-size: 12.5px; color: var(--muted); }
.vk-stock { display: grid; place-items: center; height: 42px; border-radius: 10px; background: var(--soft, #f3f5f8); font-weight: 700; font-variant-numeric: tabular-nums; }
.vm-pack { display: grid; grid-template-columns: minmax(100px, 1fr) 64px minmax(84px, 110px) 88px minmax(100px, 1fr) 72px 34px; gap: 6px; align-items: center; }
.sub-row.vm-pack input:not(.grow, [type=checkbox]) { width: 100%; }
.vm-pack-head { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.vm-uses { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding-bottom: 8px; }
.vm-use { font-size: 13.5px; font-weight: 500; }
.vm-pieces { margin-inline-start: auto; }
.pack-opens:empty { display: none; }
.pack-opens { margin-top: 10px; }
.pack-open { font-size: 13px; gap: 12px; }
.sub-row.vm-pack .vm-use input { width: 18px; flex: none; }
.packs-field .sub-list { gap: 4px; }
tr.pack-line td { padding-block: 7px; background: var(--soft, #fafbfd); font-size: 13.5px; }
tr.pack-line td:nth-child(2) { padding-inline-start: 22px; color: var(--muted); }
tr.pack-line svg { vertical-align: -2px; }
.pack-uses { display: inline-flex; gap: 4px; margin-inline-start: 8px; }
.pack-tag.buy { background: var(--soft-2, #eef1f5); color: var(--muted); }
.loose-tag { display: block; font-weight: 400; }
.choice.pack-tag { border: none; cursor: pointer; }
.sizes-pop .pop-row { display: grid; grid-template-columns: minmax(90px, 1fr) auto 56px; gap: 14px; }
.sizes-pop .pop-row > strong { text-align: end; }
.sizes-price { color: var(--muted); direction: ltr; }
@media (max-width: 720px) {
  .vm-pack-head { display: none; }
  .sub-row.vm-pack { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 8px; border-bottom: 1px solid var(--line-soft, #eef1f5); }
  .vm-pack > .btn { grid-column: 2; justify-self: end; }
  .vm-pack-gap { display: none; }
}
.photo-box { position: relative; display: block; }
.btn.photo-tap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: auto; aspect-ratio: 1; padding: 6px; border: 1.5px dashed var(--line-strong, #c4ccd8); border-radius: 14px; background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.3; cursor: pointer; overflow: hidden; transition: border-color .15s, color .15s; }
.btn.photo-tap:hover { border-color: var(--primary); color: var(--primary); }
.btn.photo-tap:has(img) { padding: 0; border-style: solid; border-color: var(--line); }
.photo-tap img { width: 100%; height: 100%; object-fit: cover; }
.photo-box .photo-x { position: absolute; top: 6px; inset-inline-end: 6px; }
.type-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.btn.type-tile { display: grid; justify-items: center; justify-content: stretch; gap: 6px; height: auto; padding: 12px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text, inherit); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.use-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn.type-tile:hover { border-color: var(--primary); }
.btn.type-tile[aria-checked=true] { border-color: var(--primary); background: var(--tint); color: var(--primary); }
@media (max-width: 720px) {
  .pf-top { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
}

/* Payroll sheet: names and amounts on one line, the inputs no wider than an amount needs */
.payroll-sheet th, .payroll-sheet td { white-space: nowrap; }
.payroll-sheet td:nth-child(2) { min-width: 130px; }
.payroll-sheet input { width: 110px; min-width: 0; }
.payroll-sheet td:last-child { font-weight: 700; }

/* «تقارير:» — links from a page to the reports that go with it */
.report-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0 10px; }
.report-links .btn { color: var(--primary); }

/* ── A window shown as a page (add / edit): over the content, the sidebar stays ── */
.page-sheet { position: fixed; inset: 0; inset-inline-start: 248px; z-index: 40; background: var(--bg); display: flex; animation: wl-fade .12s ease-out; }
.page-sheet.no-anim { animation: none; }
.modal.sheet { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; box-shadow: none; background: transparent; animation: none; }
.modal.sheet .modal-head { justify-content: flex-start; gap: 10px; background: var(--card); padding: 10px 16px; min-height: 56px; }
.modal.sheet .modal-head h3 { font-size: 18px; }
.modal.sheet .modal-body { flex: 1; padding: 16px; }
.sheet-card { max-width: 1000px; margin-inline: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.modal.sheet .modal-actions { position: sticky; bottom: 0; background: var(--glass, #ffffffee); backdrop-filter: blur(6px); justify-content: flex-end; padding: 12px 16px; }
@media (max-width: 900px) {
  .page-sheet { inset-inline-start: 0; }
  .modal.sheet .modal-body { padding: 10px; }
  .sheet-card { padding: 12px; border-radius: 12px; }
  .modal.sheet .modal-actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ── Smart tables: sort by a heading, pages ── */
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--ink); }
.table th .sort-mark { display: inline-block; width: 0; height: 0; margin-inline-start: 6px; vertical-align: middle; border-inline: 4px solid transparent; opacity: .25; border-top: 5px solid currentColor; }
.table th.sorted { color: var(--primary); }
.table th.sorted .sort-mark { opacity: 1; }
.table th.sorted[aria-sort='ascending'] .sort-mark { border-top: none; border-bottom: 5px solid currentColor; }
.pager { display: flex; align-items: center; gap: 6px; padding: 8px 4px 2px; }
.pager:empty { display: none; }
.pager-no { font-variant-numeric: tabular-nums; min-width: 54px; text-align: center; font-weight: 600; }
.pager-size { width: auto; padding: 4px 8px; font-size: 13px; }
/* ── Smart toolbars: one line of buttons, the rest under «⋯» ── */
.fit-hidden { display: none !important; }
.fit-more-wrap { position: relative; display: inline-flex; flex: none; }
.fit-more-wrap[hidden] { display: none; }

/* ── A page's header card: the period, the actions at the end, «تقارير:» under them ── */
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.sub-body, .page-head { min-width: 0; max-width: 100%; }
.sub-body > * { min-width: 0; }
.page-head > * { min-width: 0; max-width: 100%; }
.page-head > .toolbar { flex: 1 1 auto; margin: 0; }
.page-head > .toolbar.head-actions { flex: 0 1 auto; margin-inline-start: auto; order: 2; }
.page-head > .toolbar.date-filter { order: 1; flex: 0 1 auto; }
.page-head > .report-links { order: 3; flex-basis: 100%; margin: 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.page-head > p.muted { order: 3; flex-basis: 100%; margin: 0; }
@media (max-width: 900px) {
  .page-head { padding: 10px; gap: 8px; margin-bottom: 10px; border-radius: 12px; }
  .page-head > .toolbar.head-actions { flex: 1 1 100%; order: 0; }
  .page-head > .toolbar.date-filter { flex: 1 1 100%; }
  /* KPIs: three to a row, smaller */
  .kpis { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .kpi { padding: 10px; }
  .kpi strong { font-size: 17px; }
}

/* ── Filter bar: a search box (Enter), «Filters» with a count, the period ── */
.toolbar.filter-bar { align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 360px; min-width: 0; }
.fb-search > svg { position: absolute; inset-inline-start: 11px; color: var(--muted); pointer-events: none; }
.fb-search input { padding-inline-start: 36px; }
.filter-bar .btn.small, .page-head .btn.small { height: 38px; }
.btn.fb-filter.active { border-color: var(--primary); color: var(--primary); background: var(--tint); }
.fb-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
/* The ✕ beside «التصفية»: every filter off in one press, without opening the panel. */
.fb-clear { width: 32px; height: 32px; border-radius: 10px; color: var(--muted); flex: none; }
.fb-clear:hover { color: var(--danger); }
.btn.fb-period { color: var(--ink); font-variant-numeric: tabular-nums; }
.btn.fb-period svg { color: var(--primary); }
.btn.rl-btn { color: var(--primary); }
/* the side panel (slides in from the end side) */
.fp-backdrop { position: fixed; inset: 0; z-index: 55; background: #0b1b3355; display: flex; justify-content: flex-end; animation: wl-fade .15s ease-out; }
.fp-panel { width: min(400px, 100vw); height: 100%; background: var(--card); display: flex; flex-direction: column; box-shadow: 0 0 40px #0003; animation: fp-in .22s var(--ease, ease); }
@keyframes fp-in { from { opacity: .4; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
[dir='ltr'] .fp-panel { animation-name: fp-in-ltr; }
@keyframes fp-in-ltr { from { opacity: .4; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.fp-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.fp-top h3 { margin: 0; font-size: 17px; }
.fp-top > svg { color: var(--primary); }
.fp-body { flex: 1; overflow-y: auto; padding: 4px 10px; }
.fp-sec { border-bottom: 1px solid var(--line); }
.fp-sec:last-child { border-bottom: none; }
.btn.fp-head { width: 100%; justify-content: flex-start; gap: 8px; padding: 14px 6px; border: none; border-radius: 10px; font-weight: 700; background: transparent; }
.fp-sum { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-size: 13px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-chev { flex: none; color: var(--muted); transition: transform .2s; }
.fp-sec.open .fp-chev { transform: rotate(180deg); }
.fp-body-in { display: none; padding: 2px 6px 14px; }
.fp-sec.open .fp-body-in { display: grid; gap: 10px; }
.fp-body-in > .field > span:first-child { display: none; }
.fp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-foot { display: flex; gap: 8px; padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.fp-foot .btn.primary { flex: 1; }
@media (max-width: 900px) { .fp-panel { width: 100vw; } }
.report-links { margin: 0 0 10px; }
.page-head .report-links, .filter-bar + .report-links { margin: 0; }
/* every page's search box: the same look as the filter bar's (a magnifier at the start) */
.page-body .toolbar > input[type='search'] { padding-inline-start: 36px; height: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
[dir='ltr'] .page-body .toolbar > input[type='search'] { background-position: left 11px center; }

/* ══ One look for every page ══════════════════════════════════════════════════════════════════════
   The page's controls sit straight on the page (no card); every button and field on a page's bars —
   the top bar, the filter bar, the page's actions, the pager, a page window's head and actions — is
   42px high with 10px corners; icon-only ones are 42px squares. */
.page-head { background: transparent; border: 0; border-radius: 0; padding: 0; margin-bottom: 14px; }
.page-body .toolbar .btn, .page-body .filter-bar .btn, .page-body .report-links .btn, .page-body .fit-actions .btn,
.pagebar .btn, .pager .btn, .modal.sheet .modal-head .btn, .modal.sheet .modal-actions .btn, .page-body .save-bar .btn, .fp-foot .btn {
  height: 42px; min-height: 42px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; box-sizing: border-box;
}
.page-body .toolbar .btn.icon-only, .page-body .filter-bar .btn.icon-only, .pager .btn.icon-only, .pagebar .btn.icon-only, .fit-more,
.modal.sheet .modal-head .btn.icon-only { width: 42px; min-width: 42px; padding: 0; }
.page-body .toolbar input, .page-body .toolbar select, .page-body .filter-bar input, .pager select { height: 42px; min-height: 42px; border-radius: 10px; box-sizing: border-box; }
/* a page window's head: where and how the top bar is */
.modal.sheet .modal-head { min-height: 56px; padding: 8px 16px; }
.modal.sheet .modal-head h3 { font-size: 19px; }
@media (max-width: 900px) {
  .page-head { padding: 0; margin-bottom: 10px; }
  .modal.sheet .modal-head h3 { font-size: 17px; }
}

/* A filter of several choices: check boxes, one per line (two columns when wide enough). */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
.check-list .check { padding: 0 6px; border-radius: 8px; font-weight: 500; }
.check-list .check:hover { background: var(--soft, #f5f7fa); }
.check-list .check:has(input:checked) { color: var(--primary); font-weight: 700; }



/* ══ Add / edit pages look like the product page ══════════════════════════════════════════════════
   The sections are cards (980px wide at most, in the middle); the actions float at the bottom in a
   bar of the same width — «cancel» quiet, the main action last. */
.sheet-page { display: grid; gap: 16px; max-width: 980px; margin-inline: auto; }
.sheet-page > .set-card > .set-body { gap: 10px; }
.modal.sheet .modal-body { padding: 16px 16px 8px; }
.modal.sheet .modal-actions {
  position: sticky; bottom: 12px; z-index: 5; width: min(980px, calc(100% - 32px)); box-sizing: border-box; margin: 0 auto 12px;
  display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px;
  background: var(--glass, #ffffffee); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 18px #0000000a;
}
.modal.sheet .modal-actions .btn.danger { margin-inline-end: auto; }
@media (max-width: 900px) {
  .modal.sheet .modal-body { padding: 10px 10px 6px; }
  .sheet-page { gap: 12px; }
  .modal.sheet .modal-actions { width: calc(100% - 20px); bottom: 8px; margin-bottom: max(8px, env(safe-area-inset-bottom)); padding: 10px 12px; }
}
/* (the page scrolls as one, the bar right under the last card — sticking to the bottom while there's more) */
.modal.sheet { overflow-y: auto; display: block; }
.modal.sheet .modal-head { position: sticky; top: 0; z-index: 6; }
.modal.sheet .modal-body { overflow: visible; }
@media (max-width: 900px) {
  /* a page's product search: the box on its own line, its buttons under it */
  .pl-search { flex-wrap: wrap; }
  .pl-search > .grow { flex: 1 1 100%; }
}

/* Packs (a carton of 12): tags under their product's name (the first, «+2» for the rest), a quantity
   that opens how many cartons it makes, and a quantity control in parts — carton | piece | total. */
.pack-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pack-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--primary); font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.pack-tag.more { background: var(--soft-2, #eef1f5); color: var(--muted); cursor: help; }
.qty-pop { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px dashed #b9c6d8; border-radius: 8px; background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.qty-pop:hover { border-color: var(--primary); background: var(--tint); }
.qty-pop svg { color: var(--primary); }
.pop-card { position: fixed; z-index: 70; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px #0b1b3326; animation: wl-fade .12s ease-out; }
.pop-title { display: block; margin-bottom: 8px; font-size: 14px; }
.pack-pop { display: grid; gap: 6px; }
.pop-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; }
.pop-row span { color: var(--muted); }
.pop-row.pop-total { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.pop-row.pop-total strong { color: var(--primary); font-size: 15px; }
.pack-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; vertical-align: middle; }
.pack-qty:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring-soft, #0075ff1f); }
.pq-seg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 8px; min-width: 66px; cursor: text; }
.pq-seg + .pq-seg { border-inline-start: 1px solid var(--line); }
.pq-lbl { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pq-lbl small { font-weight: 500; }
.pack-qty .pq-seg input { width: 58px; min-width: 0; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; text-align: center; font-size: 15px; font-weight: 700; box-shadow: none; }
.pack-qty .pq-seg input:focus { outline: none; background: var(--tint); }
.pq-sum { background: var(--tint); cursor: default; }
.pq-value { font-size: 16px; color: var(--primary); line-height: 28px; }
.pack-qty.disabled { background: var(--soft, #f7f8fa); }
/* a document's lines on a phone: one card per product — its name, then its quantity across the width */
@media (max-width: 700px) {
  .doc-search > :first-child { flex: 1 1 100% !important; }
  .table.doc-lines thead { display: none; }
  .table.doc-lines, .table.doc-lines tbody { display: block; }
  .table.doc-lines tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .table.doc-lines td { display: block; padding: 0; border: 0; text-align: start; }
  .table.doc-lines td:first-child { font-weight: 700; }
  .table.doc-lines td.num { grid-column: 1 / -1; }
  .table.doc-lines td:last-child:not(.num) { grid-row: 1; grid-column: 2; }
  .table.doc-lines .pack-qty { display: flex; width: 100%; }
  .table.doc-lines .pq-seg { flex: 1; min-width: 0; }
  .table.doc-lines td.num > input { width: 100%; }
}
@media (max-width: 700px) {
  .table.doc-lines td.sys-qty { color: var(--muted); font-size: 13px; }
  .table.doc-lines td.sys-qty::before { content: attr(data-label) ': '; }
}
/* a purchase return: one card per item — its name and what is left, the quantity across under it */
.ret-line { display: grid; gap: 8px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; }
.ret-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ret-line > .pack-qty { display: flex; width: 100%; max-width: 460px; }
.ret-line > .pack-qty .pq-seg { flex: 1; min-width: 0; }
.ret-line > input { max-width: 200px; }

/* A page of settings (Taxes → settings): as narrow as the product page, in the middle; its tabs row
   carries the reports at the end. */
.page-body.narrow-page > * { width: 100%; max-width: 980px; margin-inline: auto; box-sizing: border-box; }
.page-body.narrow-page > * + .set-card, .page-body.narrow-page > div + .set-card { margin-top: 16px; }
.tax-reports { margin-bottom: 12px; }
.subtabs > .spacer { flex: 1; }
.subtabs > .report-links { margin: 0; margin-inline-start: auto; flex: none; }

/* Taxes → fees: one row each — name and what it is, on / off, edit */
.fee-row { display: flex; align-items: center; gap: 12px; }
.fee-row .grow { display: grid; gap: 2px; }
.fee-switch { display: inline-flex; align-items: center; cursor: pointer; }
.fee-list > div:last-child:not(.fee-row) { padding-top: 6px; }
/* the till: a tax included in the prices («منها ضريبة التبغ») — information, not a line to pay */
.line.fee-line.included { color: var(--muted); font-size: 13px; }
.line.fee-line.included .line-total { font-weight: 500; }
/* the till: under an item that carries a tax (tobacco…) — «شامل ضريبة التبغ» */
.line-tax { display: block; color: var(--muted); font-size: 11.5px; }
/* Branches → Brands: each brand with its logo */
.brand-logo { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--tint); color: var(--primary); overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--card); }
/* the till's top bar: the brand, and under it the point of sale · branch */
.pos-title .pt-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pos-title .pt-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-title .pt-text small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-title .pt-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; background: var(--card); flex: none; }
@media (max-width: 700px) {
  /* (a phone: the brand and its point of sale stay; the line under it is shorter) */
  .pos-title .pt-text small { display: block; font-size: 11px; max-width: 46vw; }
  .pos-title .pt-text strong { max-width: 46vw; }
}
/* the till's top bar, second line: «نقطة البيع 1 · 👤 الكاشير» */
.pos-title .pt-sub { display: inline-flex; align-items: center; gap: 6px; }
.pos-title .pt-sub > span + span::before { content: '·'; margin-inline-end: 6px; }
.pos-title .pt-user { display: inline-flex; align-items: center; gap: 3px; }
.pos-title .pt-user svg { width: 1em; height: 1em; flex: none; }
@media (max-width: 700px) { .pos-title .pt-sub { display: inline-flex; } }

/* Invoices read from a photo (scan.js): the reading card, flagged fields, the waiting list, lines with no product */
.scan-card { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .scan-card { grid-template-columns: 1fr; } }
.scan-files { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-thumb { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--card); cursor: zoom-in; overflow: hidden; max-width: 220px; }
.scan-thumb img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.scan-checks { display: flex; flex-direction: column; gap: 6px; }
.scan-checks > .btn { align-self: flex-start; margin-top: 4px; }
.scan-total { display: flex; justify-content: space-between; gap: 12px; font-size: 1.05em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.scan-warn-row, .scan-ok-row { display: flex; gap: 8px; align-items: flex-start; margin: 0; line-height: 1.5; }
.scan-warn-row svg { color: #b58100; flex: none; margin-top: 3px; }
.scan-ok-row svg { color: var(--ok-ink, #198754); flex: none; margin-top: 3px; }
.field.scan-warn input, .field.scan-warn select { border-color: var(--warn); background: var(--warn-bg); }
.field.scan-qr input, .field.scan-qr select { border-color: #198754; }
.scan-zoom img { display: block; max-width: 100%; margin: 0 auto; }
.scan-inbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--warn-bg); border: 1px solid var(--warn-line, #ffe08a); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.scan-inbox > strong { display: inline-flex; align-items: center; gap: 4px; }
.scan-pending { display: flex; flex-direction: column; gap: 10px; }
.scan-pending-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.scan-pending-row.off { opacity: .55; }
@media (max-width: 700px) { .scan-pending-row { grid-template-columns: 1fr; } }
.scan-pending-text { display: flex; flex-direction: column; gap: 2px; }
.scan-pending-pick { display: flex; flex-direction: column; gap: 8px; }
.row-gap.wrap { flex-wrap: wrap; }
.pl-scan .pl-src { flex-basis: 100%; }
.pl-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-weight: normal; }

/* A saved document shown like its add page: the same cards, values instead of fields (admin-kit info()) */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.info-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .info-grid, .info-grid.cols-2, .info-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.info-item { min-width: 0; }
.info-item.wide { grid-column: 1 / -1; }
.info-item dt { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.info-item dd { margin: 0; font-weight: 600; overflow-wrap: break-word; }
.info-item.money dd { direction: ltr; unicode-bidi: isolate; text-align: end; font-size: 1.15em; }
.set-body .sums { border-top: none; padding: 10px 0 0; width: 100%; max-width: 380px; margin-inline-start: auto; }
.set-body .sum-row { gap: 16px; }
.set-body > .table-wrap + .sums { border-top: 1px solid var(--line); }
/* Tables inside a document page: numbers stay on one line and the table scrolls sideways on a phone */
.sheet-page .set-body .table th, .sheet-page .set-body .table td { white-space: nowrap; }
.sheet-page .set-body .table td:first-child { white-space: normal; min-width: 150px; }
.set-body > .attach .section-head strong { display: none; }
.set-body > .attach .section-head { justify-content: flex-end; }

/* A document page with its file beside it (admin-kit withFiles): cards on one side, the invoice on the other */
.doc-split { display: grid; gap: 16px; }
.doc-main { display: grid; gap: 16px; min-width: 0; align-content: start; }
.doc-split.has-files { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.sheet-page:has(> .doc-split.has-files) { max-width: 1600px; }
.doc-files { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.doc-files-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-files-bar:empty { display: none; }
.doc-viewer { position: relative; flex: none; height: calc(100dvh - 260px); min-height: 420px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
/* (loading: what is shown stays, under a light veil and a small spinner) */
.doc-viewer.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.55) no-repeat center / 28px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%230075ff' stroke-width='3' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E"); }
.doc-empty { height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.doc-viewer img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.doc-viewer img.zoomed { width: 220%; height: auto; max-width: none; cursor: zoom-out; }
.doc-viewer iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 1100px) {
  .doc-split.has-files { grid-template-columns: 1fr; }
  .doc-files { position: static; max-height: none; }
  .doc-viewer { height: 60dvh; min-height: 0; }
}
/* An expense line on two rows: what and its category; then the amount, the VAT rate and the VAT */
.pl-line.ex-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.pl-line.ex-line > .field:nth-child(1) { grid-column: 1 / 3; }
.pl-line.ex-line > .field:nth-child(2) { grid-column: 3 / -1; }
@media (max-width: 700px) { .pl-line.ex-line > .field:nth-child(1), .pl-line.ex-line > .field:nth-child(2) { grid-column: 1 / -1; } }
.scan-notes { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.scan-notes > .btn { align-self: flex-start; }
.scan-notes .scan-total span { display: inline-flex; align-items: center; gap: 4px; }
/* The short expense form: each line = name and amount, then category and VAT; «more options» folds */
.ex-lines { display: grid; gap: 10px; }
.ex-line { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.ex-lines .ex-line + .ex-line { padding-top: 10px; border-top: 1px dashed var(--line); }
.ex-line > .field:nth-child(3) { grid-column: 1; }
.ex-line.with-vat > .field:nth-child(4) { grid-column: 2; }
.ex-line > .ex-remove { grid-column: 3; grid-row: 1; align-self: end; margin-bottom: 4px; }
.ex-line .ex-amount { font-size: 1.15em; font-weight: 700; }
.ex-vat-note:empty { display: none; }
@media (max-width: 700px) { .ex-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } }
details.more-card > summary { list-style: none; cursor: pointer; }
details.more-card > summary::-webkit-details-marker { display: none; }
details.more-card:not([open]) > summary { border-bottom: none; }
.set-body > .btn { align-self: flex-start; justify-self: start; }
.ex-foot { align-items: end; } .ex-foot > .row-gap { padding-bottom: 6px; }
/* A part of a form on its own row (admin-kit formSection) */
.form-section { display: grid; gap: 10px; padding-top: 14px; margin-top: 4px; border-top: 1px dashed var(--line); }
.form-section[hidden] { display: none; }
.form-section-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.form-section > .btn { justify-self: start; }

/* The empty half of a page that takes a file: drop it here or pick it */
.choice.doc-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--soft, #fbfcfe); color: var(--primary); text-align: center; padding: 24px; }
.choice.doc-drop:hover, .doc-files.drag .choice.doc-drop { border-color: var(--primary); background: var(--tint); }
.doc-files.drag .doc-viewer { outline: 2px dashed var(--primary); outline-offset: -2px; }
.doc-viewer:has(> .doc-drop) { border: none; background: transparent; overflow: visible; }

.doc-files-list:empty { display: none; }
.doc-files-list tr.on td { background: var(--tint); font-weight: 600; }
.doc-files-list tr.clickable { cursor: pointer; }
.doc-files-bar { justify-content: flex-start; }
/* A page's buttons in its top bar, at the far end (dom.js modal page); on a phone, a bar at the bottom */
.modal.sheet .modal-head h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.sheet .modal-head .modal-actions.head-actions { position: static; width: auto; margin: 0; padding: 0; border: none; border-radius: 0; box-shadow: none; background: none; backdrop-filter: none; display: flex; gap: 8px; flex: none; }
.modal.sheet .modal-head .head-actions .btn.danger { margin-inline-end: 0; }
@media (max-width: 700px) {
  .modal.sheet .modal-head .modal-actions.head-actions {
    position: fixed; inset-inline: 10px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 20; justify-content: flex-end; padding: 10px 12px;
    background: var(--glass, #ffffffee); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 18px #0000000a;
  }
  .modal.sheet .modal-head .head-actions .btn { flex: 1; }
  .modal.sheet .modal-body { padding-bottom: 96px; }
}
.pl-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.pl-facts span { direction: ltr; unicode-bidi: isolate; }
.ex-pay-state { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-head .btn { flex: none; }
.pay-head .ex-pay-state { margin: 0; justify-content: flex-end; }
/* One choice among a few inside a form: chips of the standard 42px, never stretched by the row */
.set-body .segmented { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; align-self: start; }
.set-body .segmented .chip { height: 42px; padding: 0 18px; display: inline-flex; align-items: center; }
.set-body .form-grid > .group { align-self: start; }
.acct-code-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.acct-code-row .acct-code { font-size: 1.2em; }
/* A posted document in its own form, locked: the values read as text, not as greyed boxes */
.read-only .doc-main input:disabled, .read-only .doc-main select:disabled { background: var(--soft, #fafbfc); color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.read-only .doc-main .segmented .chip:disabled { opacity: 1; }
.read-only .doc-main .segmented .chip:disabled:not(.on) { display: none; }
.ex-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* «اشرح لي» (voice-help.js): the lit part, the subtitle that follows the voice — over the page, which never moves */
.vh-layer { position: fixed; inset: 0; z-index: 200; pointer-events: auto; touch-action: none; }
.vh-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45); outline: 3px solid var(--primary); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.vh-bubble { position: fixed; pointer-events: auto; width: min(420px, calc(100vw - 20px)); background: var(--card); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 12px 14px; display: grid; gap: 8px; transition: top .25s ease, left .25s ease; }
.vh-bubble.vh-center { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); }
.vh-layer:has(.vh-spot[hidden]) { background: rgba(15, 23, 42, .45); }
.vh-head { display: flex; align-items: center; gap: 6px; color: var(--primary); }
.vh-text { margin: 0; font-size: 17px; line-height: 1.8; }
.vh-text .vh-w { color: var(--muted); transition: color .12s; }
.vh-text .vh-w.said { color: var(--ink); }
.vh-foot { display: flex; justify-content: space-between; gap: 8px; }
.vh-say.btn.icon-only { width: 26px; min-width: 26px; height: 26px; padding: 0; margin-inline-start: 6px; color: var(--primary); vertical-align: middle; }
.field > span:has(.vh-say) { display: inline-flex; align-items: center; }
/* Arrows face the reading direction (M's rule): icons are drawn left-to-right, so the directional ones
   turn round in Arabic; the chevrons (written for Arabic: next ‹, back ›) turn round in English. */
[dir='rtl'] .ic-undo-2, [dir='rtl'] .ic-external-link, [dir='rtl'] .ic-log-out, [dir='rtl'] .ic-send,
[dir='rtl'] .ic-arrow-up-right, [dir='rtl'] .ic-arrow-down-left, [dir='rtl'] .ic-split, [dir='rtl'] .ic-share-2,
[dir='rtl'] .ic-truck, [dir='rtl'] .ic-car, [dir='rtl'] .ic-bike { transform: scaleX(-1); }
[dir='ltr'] .ic-chevron-left, [dir='ltr'] .ic-chevron-right { transform: scaleX(-1); }

/* «الشروحات»: the questions as cards, a few per group */
.help-cards { display: grid; gap: 22px; max-width: 1100px; }
.help-group-title { margin: 0 0 10px; font-size: 16px; color: var(--muted); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.help-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.help-card-head { display: flex; align-items: center; gap: 10px; }
.help-card-head h4 { margin: 0; font-size: 15.5px; }
.help-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tint); color: var(--primary); flex: none; }
.help-card > p { margin: 0; color: var(--muted); line-height: 1.7; flex: 1; }
.help-card-foot { display: flex; gap: 8px; flex-wrap: wrap; }
/* the explanation's clock: big and clear */
.vh-clock-wrap { display: inline-flex; align-items: center; gap: 4px; background: var(--tint); color: var(--primary); border-radius: 999px; padding: 3px 10px; }
.vh-clock { font-size: 15px; font-variant-numeric: tabular-nums; direction: ltr; }
/* «ترتيب حسب» in the filter panel; an empty list keeps its table (the header on top, the message inside) */
.fp-sort { display: grid; grid-template-columns: 1fr minmax(110px, auto); gap: 8px; }
.table-wrap.is-empty .empty-row td { padding: 8px 0; border: 0; }
.table-wrap.is-empty .empty-row:hover td { background: transparent; }
/* the till's clock, in its left corner (the store's time zone, the server's clock) */
.pos-clock { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); padding-inline: 4px; }
.pos-clock .pc-time { direction: ltr; unicode-bidi: isolate; }
/* «اشرح لي» always in the corner: the dashboard's top bar, and an add / edit page's top bar after its
   actions (set apart by a line) — never among the page's own buttons */
.pagebar-corner { display: flex; align-items: center; flex: none; }
.pagebar-corner:empty { display: none; }
.modal.sheet .modal-head .head-corner { display: flex; align-items: center; flex: none; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
@media (max-width: 700px) {
  .modal.sheet .modal-head .head-corner { padding-inline-start: 0; border: 0; }
}
/* an empty list on a narrow screen: its message stays in sight while the table's columns scroll sideways */
.table-wrap.is-empty .empty-row td > *, .auto-empty td > * { position: sticky; inset-inline-start: 0; width: min(100%, calc(100vw - 48px)); }
/* a page's own filter (a user, a branch…) in the shared filter row: its own width, not the row's */
.toolbar.filter-bar > select.ctl, .toolbar.filter-bar > .field { width: auto; flex: 0 1 220px; min-width: 110px; }
/* a toast with one button («تراجع» after a delete) */
.toast.toast-act { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast .toast-btn { background: #ffffff22; color: #fff; border: 1px solid #ffffff55; min-height: 32px; }
.toast .toast-btn:hover { background: #ffffff33; }

/* ── The Wasla look (as in the main Wasla dashboard): a white sidebar with the وصلة wordmark in its
   corner and an icon on every line, a light grey page, white cards drawn by a hairline (no shadow) — each card's icon
   and name on one line over a large number and a short note. Blue stays the colour of links, the page
   you are on and the main buttons. ── */
:root { --line: #e5e7eb; --side: #fff; --page: #f4f5f7; --hover: #0000000a; --ink-2: #3f3f46; }
.sidebar { background: var(--side); }
.sidebar svg { stroke-width: 1.8; }
.sb-brand { height: 56px; padding: 0 18px; border-bottom: 0; }
.sb-brand .sb-logo { display: block; height: 28px; width: auto; max-width: 100%; }
.sb-nav { padding: 6px 10px 10px; gap: 2px; }
.sb-group.sb-top { gap: 2px; margin-bottom: 6px; }
.sb-group.sb-top .sb-pos-wrap { margin-bottom: 6px; }
/* lines: no box of their own; a light shade on hover; the page you are on = a light blue line, in blue */
.sb-item, .sb-head { background: transparent; border-radius: 10px; padding: 9px 10px; gap: 10px; font-size: 15px; font-weight: 500; color: var(--ink); }
.sb-item:hover, .sb-head:hover { background: var(--hover); color: var(--ink); }
.sb-item .ic, .sb-head .ic { color: var(--ink-2); }
.sb-item.on, .sb-item.on:hover { background: var(--tint); color: var(--primary); font-weight: 600; box-shadow: none; }
.sb-item.on .ic { color: var(--primary); }
/* a section: its icon, its name, and the arrow at the line's end — pointing on (‹ in Arabic), down when open */
.sb-head { justify-content: flex-start; }
.sb-head .sb-chev { margin-inline-start: auto; color: var(--muted); transform: rotate(90deg); }
[dir='ltr'] .sb-head .sb-chev { transform: rotate(-90deg); }
.sb-acc.open .sb-head .sb-chev { transform: none; }
.sb-acc.open .sb-head { font-weight: 600; }
/* a section's pages hang from a thin line under its icon */
.sb-items > div { margin-inline-start: 19px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.sb-acc.open .sb-items > div { padding-top: 2px; padding-bottom: 4px; }
.sb-items .sb-item { font-size: 14.5px; padding: 7px 10px; }
/* the user: a round letter, the name and the store under it */
.sb-foot { border-top: 1px solid var(--line); padding: 10px; gap: 8px; }
.sb-user { gap: 10px; padding: 2px; }
.sb-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft, #f4f4f5); border: 1px solid var(--line); font-weight: 700; font-size: 15px; color: var(--ink); }
.sb-me > div { display: grid; min-width: 0; line-height: 1.35; }
.sb-user strong, .sb-store { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user strong { font-size: 14px; }
.sb-store { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sb-actions .btn.ghost { font-weight: 500; color: var(--ink-2); }
.sb-actions .btn.ghost:hover { background: var(--hover); }
/* the top bar white like the sidebar; the page (and an add / edit page over it) light grey under white cards */
.pagebar h2 { font-size: 18px; font-weight: 600; }
.layout .page, .layout .admin-body, .page-sheet { background: var(--page); }
/* cards: a hairline, no shadow */
.kpi, .meter, .plan-card, .table-wrap, .settings-form, .card-box, .set-card { box-shadow: none; border-color: var(--line); }
.card-box { padding: 18px 20px; border-radius: 14px; }
.card-box h4 { gap: 8px; font-size: 15.5px; font-weight: 600; }
.card-box h4 .ic { color: var(--ink-2); }
/* summary cards: the name (with its icon) over a large number and its note; the main one's number in blue */
.kpi { padding: 16px 18px; gap: 6px; border-radius: 14px; background: var(--card); align-content: start; }
.kpi > small, .kpi-head small { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.kpi strong { font-size: 22px; font-weight: 700; line-height: 1.2; }
.kpi.main, .home-kpis .kpi.main { background: var(--card); border-color: var(--line); color: var(--ink); }
.kpi.main small, .home-kpis .kpi.main small { color: var(--ink-2); }
.kpi.main strong { color: var(--primary); }
.kpi-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .kpi-ic, .home-kpis .kpi.main .kpi-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft, #f4f4f5); color: var(--ink-2); }
.kpi.main .kpi-ic, .home-kpis .kpi.main .kpi-ic { background: var(--tint); color: var(--primary); }
.kpi-note { font-size: 13px; color: var(--muted); }
/* home: six cards of one size (three on a line, two when narrow; the skeleton has the same boxes) */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(200px, 30%), 1fr)) !important; gap: 14px; }
.home-card { height: 156px; min-width: 0; width: 100%; }
.home-kpis .kpi { padding: 18px 20px; gap: 0; display: flex; flex-direction: column; font: inherit; color: var(--ink); text-align: start; }
.home-kpis .kpi small { font-size: 15px; font-weight: 600; }
.home-kpis .kpi strong { font-size: 32px; font-weight: 700; align-self: flex-start; margin-top: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-kpis .kpi-note { margin-top: 4px; }
.kpi.is-link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s var(--ease); }
.kpi.is-link:hover { border-color: var(--primary); box-shadow: 0 8px 22px #0b1f3a14; transform: translateY(-2px); }
.kpi.is-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kpi-go { flex: none; margin-inline-start: auto; color: var(--primary); }
/* «!» and what it says (ui.js hintTip) */
.hint-btn { flex: none; display: inline-flex; padding: 2px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: help; }
.hint-btn:hover, .hint-btn:focus-visible { color: var(--primary); outline: none; }
.hint-tip { position: fixed; z-index: 10000; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: #1f2733; color: #fff; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 22px #0b1f3a33; pointer-events: none; }
@media print { .hint-btn { display: none; } }
.home-kpis .kpi.home-card .kpi-ic { width: 40px; height: 40px; border-radius: 12px; }
.home-kpis .kpi.tone-blue .kpi-ic { background: var(--tint); color: var(--primary); }
.home-kpis .kpi.tone-green .kpi-ic { background: #e8f6ee; color: var(--ok-ink, #198754); }
.home-kpis .kpi.tone-teal .kpi-ic { background: #e4f6f3; color: #0f8a78; }
.home-kpis .kpi.tone-indigo .kpi-ic { background: #eef0fe; color: #4f5bd5; }
.home-kpis .kpi.tone-amber .kpi-ic { background: #fdf3e1; color: #b7791f; }
.home-kpis .kpi.tone-rose .kpi-ic { background: #fdeeec; color: #c8452f; }
.home .card-box { padding: 20px; gap: 12px; }
.home-box-head { display: flex; align-items: center; gap: 10px; }
.home-box-head h4 { margin: 0; }
.home-box-head .hint-btn { margin-inline-start: -4px; }
.home-more { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; text-decoration: none; font-size: 14px; white-space: nowrap; }
.home-bars { height: 190px; padding: 0; border: 0; box-shadow: none; }
.home-bars .bar-fill { background: #d5e5fb; }
.home-bars .bar-col.today .bar-fill { background: var(--primary); }
.home-list { min-height: 230px; display: grid; align-content: start; gap: 4px; }
.home-none { align-self: center; justify-self: center; margin: 0; display: flex; align-items: center; gap: 6px; height: 222px; }
.home-num { flex: none; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.home-top { display: grid; gap: 6px; padding: 7px 0; }
.home-top-line { display: flex; align-items: baseline; gap: 10px; }
.home-top-line .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-top-bar { height: 6px; border-radius: 3px; background: #f0f2f5; overflow: hidden; }
.home-top-bar span { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.home.home-busy { opacity: .55; transition: opacity .15s; pointer-events: none; }
.home-sk-chart { height: 262px; border-radius: 14px; }
.home-sk-list { height: 312px; border-radius: 14px; }
@media (max-width: 640px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .home-filter { flex-wrap: nowrap; }
  .home-filter .chips { width: auto; flex: 1; min-width: 0; }
  .home-filter .spacer { display: none; }
  .home-filter .home-branch { flex: none; min-width: 0; max-width: 110px; }
  .btn.home-reports { flex: none; }
  .btn.home-reports span { display: none; }
  .home-card { height: 132px; }
  .home-kpis .kpi { padding: 14px 12px; }
  .home-kpis .kpi-head { gap: 4px; }
  .home-kpis .kpi small { font-size: 13px; }
  .home-kpis .kpi-go { width: 16px; height: 16px; }
  .home-kpis .kpi strong { font-size: 21px; }
  .home-kpis .kpi.home-card .kpi-ic { width: 28px; height: 28px; border-radius: 9px; }
  .kpi .kpi-ic { width: 30px; height: 30px; }
}
/* «نقطة البيع»: a line like the others (no fill, no frame); its ⚙ and «مفتوحة» stay small at the end */
.sb-pos-wrap, .sb-pos-wrap:hover { background: transparent; box-shadow: none; padding: 0; border-radius: 10px; }
.sb-pos-wrap:hover { background: var(--hover); }
.sb-pos-wrap.on { background: var(--tint); }
.sb-pos-wrap .sb-item.sb-pos, .sb-pos-wrap .sb-item.sb-pos:hover { background: transparent; color: var(--ink); font-weight: 500; }
.sb-pos-wrap.on .sb-item.sb-pos { color: var(--primary); font-weight: 600; }
.sb-pos-wrap .sb-item.sb-pos .ic { color: var(--ink-2); }
.sb-pos-wrap.on .sb-item.sb-pos .ic { color: var(--primary); }
.sb-group.sb-top .sb-pos-wrap { margin-bottom: 0; }
.sb-pos-state { background: var(--tint); color: var(--primary); }
.sb-pos-wrap.on .sb-pos-state { background: var(--card); }
.sb-pos-manage, .sb-pos-wrap .sb-pos-manage { background: transparent; color: var(--muted); margin-inline-end: 4px; }
.sb-pos-manage:hover, .sb-pos-wrap .sb-pos-manage:hover { background: var(--hover); color: var(--ink); }

/* No scrollbar anywhere, on any device (M 2026-10-31): everything still scrolls by wheel, touch and keys —
   only the bar is never drawn. (scrollbar-width: Firefox / Chrome 121+; ::-webkit-scrollbar: Safari, older Chrome) */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── Activity (sign-up tiles, settings) and order types / tables at the till ── */
.act-card { width: min(560px, 100%); }
.act-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.act-tile { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 84px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; line-height: 1.3; text-align: center; cursor: pointer; }
.act-tile svg { color: var(--primary); }
.act-tile:hover { border-color: var(--primary); }
.act-tile.on { border-color: var(--primary); background: var(--tint); box-shadow: inset 0 0 0 1px var(--primary); }
.act-chip { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 4px 0 12px; border-radius: 10px; background: var(--tint); color: var(--primary); }
[dir='ltr'] .act-chip { padding: 0 12px 0 4px; }
.act-chip strong { flex: 1; color: var(--ink); }
.act-note { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0; text-align: center; }
.act-locked { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.act-locked .act-ic { color: var(--primary); display: flex; }
.act-locked strong { flex: 1; }

/* The order type on top of the cart: one button (type, table, «تغيير»); always the same height. */
.otype-row { padding: 8px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.otype-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--tint-line, #cfe0ff); border-radius: 10px; background: var(--tint); color: var(--primary); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.otype-btn:hover { border-color: var(--primary); }
.otype-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otype-table { flex-shrink: 0; background: var(--card); color: var(--primary); border-radius: 6px; padding: 0 8px; font-size: 13px; line-height: 24px; white-space: nowrap; }
.otype-change { margin-inline-start: auto; display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.pay-type { padding: 0 0 10px; border: 0; }
.otype-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.otype-tile { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 96px; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 16px; text-align: center; cursor: pointer; }
.otype-tile svg { color: var(--primary); }
.otype-tile.on { border-color: var(--primary); background: var(--tint); }

/* Settings → order types: a row each (icon, switch, ✎ for the owner's own), the editor's icon grid. */
.ot-list { display: grid; gap: 0; }
.ot-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px dashed var(--line); }
.ot-row > .switch-row { flex: 1; min-width: 0; border: 0; }
.ot-ic { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--tint); color: var(--primary); }
.ot-edit { flex: none; width: 36px; justify-content: center; }
.ot-add { justify-self: start; margin-top: 10px; }
.ch-face { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 10px; background: var(--card); color: #fff; font-weight: 700; line-height: 1; }
.ch-face img { width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.choice.ch-logo { flex: none; padding: 0; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.choice.ch-logo:hover .ch-face { outline: 2px solid var(--primary); outline-offset: 1px; }
.ch-logo-off { flex: none; width: 32px; justify-content: center; }
.ch-group { margin: 6px 0 8px; font-size: 14px; color: var(--muted); }
.ch-picker { display: grid; gap: 6px; }
.ch-picker .ch-tile { min-height: 92px; }
.ch-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ot-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.ot-icon { display: grid; place-items: center; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.ot-icon.on { border-color: var(--primary); background: var(--tint); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

/* A branch's tables window: a row per section (name · how many · delete); the till's: a title per section. */
.bt-box { display: grid; gap: 10px; }
.bt-head { display: grid; grid-template-columns: 1fr 96px 42px; gap: 8px; }
.bt-row { display: grid; grid-template-columns: 1fr 96px 42px; gap: 8px; align-items: center; }
.bt-row strong.bt-name { padding-inline-start: 4px; }
.bt-count { text-align: center; font-weight: 700; }
.bt-add { justify-self: start; }
.bt-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bt-summary { flex: 1; margin: 0; font-weight: 600; }
.tsec-list { display: grid; gap: 14px; }
.tsec-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.tsec-head { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.tsec-head strong { font-size: 16px; }
.tsec-branch { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 600; }
.table-tile.add { border-style: dashed; color: var(--primary); }
.table-secs { display: grid; gap: 16px; }
.table-sec h4 { margin: 0 0 8px; font-size: 15px; color: var(--muted); }

/* Tables: big squares, the number large; one with an order kept on it is amber. */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.table-tile { min-height: 84px; display: grid; place-content: center; align-content: center; gap: 2px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; text-align: center; cursor: pointer; padding: 6px; }
.table-tile strong { font-size: 24px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.table-tile small { font-size: 12px; }
.table-tile.busy { background: var(--warn-bg); border-color: var(--warn); }
.table-tile.on { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.tables-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.tables-empty svg { color: var(--primary); }
.tables-empty .field { width: min(220px, 100%); }
.tables-count { text-align: center; font-size: 20px; font-weight: 700; }

/* Product search suggestions (product-search.js): exactly the field's width; rows wrap, never overflow. */
.ps-pop { position: fixed; z-index: 2147482000; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(16, 24, 40, .18); }
.ps-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.ps-row.active { background: var(--tint); }
.ps-pic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--bg); color: var(--muted); }
.ps-pic img { width: 100%; height: 100%; object-fit: cover; }
.ps-main { flex: 1; min-width: 0; display: grid; gap: 1px; overflow-wrap: anywhere; }
.ps-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.ps-variant { font-weight: 500; color: var(--muted); }
.ps-alt { font-size: 13px; color: var(--muted); line-height: 1.35; }
.ps-codes { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ps-code { display: inline-flex; align-items: center; gap: 4px; }
.ps-side { flex: none; display: grid; justify-items: end; gap: 2px; }
.ps-price { font-size: 15px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.ps-qty { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ps-qty.out { color: var(--danger); font-weight: 700; }
.ps-row mark { background: #ffe58a; color: inherit; border-radius: 3px; }
.grid-more { grid-column: 1 / -1; height: 1px; }
/* The till's two sides don't affect each other's layout: a change in the cart never re-lays the tiles. Tiles out
   of sight aren't laid out or painted at all (a long catalog). */
.catalog .grid { contain: layout paint style; }
.pos > .cart .lines { contain: layout paint style; }
.grid > .tile { content-visibility: auto; contain-intrinsic-size: auto 110px; }
.ps-none { padding: 16px 12px; text-align: center; color: var(--muted); }
/* Wasla support's own mark on its screen: fixed, so it moves nothing. */
.support-badge { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; background: #fff7ed; border: 1px solid #fb923c; border-radius: 10px; font-size: 13px; color: #9a3412; }

/* شاشة العميل: its options (customer-screen.js), beside a live picture of the screen */
.cs-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cs-look { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.cs-frame { position: relative; aspect-ratio: 16 / 10; border: 6px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--bg); }
.cs-frame iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; pointer-events: none; transform-origin: 0 0; }
.cs-state p { display: flex; align-items: center; gap: 6px; margin: 0; }
.cs-options { display: flex; flex-direction: column; gap: 12px; }
.cs-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-kind { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; text-align: center; cursor: pointer; }
.cs-kind small { color: var(--muted); line-height: 1.3; }
.cs-kind.on { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.cs-pictures { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cs-picture { position: relative; width: 84px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.cs-picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-picture .icon-btn { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; background: var(--card); }
@media (max-width: 760px) { .cs-panel { grid-template-columns: minmax(0, 1fr); } .cs-look { position: static; } }

/* Switching stores (account-switch.js) */
.choice.sb-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 2px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.choice.sb-me:hover, .choice.sb-me:focus-visible { background: var(--tint); }
.sb-switch { flex: none; }
.emenu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.emenu-card { display: grid; justify-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: center; break-inside: avoid; }
.emenu-qr { width: 100%; max-width: 170px; height: auto; image-rendering: pixelated; }
.menu-order-new { display: grid; gap: 8px; font-size: 17px; }
.menu-order-where { font-size: 24px; color: var(--primary); }
.menu-order-who { color: var(--muted); }
.menu-order-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); font-weight: 600; overflow-wrap: anywhere; }
.hours-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hours-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.hours-day { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.hours-day-times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.hours-day-times input[type=time] { flex: 1; min-width: 96px; }
.emenu-warn { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); font-weight: 600; }
/* The count of new orders takes the icon's place, in a red circle: the button keeps its size. */
.pos-orders-btn .ic { width: 20px; height: 20px; }
.pos-orders-btn:has(.sb-unread:not([hidden])) .ic { display: none; }
.pos-orders-btn .sb-unread { order: -1; min-width: 20px; height: 20px; margin: 0; padding: 0 5px; font-size: 12px; line-height: 20px; }
.emenu-address { display: grid; gap: 8px; padding: 14px; margin-bottom: 14px; }
.emenu-address-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.emenu-address-host { color: var(--muted); direction: ltr; }
.emenu-address-row input { flex: 1; min-width: 160px; }
.sb-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: auto; border-radius: 10px; background: var(--danger, #dc2626); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.sb-unread[hidden] { display: none; }
.sb-support-btn { position: relative; }
.sb-support-btn .sb-unread { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.ticket-attach { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ticket-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
/* A file with a ticket message (PDF, CSV, Excel): its name, opening it. */
.ticket-file-chip, .ticket-file { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; }
.pill.ticket-via { margin-inline-start: 6px; }
.ticket-file-chip > span, .ticket-file > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-file { margin-top: 6px; color: var(--primary); text-decoration: none; }
.ticket-file:hover { background: var(--tint); }
.ticket-thread { display: grid; gap: 10px; min-width: 0; }
.ticket-msg { display: grid; gap: 4px; max-width: min(85%, 640px); min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); justify-self: start; overflow-wrap: anywhere; }
.ticket-msg.support { justify-self: end; background: var(--tint); border-color: transparent; }
.ticket-msg-body { white-space: pre-wrap; }
.ticket-msg-body :is(ul, ol) { margin: 4px 0; padding-inline-start: 1.4em; white-space: normal; }
.ticket-msg-body li { white-space: pre-wrap; }
.ticket-msg small { color: var(--muted); }
.ticket-msg img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; }
.ticket-box { display: grid; gap: 8px; min-width: 0; margin-top: 14px; }
.ticket-box-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.profile-verify { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.profile-verify > :first-child { flex: 1; min-width: 0; }
.profile-verify > .btn { flex: none; }
.store-switch { display: grid; gap: 12px; min-width: 0; }
.store-list { display: grid; gap: 8px; min-width: 0; }
.choice.store-row { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.choice.store-row:hover, .choice.store-row:focus-visible { background: var(--tint); border-color: var(--primary); }
.choice.store-row.on { border-color: var(--primary); color: var(--primary); }
.store-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The checkbox of the whole system (ui.js checkbox()): big enough for a finger, the same in every browser. The
   whole line is the target. */
.check { min-height: 44px; gap: 12px; }
input[type='checkbox']:not(.switch) { appearance: none; -webkit-appearance: none; flex: none; box-sizing: border-box; width: 26px; height: 26px; min-width: 26px; min-height: 0; margin: 0; padding: 0; border: 2px solid #b8c1cf; border-radius: 8px; background: var(--card) center / 18px 18px no-repeat; cursor: pointer; transition: background-color .12s, border-color .12s; }
input[type='checkbox']:not(.switch):hover:not(:disabled) { border-color: var(--primary); }
input[type='checkbox']:not(.switch):checked { border-color: var(--primary); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
input[type='checkbox']:not(.switch):focus-visible { outline: 3px solid var(--ring-strong, #0075ff55); outline-offset: 2px; }
input[type='checkbox']:not(.switch):disabled { opacity: .5; cursor: not-allowed; }
.check:has(input:disabled) { cursor: not-allowed; }

/* Dashboard → Subscription */
.sub-page { display: grid; gap: 28px; max-width: 1120px; }
.sub-page > section { display: grid; gap: 12px; min-width: 0; }
.sub-title { margin: 0; font-size: 18px; }
.sub-summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.sub-summary-plan h2 { margin: 2px 0 0; font-size: 22px; }
.sub-summary-plan .pill { vertical-align: middle; }
.sub-fact { display: grid; gap: 2px; min-width: 0; }
/* (its own direction from what it says: «20 نوفمبر 2026», «999 ر.س», «20 November 2026») */
.sub-fact strong { font-size: 16px; unicode-bidi: plaintext; justify-self: start; }
.sub-summary-action { display: grid; gap: 6px; justify-items: end; text-align: end; min-width: 0; }
.plan-picks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.plan-pick { display: flex; flex-direction: column; gap: 10px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-sm); }
.plan-pick.on { border: 2px solid var(--primary); padding: 21px; }
.plan-pick-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; }
.plan-pick-head h3 { margin: 0; font-size: 20px; }
.plan-pick-desc { margin: 0; min-height: 20px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-price b { font-size: 36px; font-weight: 800; line-height: 1.1; direction: ltr; unicode-bidi: isolate; }
.plan-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-cta { width: 100%; justify-content: center; }
.plan-cta-note { min-height: 18px; }
.plan-pick-list { display: grid; gap: 10px; border-block-start: 1px solid var(--line); padding-block-start: 14px; }
.plan-pick-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-pick-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.plan-pick-list li svg { flex: none; margin-block-start: 3px; color: var(--primary); }
.sub-compare-btn { justify-self: center; }
.sub-rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.sub-rows > .sub-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 18px; }
.sub-rows > .sub-row + .sub-row { border-block-start: 1px solid var(--line); }
.sub-row-name, .sub-row-use { display: grid; gap: 4px; min-width: 0; }
.sub-row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Wasla's tax invoices to the store (admin-billing.js). */
.sub-page .table .pill { white-space: nowrap; }
.sub-page > .muted.small, .sub-page section > .muted { margin: 0; }
/* The app store's link: a small black pill, the Wasla logo on white, a light sweeping over it now and then. */
.sub-apps { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; padding-block: 5px; padding-inline: 5px 14px; border-radius: 999px; background: #111; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgb(0 0 0 / .18); transition: transform .15s, box-shadow .15s; }
.sub-apps:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(0 0 0 / .24); }
.sub-apps-logo { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--card); }
.sub-apps-logo img { width: 19px; height: 19px; }
.sub-apps::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / .32) 50%, transparent 65%); transform: translateX(-120%); animation: sub-apps-shine 4s ease-in-out infinite; pointer-events: none; }
@keyframes sub-apps-shine { 0%, 65% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.plan-pick-info, .plan-buy { display: grid; gap: 10px; min-width: 0; }
/* One plan alone: wide — the name on one side, the price and its button in a box on the other, the list in columns under them. */
.plan-picks.single { grid-template-columns: minmax(0, 1fr); }
.plan-picks.single .plan-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 18px 24px; align-items: start; }
.plan-picks.single .plan-pick-head { justify-content: flex-start; }
.plan-picks.single .plan-buy { background: var(--tint); border-radius: 12px; padding: 16px; gap: 12px; }
.plan-picks.single .plan-price { justify-content: center; }
.plan-picks.single .plan-pick-list { grid-column: 1 / -1; }
.plan-picks.single .plan-pick-list ul { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 20px; }
.lock .plan-picks { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-block: 12px; }
.lock .plan-pick { padding: 14px 16px; gap: 6px; box-shadow: none; }
.lock .plan-pick.on { padding: 13px 15px; }
.lock .plan-price b { font-size: 26px; }
@media (max-width: 900px) {
  .plan-picks { grid-template-columns: minmax(0, 1fr); }
  .plan-picks.single .plan-pick { grid-template-columns: minmax(0, 1fr); }
  .sub-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sub-summary-plan, .sub-summary-action { grid-column: 1 / -1; }
  .sub-summary-action { justify-items: stretch; text-align: start; }
  .sub-summary-action .sub-apps { justify-self: start; }
  .sub-rows > .sub-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sub-row-use { grid-column: 1 / -1; grid-row: 2; }
  .sub-row-price { grid-column: 1; grid-row: 3; }
  .sub-row-actions { grid-column: 2; grid-row: 1; }
}
.sb-badge { margin-inline-start: auto; flex: none; white-space: nowrap; font-size: 11px; }
.plan-cta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plan-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 88px); align-items: stretch; }
.plan-table-head { position: sticky; top: 0; z-index: 3; height: 56px; background: var(--card); border-block-end: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.plan-table-head > div { display: grid; justify-items: center; align-content: center; gap: 2px; padding: 0 2px; }
.plan-block { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; background: var(--soft, #f4f4f5); font-size: 12px; font-weight: 700; color: var(--ink); }
.plan-section .plan-block { position: sticky; top: 56px; z-index: 2; }
.plan-row { border-block-end: 1px solid #f4f4f5; }
.plan-row p { display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 0; padding: 8px 14px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.plan-row p svg { flex: none; color: var(--primary); }
.plan-row > span { display: flex; align-items: center; justify-content: center; color: var(--primary); }
.plan-band { background: var(--tint); }
.plan-more { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
.plan-more li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.plan-more svg { flex: none; }
.plan-none { width: 14px; height: 2px; border-radius: 2px; background: #d4d4d8; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: minmax(0, 1fr) repeat(3, 56px); } .plan-row p { padding-inline: 10px 6px; } }
.plan-down { display: grid; gap: 14px; }
.plan-down-lead { margin: 0; font-weight: 600; }
.plan-down-list { display: grid; gap: 8px; }
.plan-down-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, #f5f9ff, var(--card)); }
.plan-down-row strong, .plan-down-row small { display: block; }
.plan-down-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--tint); color: var(--primary); }
.plan-down-keep { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #ecfdf3; color: #067647; font-weight: 600; }
.plan-down-keep svg { flex: none; }

/* The stamp card (stamps.js): big round places, five to a row at most, the last one the gift. */
.stamp-card { display: grid; grid-template-columns: repeat(var(--stamps, 5), 52px); gap: 10px; justify-content: center; padding: 16px; background: var(--tint); border-radius: var(--radius); }
.stamp { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px dashed var(--line); color: var(--muted, #667085); }
.stamp.on { background: var(--brand, #0075ff); border: 2px solid var(--brand, #0075ff); color: #fff; }
.stamp.gift { border-style: solid; border-color: #f59e0b; color: #f59e0b; }
.stamp.gift.on { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.stamp-box { display: grid; gap: 10px; }
.stamp-adjust { display: flex; align-items: center; justify-content: center; gap: 12px; }
.stamp-gift-chosen { display: flex; align-items: center; gap: 8px; }
.stamp-gift-chosen strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) {
  .stamp-card { grid-template-columns: repeat(var(--stamps, 5), 44px); gap: 8px; padding: 12px; }
  .stamp { width: 44px; height: 44px; }
}
.stamp-levels { display: grid; gap: 8px; justify-items: stretch; }
.stamp-levels > .btn { justify-self: start; }
.stamp-level { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px; align-items: center; }

/* A settings form with its preview at the end of the row (the left in Arabic). */
.set-with-preview { display: grid; grid-template-columns: minmax(0, 620px) 300px; gap: 24px; justify-content: start; align-items: start; }
.wallet-preview { position: sticky; top: 0; display: grid; gap: 12px; justify-items: center; }
.wallet-preview[hidden] { display: none; }
.wallet-phone { width: 300px; padding: 10px; border-radius: 38px; background: #14161a; box-shadow: 0 18px 40px #0f172a33; }
.wallet-screen { min-height: 540px; padding: 28px 12px 16px; border-radius: 28px; background: #f2f2f7; }
.wallet-screen.android { background: var(--card); }
.wallet-card { display: grid; gap: 12px; padding: 14px; color: var(--wc-text); background: var(--wc-bg); box-shadow: 0 8px 22px #0f172a2e; }
.wallet-card.apple { border-radius: 14px; }
.wallet-card.android { border-radius: 26px; padding: 18px 16px 0; overflow: hidden; }
.wallet-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wallet-logo { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--wc-text); border: 1.5px solid var(--wc-text); font-weight: 700; object-fit: cover; }
.wallet-card.android .wallet-logo { border-radius: 50%; }
.wallet-store { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.wallet-title { font-size: 21px; font-weight: 700; }
.wallet-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wallet-field { display: grid; gap: 1px; min-width: 0; }
.wallet-field small { font-size: 11px; color: var(--wc-text); }
.wallet-field strong { font-size: 14px; color: var(--wc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-qr { justify-self: center; padding: 8px; background: var(--card); border-radius: 10px; line-height: 0; }
.wallet-qr img { width: 92px; height: 92px; image-rendering: pixelated; }
.wallet-strip { background-size: cover; background-position: center; }
.wallet-strip .stamp-card { grid-template-columns: repeat(var(--stamps, 5), 34px); gap: 7px; padding: 12px 6px; background: none; border-radius: 0; }
.wallet-card.apple .wallet-strip { margin-inline: -14px; }
.wallet-card.android .wallet-strip { margin: 0 -16px; }
.wallet-card.android .wallet-strip .stamp-card { padding-block: 14px; }
.wallet-strip .stamp { width: 34px; height: 34px; background: var(--wc-soft); border: 1.5px solid var(--wc-soft); color: var(--wc-accent); }
.wallet-strip .stamp svg { width: 16px; height: 16px; }
.wallet-strip .stamp.on { background: var(--card); border: 2px solid var(--wc-on-white); color: var(--wc-on-white); }
.stamp-icon-picks { display: grid; grid-template-columns: repeat(auto-fill, 46px); gap: 8px; }
.choice.stamp-icon-pick { display: grid; place-items: center; width: 46px; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.choice.stamp-icon-pick:hover { border-color: var(--primary); }
.choice.stamp-icon-pick.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.wallet-messages { display: grid; gap: 6px; }
.wallet-message { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.stamp-box a.btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1180px) {
  .set-with-preview { grid-template-columns: minmax(0, 1fr); }
  .wallet-preview { position: static; order: -1; }
  .wallet-screen { min-height: 0; }
}

/* tileChoice (ui.js): one choice, each saying what it does. */
.choice-tiles { display: grid; gap: 8px; margin-block: 6px; }
.choice.choice-tile { display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.choice.choice-tile:hover { border-color: var(--primary); }
.choice.choice-tile.on { border-color: var(--primary); background: var(--tint); }
.choice-tile-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--primary); }
.choice-tile.on .choice-tile-ic { background: var(--primary); color: #fff; }
.choice-tile-text { display: grid; gap: 2px; min-width: 0; }
.choice-tile-text strong { font-size: 15px; font-weight: 600; }
.choice-tile-text small { font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 400; }
.choice-tile-mark { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--card); }
.choice-tile.on .choice-tile-mark { border-color: var(--primary); background: var(--primary); color: #fff; }
.sms-page { max-width: 720px; }
.doc-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--primary); border-radius: 12px; background: var(--card); }
.doc-strip .grow { min-width: 0; flex: 1; display: grid; gap: 2px; }
.doc-strip-ic { flex: none; color: var(--primary); display: grid; place-items: center; }
.doc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-reading svg { animation: doc-pulse 1s ease-in-out infinite; }
@keyframes doc-pulse { 50% { opacity: .3; } }
.doc-failed small { color: var(--danger); }
.doc-balance { margin: 0; min-height: 1.5em; }
.doc-pending { margin: 0; overflow-wrap: anywhere; }
.sms-balance { font-size: 34px; line-height: 1.2; }
.stamp-adjust.wrap { flex-wrap: wrap; }

/* The stamp card's own page (card.js): the e-menu's head and footer around the card. */
.card-page { max-width: 480px; margin: 0 auto; }
.card-main { display: grid; gap: 14px; padding: 16px; }
.card-details .set-body { gap: 10px; }
.card-action { width: 100%; justify-content: center; }
a.btn.card-action { display: flex; align-items: center; min-height: 48px; text-decoration: none; }
.card-skip { justify-self: center; color: var(--ink); font-size: 14.5px; }
.card-note { text-align: center; }


/* ── The app store (admin-apps.js) ─────────────────────────────────────── */
.apps-intro { margin: 0 0 14px; }
.apps-sec { display: grid; gap: 12px; margin-bottom: 28px; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.apps-grid .set-body { display: flex; flex-direction: column; gap: 12px; }
.app-tile { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; height: 172px; width: 100%; padding: 16px; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; min-width: 0; }
.app-tile:hover { border-color: var(--primary); }
.app-tile-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-tile-head strong { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tile > p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); min-height: 44px; }
.app-tile-foot .app-price strong { font-size: 20px; }
.app-detail { display: grid; gap: 14px; }
/* The subscriptions app (subscription-ui.js): what is left, big; one button to use one. */
.sub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.sub-card { display: grid; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.sub-card.paused { background: #fffaf0; }
.sub-card.expired, .sub-card.used_up, .sub-card.void { opacity: 0.7; }
.sub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.sub-card-head > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub-card-mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-left { display: flex; align-items: baseline; gap: 8px; }
.sub-left strong { font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.sub-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-card-on { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub-card-actions .btn { flex: 1 1 140px; }
.sub-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sub-pick { display: grid; justify-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: center; min-height: 120px; }
.sub-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.sub-detail { display: grid; gap: 16px; }
.sub-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--bg); border-radius: 14px; }
.sub-detail-top p { margin: 6px 0 0; }
.sub-moves-title { margin: 0; }
.sub-terms h4 { margin: 0 0 4px; }
.sub-terms p { margin: 0; white-space: pre-line; }
.sub-moves { display: grid; gap: 4px; }
.sub-move { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sub-move.undone .sub-move-what { text-decoration: line-through; opacity: 0.6; }
.sub-item-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-item-chips .chip { display: inline-flex; align-items: center; gap: 4px; }
.cust-subs:empty { display: none; }
@media (max-width: 640px) { .sub-move { grid-template-columns: minmax(0, 1fr) auto; } .sub-move > small { grid-column: 1 / -1; } }
.app-detail > p { margin: 0; }
.app-state { display: flex; }
.app-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.app-points li { display: flex; gap: 8px; align-items: flex-start; }
.app-points .ic { color: var(--primary); flex: none; margin-top: 2px; }
.app-price strong { font-size: 24px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-actions .btn { flex: 1 1 140px; }
.app-state { gap: 8px; }
/* the services window after sign-up (admin-apps.js renderServicesPick): a whole screen on a phone */
.services-card { width: min(760px, 100%); gap: 14px; }
.services-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.services-head h2 { margin: 0; font-size: 20px; line-height: 1.4; }
.services-head .btn { flex: none; }
.services-sub { margin: -6px 0 0; font-size: 14px; }
.services-base { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--tint); font-size: 14px; }
.services-base > .ic, .services-base > svg { flex: none; color: var(--primary); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 10px; }
.service-tile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 14px; text-align: start; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.service-tile.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--tint); background: color-mix(in srgb, var(--tint) 45%, var(--card, #fff)); }
.service-text { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; flex: 1; min-width: 0; }
.service-text strong { font-size: 15px; }
.service-text .pill { padding: 1px 8px; font-size: 11px; }
.service-text small { flex-basis: 100%; line-height: 1.5; }
.service-check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 50%; color: transparent; transition: background .12s, border-color .12s; }
.service-tile.on .service-check { border-color: var(--primary); background: var(--primary); color: #fff; }
.services-foot { position: sticky; bottom: -26px; margin: 0 -26px -26px; padding: 12px 26px 20px; background: var(--card, #fff); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
.services-foot .btn { width: 100%; }
@media (max-width: 640px) {
  .auth.services-page { padding: 0; place-items: stretch; background: var(--card, #fff); }
  .services-page .services-card { width: 100%; min-height: 100%; border-radius: 0; box-shadow: none; padding: 16px 16px 0; align-content: start; }
  .services-page .services-foot { bottom: 0; margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
}

/* ── Renting out at the till (rental-till.js) ──────────────────────────── */
.rent-q { margin: 0; font-size: 20px; }
.rent-chips .chip { min-height: 44px; padding-inline: 16px; font-size: 15px; }
.rent-pieces { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rent-pieces .qty { display: flex; align-items: center; gap: 10px; }
.rent-count { min-width: 28px; text-align: center; font-size: 18px; }
.rent-avail { margin: 0; }
.rent-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; }
.rent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rent-row.late { border-color: var(--danger-line, #f3c2c7); background: var(--danger-bg, #fff6f7); }
.rent-row-main, .rent-row-due { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rent-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rent-row-due { align-items: flex-end; flex: none; }
.rent-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rent-late { display: grid; gap: 6px; }
.rent-late-row { display: flex; align-items: center; gap: 10px; }
.rent-late-row .grow { flex: 1; min-width: 0; }
.line-rent { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); }
.qty .rent-dur { width: auto; padding-inline: 10px; white-space: nowrap; }
.pay-deposit { margin-bottom: 10px; }
.rent-step { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0; }
.rent-units { min-width: 120px; text-align: center; font-size: 22px; }

/* ── the repairs app (repair-till.js, admin-repairs.js, repair-page.js) ── */
.repair-who { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: start; min-height: 52px; }
.repair-who.empty { border-style: dashed; border-color: var(--primary); color: var(--primary); }
.repair-kinds .chip { min-height: 44px; padding-inline: 14px; font-size: 15px; }
.repair-new .chips .chip, .repair-window .chips .chip { min-height: 40px; }
.repair-shots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.repair-shot { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.repair-shot img { width: 100%; height: 100%; object-fit: cover; }
.repair-shot-x { position: absolute; top: 2px; inset-inline-end: 2px; background: var(--card); }
.repair-date { width: auto; min-width: 150px; }
.repair-row-no { flex: none; font-weight: 800; min-width: 52px; }
.repair-row .rent-row-main { flex: 1; }
.repair-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.repair-step { justify-content: center; text-align: center; min-height: 52px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.repair-step.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.repair-step.on.s-not_fixed { background: var(--danger); border-color: var(--danger); }
.repair-step.on.s-ready { background: #15803d; border-color: #15803d; }
.repair-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repair-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.repair-lines { display: grid; gap: 6px; }
.repair-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.repair-line-price { width: 110px; flex: none; }
.repair-labour { display: flex; gap: 6px; align-items: center; }
.repair-labour > .ctl:first-child { flex: 1; min-width: 0; }
.repair-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.repair-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--soft, #f5f5f5); }
.wa-msg { justify-content: flex-start; }
.row-late td { background: var(--danger-bg, #fff6f7); }
@media (max-width: 600px) { .repair-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.repair-kinds-edit { display: grid; gap: 12px; }
.repair-kind-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.repair-kind-head { display: flex; align-items: center; gap: 8px; }
.repair-kind-days { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.repair-kind-days .ctl { width: 70px; }
.repair-kind-add { display: flex; gap: 8px; align-items: center; }
.repair-kind-add .ctl { max-width: 280px; }
.tag-editor { align-items: center; margin-top: 0; }
.tag-editor .tag { display: inline-flex; align-items: center; gap: 4px; padding-inline-end: 4px; cursor: default; }
.tag-editor .tag .icon-btn { width: 22px; height: 22px; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted, #777); }
.tag-editor .tag .icon-btn:hover { color: var(--danger); }
.tag-editor .tag-add { width: 180px; min-height: 34px; }
.repair-public .set-card { padding: 16px; }
.repair-public-card { display: grid; gap: 14px; }
.repair-public-state { overflow-wrap: anywhere; }
.repair-public-no { display: flex; align-items: baseline; justify-content: space-between; }
.repair-public-no strong { font-size: 24px; }
.repair-public-state { margin: 0; font-size: 22px; }
.repair-public-state.s-ready, .repair-public-state.s-delivered { color: var(--ok-ink, #15803d); }
.repair-public-state.s-not_fixed { color: var(--danger); }
.repair-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.repair-track li { display: grid; justify-items: center; gap: 4px; text-align: center; color: var(--muted, #777); position: relative; }
.repair-track .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--card); }
.repair-track li.done .dot, .repair-track li.now .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.repair-track li.now { color: var(--primary); font-weight: 700; }
.repair-terms { white-space: pre-line; }
.center { text-align: center; }
.rent-piece-chips .chip.off { opacity: .55; }
.rent-back { display: grid; gap: 8px; }
.rent-back-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rent-back-row.on { border-color: var(--primary); background: var(--tint); }
.rent-back-row.done { color: var(--muted); background: var(--soft, #f5f7fa); }
.rent-back-row .grow { flex: 1 1 200px; min-width: 0; }
@media (max-width: 600px) { .pos-repairs-btn > span { display: none; } }

/* WhatsApp app (admin-whatsapp.js): a campaign's text, two lines in the list, whole in its window */
.wa-text-cell { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 46ch; white-space: pre-wrap; }
.wa-preview { white-space: pre-wrap; margin: 0 0 12px; padding: 12px 14px; background: var(--tint); border-radius: var(--radius); line-height: 1.7; }

/* Sidebar rows with a badge («Point of sale · Open», «Subscription · Trial · 3 days»): one line in English too — the
   name gives way, never the badge */
.sb-item > span { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-pos-state, .sb-item .sb-badge { white-space: nowrap; flex: none; margin-inline-start: auto; }
.sb-item .sb-badge { font-size: 11px; padding: 2px 6px; }
.sb-item:has(.sb-badge) { gap: 8px; }
/* A button whose request is on its way (dom.js modal, admin-whatsapp.js): it turns, and can't be pressed again */
@keyframes wl-spin { to { transform: rotate(360deg); } }
.btn.loading { cursor: progress; }
.btn.loading:disabled { opacity: 1; }
.btn.loading::before { content: ''; flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: wl-spin .7s linear infinite; }

/* ── the bookings app (booking-till.js, admin-bookings.js) ── */
.book-services .chip, .book-new .chips .chip { min-height: 42px; padding-inline: 14px; font-size: 15px; }
.book-one-service { margin: 0; }
.book-date { width: auto; min-width: 150px; }
.book-step { justify-content: flex-start; gap: 12px; padding: 0; }
.book-step .btn { flex: none; width: 48px; height: 44px; padding: 0; }
.book-step strong { min-width: 96px; text-align: center; font-size: 18px; white-space: nowrap; }
.book-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 6px; max-height: 38vh; overflow: auto; padding: 2px; }
.book-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; cursor: pointer; }
.book-slot strong { font-size: 16px; }
.book-slot small { font-size: 11.5px; color: var(--muted); min-height: 14px; }
.book-slot:hover:not(:disabled) { border-color: var(--primary); }
.book-slot.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.book-slot.on small { color: #fff; }
.book-slot.full, .book-slot:disabled { background: var(--bg); color: #a3acb9; cursor: not-allowed; }
.book-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.book-wd { text-align: center; font-size: 12px; padding-bottom: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.book-mday { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; cursor: pointer; }
.book-mday strong { font-size: 16px; }
.book-mday small { font-size: 11px; color: var(--muted); min-height: 13px; }
.book-mday.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.book-mday.on small { color: #fff; }
.book-mday.full small { color: var(--danger); }
.book-mday:disabled { background: var(--bg); color: #b4bcc8; cursor: not-allowed; }
.book-sum { border-top: 1px solid var(--line); padding-top: 8px; }
.book-day-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-day-title { font-size: 17px; min-width: 150px; text-align: center; }
.book-day-head .chips { margin-inline-start: auto; align-items: center; }
.book-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; }
.book-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; cursor: pointer; }
.book-row:hover { border-color: var(--primary); }
.book-row.late { border-color: var(--danger-line, #f3c2c7); background: var(--danger-bg, #fff6f7); }
.book-row.cancelled, .book-row.no_show { opacity: .6; }
.book-row-time { display: flex; flex-direction: column; align-items: center; min-width: 58px; flex: none; }
.book-row-time strong { font-size: 18px; }
.book-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.book-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.book-detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book-detail-top > div { display: flex; flex-direction: column; gap: 2px; }
.book-detail-when { font-size: 18px; }
.book-log summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.book-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.book-actions .btn.primary { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .book-actions { grid-template-columns: 1fr; }
  .book-slots { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-height: none; }
  .book-day-head .chips { margin-inline-start: 0; }
}

/* the walk-in queue at the till (booking-till.js queuePanel) */
.q-add { display: grid; gap: 8px; }
.q-add-row { display: flex; gap: 8px; align-items: center; }
.q-add-row > .input, .q-add-row > input { flex: 1; min-width: 0; }
.q-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.q-row.called { border-color: var(--primary); background: var(--tint); }
.q-row.done, .q-row.left { opacity: .6; }
.q-no { flex: none; min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); font-size: 20px; }
.q-row.called .q-no { background: var(--primary); color: #fff; }
.q-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.q-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-online { margin-inline-start: 6px; font-size: 11px; }
.q-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.q-gone summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.q-gone .q-row { margin-top: 6px; }
@media (max-width: 640px) {
  .q-row { flex-wrap: wrap; }
  .q-actions { width: 100%; justify-content: flex-start; }
}
/* the customers' page (book-page.js) */
.bp-main { display: grid; gap: 14px; padding: 14px; max-width: 640px; margin: 0 auto; }
.bp-doors { display: grid; gap: 10px; }
.bp-door { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font: inherit; cursor: pointer; text-align: center; color: var(--ink); }
.bp-door svg { color: var(--primary); }
.bp-door strong { font-size: 19px; }
.bp-door small { color: var(--muted); }
.bp-turn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border-radius: 16px; background: var(--tint); text-align: center; }
.bp-turn.called { background: var(--primary); color: #fff; }
.bp-turn-no { font-size: 56px; line-height: 1; font-weight: 800; }
.bp-turn p { margin: 4px 0; font-size: 16px; }
.bp-turn-now { font-weight: 800; font-size: 19px; }
.bp-mine h3 { margin: 4px 0 8px; font-size: 16px; }
.bp-booking { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 6px; }
.bp-booking > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-who { text-align: center; }
.bp-bar { display: flex; align-items: center; gap: 6px; }
.bp-bar h2 { margin: 0; font-size: 19px; }
.bp-list { display: grid; gap: 8px; }
.bp-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; cursor: pointer; text-align: start; }
.bp-item > span { display: flex; flex-direction: column; gap: 2px; }
.bp-price { color: var(--primary); white-space: nowrap; }
.bp-summary { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bp-summary > div { display: flex; justify-content: space-between; gap: 10px; }
.bp-summary small { color: var(--muted); }
.bp-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; text-align: center; }
.bp-done > svg { color: var(--ok-ink, #15803d); }
.bp-done h2 { margin: 0; }
.bp-queue-now { font-size: 17px; text-align: center; margin: 4px 0; }
.bp-main .book-slots { max-height: none; }

/* ── the calendar (calendar.js) and the bookings board around it (booking-till.js bookingsBoard) ── */
.modal:has(.book-board) { width: min(1120px, 100%); }
.book-board { display: grid; gap: 10px; min-width: 0; }
.book-board-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.book-board-nav, .book-board-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.book-board-title { font-size: 17px; min-width: 150px; text-align: center; }
.book-board-search { width: 200px; }
.book-board.full { position: fixed; inset: 0; z-index: 70; background: var(--bg); padding: 12px; grid-template-rows: auto 1fr; overflow: hidden; }
.book-board.full .book-board-body { overflow: auto; min-height: 0; }
.book-board.full .cal-body { max-height: none; }
body.cal-full-open { overflow: hidden; }
.table-wrap.as-calendar > table { display: none; }
.table-wrap:not(.as-calendar) > .cal { display: none; }
.table-wrap.as-calendar { overflow: visible; border: 0; background: none; box-shadow: none; }
.cal { --hour: 52px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-time { display: grid; }
.cal-head, .cal-allday { display: grid; grid-template-columns: 52px repeat(var(--cal-cols), minmax(96px, 1fr)); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-colhead { padding: 8px 4px; border: 0; border-inline-start: 1px solid var(--line); background: none; font: inherit; font-weight: 700; font-size: 13px; text-align: center; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-colhead.today { color: var(--primary); }
.cal-allday > div { grid-column: 2 / -1; display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; }
.cal-allday .cal-ev { position: static; flex: 1 1 140px; }
.cal-gutter-label { font-size: 11px; color: var(--muted); align-self: center; text-align: center; }
.cal-body { display: grid; grid-template-columns: 52px repeat(var(--cal-cols), minmax(96px, 1fr)); max-height: 62vh; overflow: auto; }
.cal-gutter { position: relative; }
.cal-gutter span { position: absolute; inset-inline: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); text-align: center; }
.cal-gutter span:first-child { transform: none; }
.cal-col { position: relative; border-inline-start: 1px solid var(--line); }
.cal-col.today { background: #f5f9ff; background: color-mix(in srgb, var(--primary) 4%, white); }
.cal-slot { display: block; width: 100%; height: calc(var(--hour) / 2); border: 0; border-top: 1px solid var(--line); background: none; padding: 0; cursor: pointer; }
.cal-slot.half { border-top: 1px dashed #edf0f5; }
.cal-slot:hover { background: var(--tint); }
.cal-ev { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 3px 6px; border: 0; border-inline-start: 3px solid var(--primary); border-radius: 6px; background: var(--tint); color: var(--ink); font: inherit; font-size: 12px; text-align: start; overflow: hidden; cursor: pointer; z-index: 1; box-shadow: 0 1px 2px #0001; }
.cal-ev strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-ev small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-ev:hover { filter: brightness(.97); }
/* (in the time grid: time, name, service on one line that wraps — a half hour shows the first of them) */
.cal-time .cal-col .cal-ev { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 0 5px; line-height: 1.35; }
.cal-time .cal-col .cal-ev strong, .cal-time .cal-col .cal-ev small { max-width: none; }
.cal-ev.s-done { background: #e7f6ec; border-color: #15803d; }
.cal-ev.s-no_show { background: #fde8ea; border-color: var(--danger); opacity: .75; }
.cal-ev.s-late { background: #fff4e5; border-color: #f59e0b; }
.cal-now { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 6px; text-align: center; font-size: 12px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.cal-mcell { display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 4px; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); cursor: pointer; min-width: 0; }
.cal-mcell:hover { background: var(--tint); }
.cal-mcell.blank { background: var(--bg); cursor: default; }
.cal-mcell.past .cal-mday { color: var(--muted); }
.cal-mcell.today .cal-mday { background: var(--primary); color: #fff; }
.cal-mday { align-self: flex-start; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 12px; font-weight: 700; font-size: 13px; }
.cal-month .cal-ev { position: static; flex-direction: row; align-items: center; gap: 4px; width: 100%; padding: 1px 4px; }
.cal-month .cal-ev small { color: inherit; }
.cal-more { color: var(--muted); font-size: 11px; padding-inline: 4px; }
@media (max-width: 640px) {
  .book-board-bar { gap: 6px; }
  .book-board-title { min-width: 0; flex: 1; font-size: 15px; }
  .book-board-search { width: 100%; order: 9; }
  .cal-head, .cal-allday, .cal-body { grid-template-columns: 40px repeat(var(--cal-cols), minmax(84px, 1fr)); }
  .cal-body { max-height: 60vh; }
  .cal-mcell { min-height: 64px; }
  .cal-month .cal-ev strong { display: none; }
  .cal-month .cal-ev { justify-content: center; }
}

/* ── «دليل الاستخدام»: the help centre (admin-guides.js) ─────────────────── */
.hc { display: grid; gap: 20px; max-width: 920px; margin-inline: auto; width: 100%; }
.hc-hero { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 28px 16px; background: var(--tint); border-radius: 20px; }
.hc-hero h2 { margin: 0; font-size: 26px; }
.hc-search { width: 100%; max-width: 620px; min-height: 54px; font-size: 17px; padding-inline: 18px; border-radius: 14px; background: var(--card); }
.hc-section-title { margin: 6px 0 -6px; font-size: 18px; }
.hc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.hc-cat { display: grid; gap: 6px; align-content: start; justify-items: start; text-align: start; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.hc-cat:hover { border-color: var(--primary); }
.hc-cat strong { font-size: 16px; }
.hc-cat small { line-height: 1.6; }
.hc-count { color: var(--primary); font-weight: 600; }
.hc-cat-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--tint); color: var(--primary); margin-bottom: 4px; flex: none; }
.hc-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 18px; }
.hc-box-title { margin: 12px 0 4px; font-size: 16px; }
.hc-list { display: grid; }
.hc-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; text-align: start; background: none; border-bottom: 1px solid var(--line); }
.hc-row:last-child { border-bottom: 0; }
.hc-row:hover strong { color: var(--primary); }
.hc-row-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.hc-row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-go, .hc-sep { color: var(--muted); flex: none; }
.hc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; }
.hc-crumb { background: none; padding: 2px 4px; color: var(--primary); }
.hc-crumb.on { color: var(--muted); }
.hc-cat-head { display: flex; gap: 14px; align-items: center; }
.hc-cat-head h2 { margin: 0; }
.hc-cat-head p { margin: 4px 0 0; }
.hc-article { display: grid; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.hc-article h2 { margin: 0; font-size: 24px; line-height: 1.5; }
.hc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hc-steps li { display: flex; gap: 12px; align-items: flex-start; }
.hc-steps p { margin: 4px 0 0; font-size: 16.5px; line-height: 1.8; }
.hc-num { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.hc-tip { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--warn-bg); border-radius: 12px; }
.hc-tip p { margin: 0; line-height: 1.7; }
.hc-tip .ic { flex: none; margin-top: 3px; }
.hc-shot { width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.hc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .hc-article { padding: 18px; } .hc-hero h2 { font-size: 22px; } }
.hc .hc-row, .hc .hc-crumb, .hc .hc-cat { box-shadow: none; }
.hc .hc-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 0; width: 100%; }
.hc .hc-row:last-child { border-bottom: 0; }
.hc .hc-crumb { border: 0; border-radius: 6px; min-height: 0; }
.hc .hc-crumb:hover { background: var(--tint); }
/* Support, before a ticket: the help centre's answer (support.js) */
.sa-wait { display: grid; justify-items: center; gap: 12px; padding: 36px 12px; text-align: center; }
.sa-wait p { margin: 0; font-size: 16px; color: var(--muted); }
.sa-wait-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--tint); color: var(--primary); animation: sa-pulse 1.2s ease-in-out infinite; }
@keyframes sa-pulse { 50% { transform: scale(1.08); opacity: .75; } }
.sa-answer { display: grid; gap: 16px; }
.sa-reply { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 14px 16px; background: var(--tint); border-radius: 14px; font-size: 17px; line-height: 1.8; }
.sa-reply .ic { flex: none; margin-top: 5px; color: var(--primary); }
.sa-article { padding: 18px; }
.sa-article h3 { margin: 0; font-size: 19px; }
.sa-none { margin: 0; font-size: 16px; line-height: 1.8; }

/* ── Sign-in page (auth.js authPage) ────────────────────────────────────────────────────────────────────────────
   Upright: the app's own card (white, hairline, no shadow) on its grey page, in the middle; the page scrolls only
   if it must (margin auto, not place-items, so a tall card is never cut at the top). Wide screen, tablet or phone
   on its side: two halves 50/50, a plain black half with the white wordmark first, then the form on white. Black
   instead of the app's blue on this page. Sizes follow the height, so a short screen needs no scrolling. */
.auth.signin { --primary: #111; --accent: #111; --brand: #111; --tint: #efefef; display: flex; flex-direction: column; align-items: center; padding: 64px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.signin .auth-card { margin-block: auto; flex: none; gap: clamp(10px, 1.8vh, 14px); padding: clamp(18px, 3vh, 26px); border: 1px solid var(--line); box-shadow: none; }
.auth-side { display: none; }
/* the two ways in (username / mobile): the app's segmented chips, side by side */
.signin .auth-via { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.signin .auth-via .chip { height: 42px; }
/* (the mobile box as tall as the others, so switching the tab moves nothing) */
.signin .auth-card .phone-input { height: 42px; }
.signin .auth-card .phone-input input { height: 40px !important; min-height: 0 !important; }
.signin .auth-card .btn.big { padding-block: clamp(11px, 1.9vh, 16px); }
/* «welcome to» + the written name, on one line, centred like the card's name */
.auth-welcome { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: clamp(20px, 2.9vh, 24px); line-height: 1.3; }
.auth-welcome img { height: 1.05em; width: auto; }
/* black, not blue, on this page: the focus ring and the hover too */
.signin :is(input, select):focus { box-shadow: 0 0 0 3px #1111111f; }
.signin .btn.primary:hover { filter: none; background: #2b2b2b; border-color: #2b2b2b; }
/* (the row under the boxes keeps its height in both tabs, with a link or empty) */
.signin .auth-links { min-height: 28px; align-items: center; }
.signin .link-btn:disabled { color: var(--muted); text-decoration: none; }
.signin .otp-input { height: 42px; padding-block: 0; font-size: 18px; }
/* the tab's rows under the chips: the mobile tab (one box) as tall as the username tab (two boxes and a line) */
.auth-pane { display: grid; gap: inherit; align-content: start; }
.auth-stack { display: grid; gap: inherit; }
.auth-stack > .auth-pane { grid-area: 1 / 1; }
.auth-pane.ghost { visibility: hidden; }
/* the mobile tab: one big box, where the username box sits (the rest of the username tab's height stays free below) */
.signin .auth-card .auth-pane.phone .phone-input { height: 56px; }
.signin .auth-card .auth-pane.phone .phone-input input { height: 54px !important; font-size: 20px; }
/* the mobile's second step: the number the code went to, and «change number» beside it */
.auth-sent { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.auth-sent > div { display: grid; gap: 2px; min-width: 0; flex: 1; }
.auth-sent small { color: var(--muted); font-size: 13px; }
.auth-sent b { font-size: 18px; letter-spacing: .04em; justify-self: start; }
.signin .auth-sent ~ .field .otp-input { height: 56px; font-size: 26px; letter-spacing: .6em; }

/* Two halves: a wide screen, a tablet or a phone on its side. */
@media (min-width: 560px) and (min-aspect-ratio: 4/3), (min-width: 1100px) {
  .auth.signin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: stretch; padding: 0; overflow: hidden; background: var(--card); }
  .signin .auth-card {
    grid-column: 2; grid-row: 1; width: 100%; margin: 0; overflow-y: auto; align-content: safe center; border: 0; border-radius: 0;
    padding-block: max(clamp(16px, 4vh, 40px), env(safe-area-inset-top)) max(clamp(16px, 4vh, 40px), env(safe-area-inset-bottom));
    padding-inline: max(24px, calc((100% - 400px) / 2));
  }
  .auth-side { display: grid; place-items: center; grid-column: 1; grid-row: 1; background: #111; }
  .auth-side img { width: min(220px, 45%); height: auto; filter: brightness(0) invert(1); }
  /* (the language on the black half's corner, clear of the form) */
  .signin .auth-lang { position: fixed; top: max(12px, env(safe-area-inset-top)); inset-inline: max(12px, env(safe-area-inset-left)) auto; color: #fff; background: #ffffff1a; border-color: #ffffff33; }
  [dir='ltr'] .signin .auth-lang { inset-inline: max(12px, env(safe-area-inset-left)) auto; }
  .signin .auth-lang:hover { background: #ffffff33; }
}
/* A phone on its side: the rows as tight as they go (the name is on the black half). */
@media (min-width: 560px) and (min-aspect-ratio: 4/3) and (max-height: 540px) {
  .signin .auth-card { gap: 5px; padding-block: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom)); padding-inline: max(20px, calc((100% - 400px) / 2)); }
  .signin .auth-card > .brand { display: none; }
  .auth-welcome { font-size: 17px; }
  .signin .auth-intro h2 { font-size: 17px; }
  .signin .auth-intro p { display: none; }
  .signin .field { gap: 3px; font-size: 13px; }
  .signin .field small { display: none; }
  .signin .auth-via .chip { height: 36px; }
  .signin .auth-sent { padding-block: 6px; }
  .signin .auth-sent ~ .field .otp-input { height: 44px; font-size: 22px; }
  .signin .auth-card .auth-pane.phone .phone-input { height: 44px; }
  .signin .auth-card .auth-pane.phone .phone-input input { height: 42px !important; font-size: 18px; }
  .signin .auth-card .btn.big, .signin .auth-foot .btn { padding-block: 8px; font-size: 16px; }
  .signin .auth-foot { gap: 6px; }
  .signin .auth-links { font-size: 13px; column-gap: 8px; }
  .signin .act-chip { min-height: 32px; }
  .signin .act-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; }
  .signin .act-tile { display: flex; align-items: center; justify-content: flex-start; min-height: 38px; padding: 3px 10px; gap: 8px; font-size: 13px; text-align: start; }
  .signin .act-tile svg { width: 20px; height: 20px; flex: none; }
  /* (the sign-up's 13 activity tiles need the whole width on so short a screen) */
  .auth.signin:has(.act-grid) { grid-template-columns: minmax(0, 1fr); }
  .signin:has(.act-grid) .auth-side { display: none; }
  .signin:has(.act-grid) .auth-card { grid-column: 1 / -1; padding-inline: max(20px, calc((100% - 720px) / 2)); padding-top: 46px; }
  .signin:has(.act-grid) .auth-lang { inset-inline: auto max(12px, env(safe-area-inset-right)); color: inherit; background: var(--card); border-color: var(--line); }
}
/* Upright and short: a little less air. */
@media (max-aspect-ratio: 4/3) and (max-height: 700px) {
  .auth.signin { padding-top: 60px; }
  .signin .field { gap: 3px; }
  .signin .act-tile { min-height: 62px; gap: 3px; padding-block: 5px; }
}
@media (max-aspect-ratio: 4/3) and (max-height: 680px) {
  .signin .auth-card:has(.act-grid) .auth-intro p { display: none; }
  .signin .act-tile { min-height: 52px; }
}

/* First steps on the home (onboarding.js): big rows, a tick for each task done. (the skeleton keeps the four rows' height) */
.ob-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; display: grid; gap: 12px; }
.ob-sk { height: 328px; border-radius: 10px; }
.ob-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ob-head h2 { margin: 0; font-size: 20px; }
.ob-bar { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: #16a34a; border-radius: 99px; transition: width .4s var(--ease); }
.ob-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ob-task { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ob-tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.ob-task.done .ob-tick { background: #16a34a; border-color: #16a34a; }
.ob-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ob-name b { font-size: 16px; }
.ob-task.done .ob-name b { color: var(--muted); text-decoration: line-through; }
.ob-task .btn { flex: none; }
/* (a silent tour's «تخطَّ» reads as a word, not an icon) */
.vh-silent .vh-foot { justify-content: flex-end; }

/* «من ⇄ إلى» (admin-kit.js swapPair): the swap button between the two fields, level with their boxes; two
   columns of a form grid, the whole row on a phone. */
.swap-pair { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.swap-btn { width: 42px; height: 42px; border-radius: 10px; color: var(--brand); }
.swap-btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) { .swap-pair { grid-column: 1 / -1; } }

/* A cost box with its unit after it («4.00 / كجم»): the unit stays on the box's line. */
.per-unit { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.per-unit input { width: 110px; }

/* A home list that only shows when it has something (expiring batches): as tall as its lines. */
.home-list.short { min-height: 0; }

/* Wasla's notices to the owner (notices.js): a card each, newest first, as wide as reads well; the picture sits in a
   box of fixed shape (nothing moves as it loads), whole, never cut. */
.notice-list { display: grid; gap: 14px; max-width: 760px; }
.notice-card { display: grid; gap: 10px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s; }
.notice-card.hl { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.notice-head { display: flex; align-items: center; gap: 8px; }
.notice-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.notice-date { color: var(--muted); font-size: 13px; }
.notice-title { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.notice-body { margin: 0; white-space: pre-line; line-height: 1.8; color: var(--ink-2, var(--ink)); }
.notice-img { aspect-ratio: 1.91 / 1; overflow: hidden; border-radius: 12px; background: var(--page, #f4f5f7); }
.notice-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.notice-link { justify-self: start; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.pill.notice-news { background: var(--tint); color: #1d5fc4; }
.pill.notice-feature { background: var(--ok-bg, #e6f6ec); color: #17803d; }
.pill.notice-announcement { background: #f1edfb; color: #6741b8; }
.pill.notice-alert { background: #fdeeee; color: #b4232f; }
.notice-pop { display: grid; gap: 12px; }
/* A notice with a form (the store's details for Wasla's tax invoice): the deadline, the missing fields, a result line. */
.notice-pop .notice-due { margin: 0; font-weight: 700; color: var(--danger); }
.notice-pop .form-grid { margin: 0; }
.notice-pop .notice-result { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg, #e6f6ec); color: #17803d; font-weight: 600; }
.notice-pop .notice-result.err { background: #fdeeee; color: #b4232f; }
.notice-card .notice-act { justify-self: start; }
/* An unread alert: the notices mark is a bell that rings (same 20px box as the number, nothing moves). */
.notice-mark.ring { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 20px; }
.notice-mark.ring[hidden] { display: none; }
.notice-mark.ring svg { color: #fff; stroke: #fff; transform-origin: 50% 2px; animation: notice-ring 2.4s ease-in-out infinite; }
@keyframes notice-ring {
  0%, 40%, 100% { transform: rotate(0); }
  5% { transform: rotate(18deg); } 10% { transform: rotate(-16deg); } 15% { transform: rotate(13deg); }
  20% { transform: rotate(-10deg); } 25% { transform: rotate(6deg); } 30% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) { .notice-mark.ring svg { animation: none; } }
/* The notices' bell by the logo (and, on a phone, in the top bar): a fixed 36px box with the count on its corner;
   while any notice is unread it rings and blinks (still — the red count only — with prefers-reduced-motion). */
.sb-brand { justify-content: space-between; }
.sb-bell { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: inherit; text-decoration: none; }
.sb-bell:hover { background: var(--tint); }
.sb-bell .sb-unread { position: absolute; top: 0; inset-inline-end: 0; min-width: 16px; height: 16px; margin: 0; padding: 0 4px; font-size: 10px; line-height: 16px; }
.sb-bell.ringing > svg { transform-origin: 50% 2px; animation: notice-ring 2.4s ease-in-out infinite, bell-blink 2.4s ease-in-out infinite; color: var(--danger, #dc2626); }
@keyframes bell-blink { 0%, 45%, 100% { opacity: 1; } 50% { opacity: .35; } 55% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sb-bell.ringing > svg { animation: none; } }
.pagebar-bell { display: none; }
@media (max-width: 900px) { .pagebar-bell { display: inline-flex; } }
/* «الاشتراك»: the red mark of a request still to pay sits before the trial badge, which keeps its place at the end */
.sb-item .pay-mark { margin-inline-start: auto; }
.sb-item .pay-mark:not([hidden]) + .sb-badge { margin-inline-start: 6px; }

/* The AI price, said before every read (ai-cost.js): the points it takes, the balance, the rules. */
.ai-cost { display: grid; gap: 16px; }
.ai-cost-head { display: flex; align-items: center; gap: 14px; }
.ai-cost-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--tint); color: var(--primary); flex: none; }
.ai-cost-need { font-size: 1.25rem; font-weight: 700; }
.ai-cost-lines { display: grid; gap: 8px; }
.ai-cost-line { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ai-cost-line.ok { color: var(--ok, #16794c); }
.ai-cost-line.bad { color: var(--danger); font-weight: 600; }

/* A trial balance read by levels (accountant mode): each level's total row, the kind above its groups. */
.level-head { font-weight: 700; }
tr.level-1 td { background: var(--tint); }

/* An invoice's payment (customers-ui.js invoicePayCard): its state big and in its colour, what is paid and left. */
.inv-pay { display: grid; gap: 12px; padding: 16px; border: 1px solid; border-radius: var(--radius); }
.inv-pay.ok { background: var(--ok-bg, #e6f6ec); border-color: #b6e2c4; }
.inv-pay.warn { background: var(--warn-bg); border-color: var(--warn-line, #ffe08a); }
.inv-pay.bad { background: var(--danger-bg, #fdecec); border-color: #f5c2c2; }
.inv-pay-head { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.inv-pay.ok .inv-pay-head { color: var(--ok-ink, #16a34a); }
.inv-pay.warn .inv-pay-head { color: var(--warn-ink, #8a6100); }
.inv-pay.bad .inv-pay-head { color: var(--danger); }
.inv-pay-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inv-pay-rows div { display: grid; gap: 2px; padding: 8px 12px; background: rgba(255, 255, 255, .7); border-radius: 10px; }
.inv-pay-rows span { font-size: 13px; color: var(--muted); }
.inv-pay-rows b { font-size: 20px; }
.inv-pay-note { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; }
@media (max-width: 520px) { .inv-pay-head { font-size: 20px; } .inv-pay-rows b { font-size: 16px; } .inv-pay-rows div { padding: 6px 8px; } }

/* ── A user's own look (their page: public/profile.js, public/theme.js). The main colour comes in as --primary and its
   shades; dark mode swaps the page's surfaces, lines and text. Every fixed light colour above reads a variable whose
   fallback is that same colour, so the light look is untouched and only dark mode defines them. The paper
   (receipts, A4, what is printed) always stays white with black ink. ── */
.theme-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.setup-colors { padding-bottom: 12px; } /* the dots' ring and tick show whole under the cards */
.theme-colors .theme-dot { position: relative; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 2px solid var(--card); background: var(--dot); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.theme-colors .theme-dot[aria-checked='true'] { box-shadow: 0 0 0 2px var(--dot, var(--ink)); }
.theme-colors .theme-dot[aria-checked='true']::after { content: ''; position: absolute; inset: 0; margin: auto; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
/* «لون آخر»: a ring of colours until one of its own is picked */
.theme-colors .theme-other { overflow: hidden; background: var(--dot, conic-gradient(#e8590c, #ffc107, #00a37a, #0b7285, #0075ff, #7048e8, #d6336c, #e8590c)); }
.theme-other input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }

/* «الافتراضي»: a white dot drawn by its line, its tick in ink */
.theme-colors .theme-none { box-shadow: 0 0 0 1px var(--line-strong, #c4ccd8); }
.theme-colors .theme-none[aria-checked='true'] { box-shadow: 0 0 0 2px var(--ink); }
.theme-colors .theme-none[aria-checked='true']::after { border-color: #1b2430; }

/* A picked colour fills the sidebar: its words, icons, lines and the page you are on turn white over it (the sidebar's
   own variables, so every line in it follows). No colour = the white sidebar as it is. */
html[data-side='color'] .sidebar, html[data-side='color'] .till-rail {
  background: var(--side-color); border-inline-end-color: transparent; color: var(--ink);
  --ink: #fff; --ink-2: #ffffffe6; --muted: #ffffffb3; --line: #ffffff33; --line-strong: #ffffff59;
  --hover: #ffffff1f; --tint: #ffffff2e; --primary: #fff; --card: #ffffff2e; --soft: #ffffff1f; --soft-2: #ffffff29;
}
html[data-side='color'] .sidebar .sb-logo { filter: brightness(0) invert(1); }

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1318; --page: #0f1318; --card: #181d24; --side: #181d24; --glass: #181d24ee;
  --ink: #e6eaf0; --ink-2: #c3cad4; --muted: #98a2b0;
  --line: #2a323c; --line-soft: #232a33; --line-strong: #3a4450; --hover: #ffffff0d;
  --soft: #1e242c; --soft-2: #232a33;
  --tint: #12294a; --tint-soft: #151f2e; --tint-line: #234a80;
  --danger: #f06b77; --danger-bg: #3a1c21; --danger-line: #6b2d35;
  --ok-bg: #12301f; --ok-line: #24573a; --ok-ink: #5fd38d;
  --warn: #ffc107; --warn-bg: #3a3112; --warn-soft: #2e2810; --warn-line: #6b5a1c; --warn-ink: #f2c94c;
  --shadow-sm: #00000040; --shadow: #00000059; --shadow-lg: #00000073;
}
/* the Wasla wordmark is black ink: white on the dark sidebar */
html[data-theme='dark'] .sb-logo { filter: invert(1) hue-rotate(180deg); }
/* the small icon chips and pills in their own colour (violet, amber, rose…): a faint wash of that colour */
html[data-theme='dark'] :is(.home-kpis .kpi .kpi-ic, .rep-card .rep-ic, .rep-top-card .rep-ic, .st-check.ok, .pill[class*='notice-']) { background: #ffffff12; background: color-mix(in srgb, currentColor 18%, transparent); }
html[data-theme='dark'] .sub-card.paused { background: var(--warn-bg); }
html[data-theme='dark'] .inv-pay-rows div { background: #00000040; }
html[data-theme='dark'] .doc-viewer.loading::after { background-color: #0f131899; }
/* the paper: as printed, whatever the screen's look */
html[data-theme='dark'] :is(.receipt, .a4, #print-area) {
  --bg: #f4f6f9; --card: #fff; --ink: #1b2430; --muted: #6b7686; --line: #e3e7ee; --glass: initial;
  --soft: initial; --soft-2: initial; --line-soft: initial; --line-strong: initial; --tint: #e8f1ff; --tint-soft: initial; --tint-line: initial;
  --danger-bg: initial; --danger-line: initial; --ok-bg: initial; --ok-line: initial; --ok-ink: initial; --warn-bg: #fff8db; --warn-soft: initial; --warn-line: initial; --warn-ink: initial;
  color-scheme: light; background: #fff; color: #000;
}
html[data-theme='dark'] .receipt-preview { background: #e9edf2; }
@media print {
  html[data-theme='dark'] { color-scheme: light; --bg: #fff; --card: #fff; --ink: #000; --muted: #6b7686; --line: #e3e7ee; }
}

/* Retail (groceries): no tiles. The search on top, under it the cart the width of the screen, its lines a table;
   the totals and Pay at the end of it, under the totals column. (phones: mobile-till.css) */
.lines-head { display: none; }
.pos.retail { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.pos.retail > .catalog { padding-bottom: 0; }
.pos.retail > .catalog > .cats, .pos.retail > .catalog > .grid { display: none; }
.pos.retail > .cart { margin: 12px; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pos.retail .lines-head, .pos.retail .line { display: grid; grid-template-columns: 40px 140px minmax(0, 1fr) 140px 132px 140px 32px; grid-template-areas: none; gap: 0 14px; align-items: center; }
.pos.retail .lines-head { padding: 10px 18px; background: var(--soft, #fafbfc); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; flex-shrink: 0; }
.pos.retail .lines { padding: 0 8px; }
.pos.retail .line { padding: 9px 10px; border-radius: 0; }
.pos.retail .line > * { grid-area: auto; }
.pos.retail .line-no { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.pos.retail .line-name { align-self: center; }
.pos.retail .line-unit, .pos.retail .line > .qty, .pos.retail .line-total { justify-self: start; }
.pos.retail .line-unit { font-variant-numeric: tabular-nums; }
.pos.retail .line-code { justify-self: start; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* (the name opens the product, for who may edit it) */
.line-edit { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.line-edit:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.cart-foot { display: contents; }
/* (the buttons at the start — right in Arabic — the totals at the end, the room between them) */
.pos.retail .cart-foot { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 440px); justify-content: space-between; align-items: end; gap: 24px; padding: 12px 14px; border-top: 1px solid var(--line); }
.pos.retail .cart-foot > .sums { grid-column: 2; grid-row: 1; padding: 0; border-top: 0; }
.pos.retail .cart-foot > .pay { grid-column: 1; grid-row: 1; padding: 0; }

/* The first questions sit over the dashboard: a light veil, so the colour and the dark look picked show behind. */
.modal-backdrop:has(.setup-q) { background: #0003; }
/* a question's title and its line read as one pair: no browser margins, the line close under the title */
.setup-q h3, .setup-q > p { margin: 0; }
.setup-q h3 + p { margin-top: -8px; }

/* ══ A toolbar (admin-kit fitRow): one row; each thing on it has its kind (data-slot) and the kind's rules ══
   start: search · filter · period · a page's own field — end: reports · secondary · primary (the main button) · «⋯».
   Too narrow (the row's own width): fitRow folds and shortens them in a fixed order (see there). */
.toolbar.tb { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
/* (the row takes the room it is given, never its things' width: folding a button must not make it narrower) */
.page-head > .toolbar.tb { flex: 1 1 auto; }
.toolbar.tb > * { flex: none; min-width: 0; margin: 0; }
.tb > [data-slot=search] { order: 1; flex: 1 1 260px; min-width: 220px; max-width: 420px; }
.tb.tb-search-min > [data-slot=search] { min-width: 140px; }
.tb > [data-slot=search] input, .tb > input[data-slot=search] { width: 100%; min-width: 0; max-width: none; }
.tb > [data-slot=filter] { order: 2; }
.tb > [data-slot=period] { order: 3; max-width: 230px; }
.tb > [data-slot=period] > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb > [data-slot=other] { order: 4; flex: 0 1 auto; }
.tb > .tb-gap { order: 5; flex: 1 1 0; }
.tb > [data-slot=reports] { order: 6; }
.tb > [data-slot=secondary] { order: 7; }
.tb > [data-slot=primary] { order: 8; }
.tb > [data-slot=more] { order: 9; }
/* the filter: its icon, and how many filters are on */
.tb .fb-filter > span:not(.fb-count) { display: none; }
/* only the icon (the period, the main button — its name stays as the tooltip) */
.tb > .btn.tb-icon > span { display: none; }
.tb > .btn.tb-icon { padding-inline: 12px; }
/* the search on a line of its own, the rest under it */
.tb.tb-stack { flex-wrap: wrap; }
.tb.tb-stack > [data-slot=search] { flex: 1 1 100%; max-width: none; min-width: 0; }
/* past every rule: the row wraps rather than anything sitting over something else */
.tb.tb-wrap { flex-wrap: wrap; }

/* ── The till's side rail (M 2026-11-21): dashboard, invoices, printer — icons only, their names in bubbles — at the screen's start
   (the dashboard sidebar's side and colours). Phones: hidden, the same buttons sit at the top bar's start (.bar-rail). ── */
.till { flex: 1; min-height: 0; display: flex; }
.till-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.till-rail { position: relative; z-index: 6; flex: 0 0 64px; display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; background: var(--side); border-inline-end: 1px solid var(--line); }
.till-rail .rail-btn { position: relative; display: grid; place-items: center; width: 100%; height: 48px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.till-rail .rail-btn:hover { background: var(--hover); }
.till-rail .rail-btn .ic { color: var(--ink-2); }
/* the name: a dark bubble beside the button, over the page (fixed colours: the rail's own turn white on a coloured one) */
.till-rail .rail-tip { position: absolute; top: 50%; inset-inline-start: calc(100% + 10px); transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: #1f2937; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; box-shadow: 0 4px 14px #0003; }
.till-rail .rail-tip::before { content: ''; position: absolute; top: 50%; inset-inline-start: -5px; width: 10px; height: 10px; background: inherit; transform: translateY(-50%) rotate(45deg); }
.till-rail .rail-btn:hover .rail-tip, .till-rail .rail-btn:focus-visible .rail-tip, .till-rail.hints .rail-tip { opacity: 1; visibility: visible; transition: opacity .25s, visibility 0s; }
html[data-theme='dark'] .till-rail .rail-tip { background: #374151; }
/* the wordmark on its side, its first letter at the top (turned left in Arabic, right in English) */
.till-rail .rail-logo { position: relative; flex: none; height: 118px; margin-bottom: 8px; }
.till-rail .rail-logo img { position: absolute; top: 50%; left: 50%; height: 22px; width: auto; max-width: none; transform: translate(-50%, -50%) rotate(-90deg); }
[dir='ltr'] .till-rail .rail-logo img { transform: translate(-50%, -50%) rotate(90deg); }
html[data-side='color'] .till-rail .sb-logo { filter: brightness(0) invert(1); }
/* the foot: settings, support, closing the point of sale — at the bottom, under a line */
.till-rail .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.till-rail .rail-btn.danger .ic { color: var(--danger); }
html[data-side='color'] .till-rail .rail-btn.danger .ic { color: #ff9aa5; }
.till-rail .rail-btn .sb-unread { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; line-height: 18px; margin: 0; }
/* the new till (.till, ?till=new): the top bar over the products only, the cart's column from top to bottom (wide
   screens, the tiles look); ≤ 860px is the phone look (mobile-till.css), retail stacks as before. The old till has no .till: none of this. */
.till .pos { grid-template-rows: auto minmax(0, 1fr); }
.till .pos > .pos-bar { grid-column: 1; grid-row: 1; min-width: 0; }
.till .pos > .catalog { grid-column: 1; grid-row: 2; }
.till .pos > .cart { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 860px) { .till .pos > .pos-bar, .till .pos > .catalog, .till .pos > .cart { grid-column: auto; grid-row: auto; } } /* (the phone look: mobile-till.css) */
.till .pos.retail { grid-template-rows: auto auto minmax(0, 1fr); }
.till .pos.retail > .pos-bar, .till .pos.retail > .catalog, .till .pos.retail > .cart { grid-column: 1; grid-row: auto; }
.bar-rail { display: none; }
/* «المعلّقة»: each order a row — open it on the row, remove it with the button at its end (red: «إلغاء الطلب») */
.held-row { display: flex; align-items: stretch; gap: 8px; }
.held-row > .cust-row { flex: 1; min-width: 0; }
.held-row > .held-drop { flex: none; min-height: 48px; color: var(--muted); }
.held-row > .held-drop:hover { color: var(--danger); border-color: var(--danger-line, #f3c2c6); }
.held-row > .held-drop.cooked { color: var(--danger); }
/* «بيع جديد» counting down to closing its window by itself: a light fill growing across it (no number) */
.btn.countdown { position: relative; overflow: hidden; isolation: isolate; }
.btn.countdown::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #ffffff38; transform: scaleX(0); transform-origin: right; animation: btn-countdown var(--cd, 10s) linear forwards; }
[dir='ltr'] .btn.countdown::before { transform-origin: left; }
@keyframes btn-countdown { to { transform: scaleX(1); } }
/* a held sale on its way to «المعلقة» (pos.js flyToHeld), and the icon taking it */
.till-rail.lift { z-index: 60; pointer-events: none; } /* (over a window's shade for a moment: not pressable meanwhile) */
.fly-dot { position: fixed; left: -15px; top: -15px; z-index: 200; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; box-shadow: 0 6px 18px #0004; pointer-events: none; }
.till-rail .rail-btn.bump .ic { animation: held-take .5s var(--ease, ease-out); }
.till-rail .rail-btn.bump .sb-unread { animation: held-take-n .55s var(--ease, ease-out); }
@keyframes held-take { 40% { transform: scale(1.35); } }
@keyframes held-take-n { 0% { transform: scale(.4); } 45% { transform: scale(1.6); } 100% { transform: scale(1); } }
/* the new till, wide: the cart's rows end on the same lines as the products' side — its top row with the top bar (52px),
   the customer row with the bottom of the search box (52 + 12 + 51 = 115px) */
@media (min-width: 861px) {
  .till .pos:not(.retail) .otype-pair { box-sizing: border-box; height: 52px; padding-block: 0; align-items: center; }
  .till .pos:not(.retail) .otype-pair + .cust-bar { box-sizing: border-box; min-height: 63px; }
  .till .pos:not(.retail) .otype-pair:not(:has(> :not([hidden]))) + .cust-bar { min-height: 52px; }
}
/* half a row each: no F6 mark (the key still works), the names have the room */
.otype-pair:has(> .otype-row:not([hidden]) + .channel-row:not([hidden])) .otype-btn[data-key]::after { display: none; }
/* «للمطبخ» has no key: an unseen mark of the same size, its word level with Pay's, Hold's and More's */
.till-keys .pay > [data-kitchen]::after { content: 'F0'; visibility: hidden; flex: none; padding: 1px 5px; border: 1px solid transparent; font-size: 10.5px; font-weight: 600; line-height: 1.3; }
/* the new till: order type | price list in one row at the cart's top (either alone takes the row; none: no row) */
.otype-pair { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.otype-pair:not(:has(> :not([hidden]))) { display: none; }
.otype-pair > .otype-row { flex: 1 1 0; min-width: 0; padding: 0; border: 0; }
.otype-pair > .otype-row:not([hidden]) + .channel-row { padding-top: 0; }
.otype-pair:has(> .otype-row:not([hidden]) + .channel-row:not([hidden])) .otype-change { font-size: 0; gap: 0; } /* (half a row: the word «تغيير» goes, its arrow stays) */
.pos-bar .bar-rail .icon-btn.danger { color: var(--danger); border-color: var(--danger-line, #f3c2c6); }
@media (min-width: 861px) { .phone-only { display: none !important; } } /* (the till's phone look reaches 860px) */
/* the invoices window: search, day and «this point of sale / all» on one row over the list */
.till-inv { display: grid; gap: 12px; }
.till-inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.till-inv-bar input[type=search] { flex: 1 1 220px; min-width: 0; }
.till-inv-bar input[type=date] { flex: 0 0 170px; }
.till-inv-scope { display: flex; gap: 6px; }
.till-inv-list { min-height: 240px; }

/* ── Tabs (M 2026-11-21): the till's categories and every page's tabs — one white box (its corners rounded as
   the search box's) holding square tabs side by side with no gap, a line between two; the chosen one marked by a line in
   the main colour under it (no fill). Other chips (filters, periods…) stay round. ── */
.cats, .subtabs { gap: 0 !important; padding: 0 !important; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cats { overflow-x: auto; }
.cats > .chip, .subtabs > .chip {
  margin: 0; border: 0; border-inline-end: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink-2, var(--ink));
  padding: 10px 16px; box-shadow: inset 0 -3px 0 transparent; transition: box-shadow .15s, color .15s;
}
.cats > .chip:hover, .subtabs > .chip:hover { color: var(--ink); background: var(--soft, #f5f7fa); }
.cats > .chip.on, .subtabs > .chip.on, .subtabs > .chip.chip-danger.on { background: transparent; color: var(--primary); border-color: var(--line); box-shadow: inset 0 -3px 0 var(--primary); }
.subtabs > .chip.chip-danger { color: var(--danger); }
.subtabs > .chip.chip-danger.on { color: var(--danger); box-shadow: inset 0 -3px 0 var(--danger); }
.cats:empty { display: none; }
/* …or the categories as tiles (the point of sale's look «مربّعات», M 2026-11-25): the till opens on them; inside one, this row
   holds the way back and its name */
.cats.cat-path > .chip.on { cursor: default; }
.cats.cat-path > .cat-back { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 600; }
.grid.cat-grid > .tile.cat-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; text-align: center; }
.cat-tile .cat-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--primary); font-size: 19px; font-weight: 700; line-height: 1; }
.cat-tile .tile-name { width: 100%; text-align: center; font-size: 15px; line-height: 1.3; }
.cat-tile:hover .cat-mark { background: var(--primary); color: #fff; }
.grid.cat-grid.size-l > .tile.cat-tile { gap: 10px; }
.grid.cat-grid.size-l .cat-tile .cat-mark { width: 48px; height: 48px; font-size: 22px; }
.grid.cat-grid.size-s .cat-tile .cat-mark { width: 32px; height: 32px; font-size: 15px; }
@media (max-width: 860px) {
  .grid.cat-grid > .tile.cat-tile { gap: 5px; padding: 6px; }
  .cat-tile .cat-mark { width: 30px; height: 30px; font-size: 14px; }
  .cat-tile .tile-name { font-size: 13px; }
}

/* The free plan's window at its cap (public/free-plan-ui.js): what the store built, one row each. */
.free-wall { display: grid; gap: 12px; }
.free-wall-rows { display: grid; gap: 6px; }
.free-wall-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.free-wall-row strong { white-space: nowrap; }
