/* A3 Wash System â€” automotive "control room": graphite surfaces, restrained metallic gold.
   Layout: fixed RTL sidebar on the start (right) side, compact sticky topbar, fluid content grid.
   Dark is the default; light keeps the graphite sidebar and gold identity. */
/* Dark = the logo's own charcoal grey (its plate measures about #2F3234 lit, #212425 in shadow), with a
   faint grain like the logo's surface on the page and sidebar. */
:root {
  color-scheme: dark;
  --bg: #1F2224;
  --fg: #F4F5F6;
  --surface: #262A2C;
  --sidebar: #191C1D;
  --sidebar-fg: #F4F5F6;
  --sidebar-muted: #A4AAAE;
  --sidebar-line: #2D3133;
  --card: #2A2E30;
  --popover: #313537;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .12 -.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --gold: #D6A93D;
  --gold-2: #B88A2E;
  --gold-text: #D6A93D;
  --gold-ink: #17120A;
  --gold-tint: rgba(214, 169, 61, 0.10);
  --gold-tint-2: rgba(214, 169, 61, 0.18);
  --border: #5B4E34;
  --line: #373B3E;
  --success: #4FAF77;
  --danger: #D66363;
  --warning: #D8A43F;
  --success-tint: rgba(79, 175, 119, 0.14);
  --danger-tint: rgba(214, 99, 99, 0.14);
  --warning-tint: rgba(216, 164, 63, 0.14);
  --muted: #33373A;
  --muted-fg: #A9AEB2;
  --input: #222527;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  --grad: linear-gradient(135deg, #E2B955 0%, #D6A93D 48%, #B07A36 100%);
  /* «الثيم الجديد»: carbon weave, a carbon panel with a soft light from the top, the bevelled gold frame */
  --carbon: linear-gradient(27deg, #17191C 5px, transparent 5px) 0 5px / 20px 20px,
    linear-gradient(207deg, #17191C 5px, transparent 5px) 10px 0 / 20px 20px,
    linear-gradient(27deg, #222529 5px, transparent 5px) 0 10px / 20px 20px,
    linear-gradient(207deg, #222529 5px, transparent 5px) 10px 5px / 20px 20px,
    linear-gradient(90deg, #1C1E21 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#1D2023 25%, #1A1C1F 25%, #1A1C1F 50%, transparent 50%, transparent 75%, #25282C 75%, #25282C) 0 0 / 20px 20px, #131517;
  /* glossy (owner 2026-10-21 «يحتاج لمعة»): a diagonal sheen and a lacquer reflection on the top half */
  --gloss: linear-gradient(118deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.025) 26%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 48%, transparent 50%);
  --carbon-panel: var(--gloss), linear-gradient(180deg, rgba(14, 15, 17, 0.62), rgba(10, 11, 13, 0.84)), radial-gradient(70% 45% at 50% 0%, rgba(255, 240, 205, 0.09), transparent), var(--carbon);
  --gold-frame: linear-gradient(160deg, #FFF1C2, #E6B54E 18%, #9C6B17 38%, #F7D77E 55%, #B9852A 72%, #FBE4A2 88%, #8E6114);
  --font: 'Cairo', 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 8px;
  --sb-w: 264px;
  --gutter: clamp(16px, 3vw, 28px);
}
:root[data-app-theme="light"] {
  color-scheme: light;
  --bg: #F4F1EB;
  --fg: #1D1A16;
  --surface: #FBFAF7;
  --card: #FFFFFF;
  --popover: #FFFFFF;
  --gold: #D2A238;
  --gold-2: #B88A2E;
  --gold-text: #8A6414;
  --gold-ink: #17120A;
  --gold-tint: rgba(184, 138, 46, 0.10);
  --gold-tint-2: rgba(184, 138, 46, 0.20);
  --border: #D9C89F;
  --line: #ECE5D8;
  --success: #2B7C4E;
  --danger: #B03F3F;
  --warning: #8C620E;
  --success-tint: rgba(43, 124, 78, 0.10);
  --danger-tint: rgba(176, 63, 63, 0.10);
  --warning-tint: rgba(140, 98, 14, 0.12);
  --muted: #F0EBE2;
  --muted-fg: #6B6357;
  --input: #FFFFFF;
  --shadow: 0 12px 32px rgba(60, 45, 20, 0.14);
  --grain: none;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--grain) var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
a { color: var(--gold-text); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num, .money, .kpi-value, td.n, .calc { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-fg); }
.neg { color: var(--danger); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
.inline-ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--muted-fg); }
.money { white-space: nowrap; }
.money .cur { font-size: 0.78em; color: var(--muted-fg); font-weight: 500; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.noscript { padding: 24px; text-align: center; }

.boot { min-height: 100vh; display: grid; place-items: center; padding-inline: 16px; }
.boot-inner { display: grid; justify-items: center; gap: 20px; color: var(--muted-fg); }
.boot-text { display: flex; align-items: center; gap: 10px; }
.boot-car { width: min(240px, 60vw); height: auto; animation: boot-glow 1.8s ease-in-out infinite; }
@keyframes boot-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loadbar { position: fixed; inset-inline: 0; top: 0; height: 2px; z-index: 100; background: var(--grad); transform-origin: right; transform: scaleX(0); opacity: 0; transition: transform 0.6s ease, opacity 0.3s; }
.loadbar.is-on { transform: scaleX(0.7); opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: var(--gold-ink); border-color: rgba(255, 220, 140, 0.25); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-ghost { border-color: var(--border); color: var(--fg); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--gold-tint); border-color: var(--gold-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn-google { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn-google:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-tint); }
.g-logo { width: 18px; height: 18px; flex: none; }
.btn-lg { min-height: 48px; font-size: 15px; padding-inline: 20px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 12.5px; gap: 4px; }
.btn-xs .ic { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn.is-busy { cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted-fg);
}
.icon-btn:hover { background: var(--gold-tint); color: var(--fg); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-tint); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-text); font-weight: 600; cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Form controls ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--muted-fg); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--border); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint-2); }
input:disabled, select:disabled { opacity: 0.7; cursor: not-allowed; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
input[dir=ltr] { text-align: left; }
input[type=number]::-webkit-inner-spin-button { opacity: 0.4; }
.code-input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.field-err { color: var(--danger); font-size: 12.5px; font-weight: 600; }
.hint { color: var(--muted-fg); font-size: 12.5px; }
.form-note { font-size: 13px; color: var(--muted-fg); background: var(--muted); border-radius: var(--r-sm); padding: 8px 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; min-height: 42px; align-self: end; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit > span { position: absolute; inset-inline-end: 12px; color: var(--muted-fg); font-size: 13px; pointer-events: none; }
/* The unit sits where the (left-to-right) number is typed, so it hides while typing or filled. */
.input-unit:focus-within > span, .input-unit input:not(:placeholder-shown) + span { visibility: hidden; }
.inline-field { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted-fg); font-size: 13px; }
.inline-field input { width: auto; min-width: 160px; }

/* Segmented controls */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--muted); border-radius: var(--r); border: 1px solid var(--line); }
.seg > button, .seg > label > span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 4px 12px;
  border-radius: 7px; border: 1px solid transparent; background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted-fg);
}
.seg > label { display: contents; }
.seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.seg > button.is-active, .seg > label > input:checked + span { background: var(--card); color: var(--gold-text); border-color: var(--border); }
.seg > label > input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }
.seg-sm > button { min-height: 30px; padding: 2px 10px; font-size: 12.5px; }
.seg-tabs { display: flex; margin-bottom: 16px; }
.seg-tabs > button { flex: 1; }

/* ---------- Badges, alerts, toasts ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge-success { color: var(--success); background: var(--success-tint); }
.badge-danger { color: var(--danger); background: var(--danger-tint); }
.badge-warning { color: var(--warning); background: var(--warning-tint); }
.badge-gold { color: var(--gold-text); background: var(--gold-tint); border-color: var(--gold-tint-2); }
.badge-muted { color: var(--muted-fg); background: var(--muted); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid; margin-bottom: 14px; }
.alert .ic { margin-top: 3px; }
.alert strong { display: block; font-size: 14px; }
.alert p { font-size: 13.5px; color: var(--fg); opacity: 0.9; }
.alert-danger { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.alert-warning { border-color: var(--warning); background: var(--warning-tint); color: var(--warning); }
.alert-success { border-color: var(--success); background: var(--success-tint); color: var(--success); }
.alert-info { border-color: var(--border); background: var(--gold-tint); color: var(--gold-text); }

.toasts { position: fixed; z-index: 200; inset-inline: 0; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 10px 16px; border-radius: var(--r);
  background: var(--popover); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
  animation: toast-in 0.2s ease-out; pointer-events: auto;
}
.toast-success .ic { color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-error .ic { color: var(--danger); }
.toast-info .ic { color: var(--gold-text); }
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Modals ---------- */
.modal { padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--popover); color: var(--fg); box-shadow: var(--shadow); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
.modal-sm { width: min(440px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(8, 7, 5, 0.66); backdrop-filter: blur(2px); }
.modal-box { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px 20px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-msg { font-size: 15px; }
.preview-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warning-tint); color: var(--warning); border: 1px solid var(--warning); }
.preview-note .ic { margin-top: 2px; }
.preview-note span { color: var(--fg); }
.gis-host { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 56px; color: var(--muted-fg); }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; text-align: start; }
.choice:hover { border-color: var(--gold); }
.code-reveal { padding: 18px; border-radius: var(--r); border: 1px dashed var(--gold-2); background: var(--gold-tint); text-align: center; }
.qr-out { display: grid; gap: 10px; }
.qr-card { display: block; width: 100%; max-width: 300px; margin: 0 auto; border-radius: var(--r); box-shadow: 0 6px 24px rgb(0 0 0 / 0.25); }
.code-reveal code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: clamp(18px, 5vw, 24px); font-weight: 700; letter-spacing: 0.08em; color: var(--gold-text); user-select: all; word-break: break-all; }
.stock-now { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; background: var(--muted); border-radius: var(--r-sm); }
.stock-now span { color: var(--muted-fg); font-size: 13px; }
.stock-now strong { font-size: 22px; }

/* ---------- Auth screens ---------- */
/* Sign-in = «الثيم الجديد» carbon studio (approved mockup marketing/mockups/login-studio.html): carbon weave
   with gold light trails behind, the studio plate, signed stamp, car on a lit floor, gold-framed card.
   Always dark, whatever the in-app theme, so it carries its own colour tokens. */
.auth {
  --fg: #ECEDEF; --muted-fg: #9EA2A9; --card: #16181B; --surface: #121417; --input: #0E0F11; --line: rgba(255, 255, 255, 0.09);
  --border: rgba(240, 196, 92, 0.35); --gold: #E6B54E; --gold-text: #F0C45C; --gold-tint: rgba(240, 196, 92, 0.10); --gold-tint-2: rgba(240, 196, 92, 0.20);
  color-scheme: dark; position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #0B0C0E; color: var(--fg);
}
.auth-bg { position: absolute; inset: 0; z-index: -1; background: url(../assets/studio/bg-wide.webp) center / cover no-repeat; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 60px clamp(24px, 5vw, 90px); }
.auth-stamp { position: absolute; top: 36px; inset-inline-start: clamp(24px, 6vw, 110px); width: clamp(150px, 15vw, 230px); height: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.auth-car { width: min(560px, 100%); height: auto; align-self: center; margin-top: 110px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.7)); -webkit-box-reflect: below 2px linear-gradient(transparent 50%, rgba(0, 0, 0, 0.26)); pointer-events: none; }
.auth-floor { height: 1.5px; margin: 4px 0 34px; background: linear-gradient(90deg, transparent, rgba(255, 236, 190, 0.55) 50%, transparent); }
.auth-app { width: min(420px, 80%); height: auto; align-self: center; margin-bottom: 6px; filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 16px rgba(0, 0, 0, 0.85)); }
.auth-title { font-size: clamp(24px, 2.3vw, 32px); font-weight: 900; line-height: 1.4; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.9)); }
.auth-title .silver, .auth-title .gold { -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-title .silver { background-image: linear-gradient(180deg, #FFFFFF 0%, #D9DCE1 45%, #8E939B 70%, #E9EBEE 100%); }
.auth-title .gold { background-image: linear-gradient(180deg, #FFF3C9 0%, #F2CF76 40%, #B98526 72%, #F7DC8C 100%); }
.auth-lead { color: #B9BCC2; font-size: 16px; line-height: 1.8; }
.auth-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: #DADCE0; }
.auth-points .ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; color: #F0C45C; background: rgba(240, 196, 92, 0.08); border: 1px solid rgba(240, 196, 92, 0.35); }
.auth-points-t, .auth-lockup-m { display: none; }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px var(--gutter); }
.auth-main.solo { min-height: 100vh; }
.auth-lockup { width: min(300px, 70%); height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6)); }
.auth-mark { width: 88px; height: 88px; object-fit: contain; }
.auth-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.auth-body { padding: 24px; display: grid; gap: 14px; }
.auth-intro { color: var(--muted-fg); font-size: 14px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab { flex: 1; text-align: center; padding: 14px 8px; font-weight: 700; font-size: 13.5px; color: var(--muted-fg); text-decoration: none; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--gold-text); border-bottom-color: var(--gold); }
/* the gold-framed carbon card and the pill tabs of the sign-in screen */
.auth .auth-card { position: relative; width: min(460px, 100%); border: 0; border-radius: 24px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); background: var(--carbon-panel); }
.auth .auth-card::before, .studio-frame::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 1; background: var(--gold-frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.auth .tabs { gap: 6px; margin: 22px 22px 0; padding: 5px; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 14px; background: rgba(0, 0, 0, 0.45); }
.auth .tab { padding: 9px 4px; border: 0; border-radius: 10px; font-size: 14px; color: #9EA2A9; white-space: nowrap; }
.auth .tab.is-active { color: #1A1407; background: linear-gradient(180deg, #F7D77E, #E0AC45); box-shadow: 0 4px 12px rgba(240, 196, 92, 0.25); }
.auth .auth-body { padding: 20px 26px 26px; }
.auth .auth-intro { font-size: 15px; line-height: 1.85; color: #D4D6DA; }
.auth .btn-google { min-height: 54px; border: 0; border-radius: 14px; background: #fff; color: #1F1F1F; font-size: 16px; font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.auth .btn-google:hover:not(:disabled) { background: #F4F4F4; }
.auth .g-logo { width: 22px; height: 22px; }
.auth .fine { text-align: start; color: #8D9198; line-height: 1.8; }
.auth .auth-support { padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(240, 196, 92, 0.4); background: rgba(240, 196, 92, 0.06); font-weight: 700; }
.auth .auth-support:hover { text-decoration: none; background: rgba(240, 196, 92, 0.12); }
.auth .auth-legal { gap: 22px; font-size: 13px; }
.tab-long { display: inline; }
.fine { font-size: 12.5px; color: var(--muted-fg); text-align: center; }
.dev-flag { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--warning); }
.dev-flag.is-error { color: var(--danger); }
.auth-platform { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); font-size: 13px; text-decoration: none; }
.auth-platform:hover { color: var(--gold-text); }
.auth-support { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-text); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-support:hover { text-decoration: underline; }
.auth-legal { display: flex; gap: 16px; font-size: 12.5px; }
.auth-legal a { color: var(--muted-fg); text-decoration: none; }
.auth-legal a:hover { color: var(--gold-text); text-decoration: underline; }
.solo-head { display: flex; align-items: center; gap: 14px; }
.solo-head h1 { font-size: 22px; }
.solo-mark { width: 56px; height: 56px; object-fit: contain; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--muted-fg); letter-spacing: 0.02em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--grain) var(--sidebar); color: var(--sidebar-fg); border-inline-end: 1px solid var(--border);
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px));
}
.sb-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 10px; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-brand.has-lockup { flex: 1; flex-direction: column; gap: 4px; padding: 4px 0 6px; }
.sb-lockup { display: block; width: 100%; max-width: 216px; height: auto; }
.sb-caption { font-size: 10.5px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase; color: var(--sidebar-muted); padding-inline-start: 0.34em; }
.sb-mark { width: 34px; height: 34px; object-fit: contain; flex: none; }
.sb-app { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: var(--sidebar-fg); }
.sb-close { display: none; color: var(--sidebar-muted); }
.sb-brand.has-lockup + .sb-close { position: absolute; top: -6px; inset-inline-end: -8px; }
.tb-mark-m { display: none; width: 32px; height: 32px; object-fit: contain; flex: none; }
.sb-biz { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 6px; border: 1px solid var(--sidebar-line); border-radius: var(--r); background: rgba(255, 255, 255, 0.02); }
.biz-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; flex: none; }
img.biz-logo { box-shadow: 0 0 0 1.5px var(--gold-2); }
.biz-initial { display: grid; place-items: center; background: rgba(214, 169, 61, 0.14); color: #D6A93D; font-weight: 800; font-size: 18px; }
.sb-biz-text { display: grid; min-width: 0; }
.sb-biz-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-biz-text small { color: var(--sidebar-muted); font-size: 12px; }
.sb-nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--sidebar-muted); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.nav-item:hover { color: var(--sidebar-fg); background: rgba(255, 255, 255, 0.04); }
.nav-item.is-active { color: #D6A93D; background: rgba(214, 169, 61, 0.10); border-color: rgba(214, 169, 61, 0.28); }
.sb-foot { margin-top: auto; padding-top: 12px; }
.sb-support { margin-bottom: 8px; }
.sub-chip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--sidebar-line); color: var(--sidebar-muted); }
.sub-chip .ic { color: #D6A93D; margin-top: 3px; }
.sub-chip strong { display: block; color: var(--sidebar-fg); font-size: 13px; }
.sub-chip small { font-size: 12px; }
.sub-chip.is-warning { border-color: rgba(216, 164, 63, 0.5); }
.sub-chip.is-warning .ic { color: #D8A43F; }
.sub-chip.is-danger { border-color: rgba(214, 99, 99, 0.55); }
.sub-chip.is-danger .ic { color: #D66363; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-toggle { display: none; }
.tb-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; flex-wrap: wrap; row-gap: 0; }
.tb-title h1 { font-size: 19px; font-weight: 800; }
.tb-title > div { display: grid; }
.tb-date { color: var(--muted-fg); font-size: 12.5px; }
.tb-hijri { display: inline-block; unicode-bidi: isolate; margin-inline-start: 8px; padding-inline-start: 8px; border-inline-start: 1px solid var(--border); }
.tb-mark { width: 36px; height: 36px; object-fit: contain; }
.tb-end { display: flex; align-items: center; gap: 6px; }
.tb-user { display: flex; align-items: center; gap: 10px; padding-inline: 8px 4px; }
.tb-user > div { display: grid; line-height: 1.25; }
.tb-user strong { font-size: 13.5px; }
.tb-user small { font-size: 12px; color: var(--gold-text); font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-tint); color: var(--gold-text); font-weight: 800; border: 1px solid var(--gold-tint-2); }

.banner { display: flex; align-items: center; gap: 12px; margin: 14px var(--gutter) 0; padding: 10px 14px; border-radius: var(--r); border: 1px solid; flex-wrap: wrap; }
.banner p { flex: 1; min-width: 220px; font-size: 14px; color: var(--fg); }
.banner-danger { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.banner-warning { border-color: var(--warning); background: var(--warning-tint); color: var(--warning); }
.banner-gold { border-color: var(--gold); background: var(--gold-tint); color: var(--gold); }
.banner-success { border-color: var(--success); background: var(--success-tint); color: var(--success); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-list { display: grid; gap: 10px; }
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.plan-row.is-current { border-color: var(--gold); background: var(--gold-tint); }
.plan-row strong { display: block; }
.plan-row small { color: var(--muted-fg); font-size: 12px; }
.plan-info { flex: 1; min-width: 0; }
.plan-hint { font-size: 13.5px; font-weight: 600; }
.plan-err { text-align: center; }
button.plan-row { width: 100%; font: inherit; color: inherit; background: none; text-align: start; cursor: pointer; }
button.plan-row:hover { border-color: var(--gold-tint-2); }
.plan-row.is-selected { border-color: var(--gold); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }
.plan-check { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border); color: var(--gold-ink); }
.plan-check .ic { width: 14px; height: 14px; visibility: hidden; }
.is-selected .plan-check { background: var(--gold); border-color: var(--gold); }
.is-selected .plan-check .ic { visibility: visible; }
.plan-price { text-align: end; white-space: nowrap; }
.plan-price b { font-size: 18px; }
.store-log summary { cursor: pointer; color: var(--muted-fg); font-size: 13px; }
.store-log ul { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted-fg); }
.add-branch .panel-body { display: grid; gap: 12px; }
.add-branch-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.add-branch-price b { font-size: 20px; }
.add-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; }

.page { padding: 20px var(--gutter) 40px; outline: none; }
.page-inner { display: grid; gap: 18px; max-width: 1320px; margin-inline: auto; }
.platform .page-inner, .platform .page { display: grid; gap: 18px; }
.platform .page { max-width: 1320px; width: 100%; margin-inline: auto; }

.fab { display: none; }

/* ---------- Content blocks ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-end { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 15.5px; font-weight: 700; }
.panel-extra { display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 16px 18px; }
.panel-body.center { display: grid; justify-items: center; gap: 10px; }
.panel-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 18px; color: var(--muted-fg); font-size: 13px; border-top: 1px solid var(--line); }
.panel-body > .panel-note { border-top: 0; padding: 12px 0 0; }
.panel-note .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--gold-text); }
.panel-empty { padding: 18px; color: var(--muted-fg); font-size: 14px; }
.panel-note.bare { border-top: 0; padding: 0 4px; }
.panel-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px; color: var(--muted-fg); }
.panel-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.seg > button .ic { width: 16px; height: 16px; margin-inline-end: 6px; }
.log-table td:last-child { white-space: normal; min-width: 260px; }
.log-table td:nth-child(-n+3), .trash-table td:nth-child(-n+2), .trash-table td:nth-child(4), .trash-table td:nth-child(5) { white-space: nowrap; }
.log-text { line-height: 1.7; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-side.wide { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
.side-stack { display: grid; gap: 18px; align-content: start; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.kpi-ic { color: var(--gold-text); opacity: 0.8; }
.kpi-value { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.kpi-value .cur { font-size: 13px; }
.kpi-sub { font-size: 12.5px; color: var(--muted-fg); }
.kpi-success .kpi-value { color: var(--success); }
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-warning .kpi-value { color: var(--warning); }

.sum-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.sum-strip > div { padding: 12px 18px; display: grid; gap: 2px; min-width: 0; }
.sum-strip > div + div { border-inline-start: 1px solid var(--line); }
.sum-strip span { font-size: 12.5px; color: var(--muted-fg); font-weight: 600; }
.sum-strip strong { font-size: 18px; font-weight: 800; }
.sum-strip.boxed { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; }
.empty-ic { width: 34px; height: 34px; color: var(--gold-text); opacity: 0.8; margin-bottom: 4px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted-fg); font-size: 14px; max-width: 44ch; }
.empty .btn { margin-top: 8px; }

/* Setup steps */
.steps { list-style: none; margin: 0; padding: 6px 18px 14px; display: grid; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li > div { flex: 1; min-width: 0; }
.steps strong { font-size: 14.5px; }
.steps p { color: var(--muted-fg); font-size: 13px; }
.step-mark { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; flex: none; counter-increment: step; }
.steps { counter-reset: step; }
.step-mark:empty::before { content: counter(step); font-size: 12.5px; font-weight: 800; color: var(--gold-text); }
.steps li.is-done .step-mark { background: var(--success); border-color: var(--success); color: #fff; }
.steps li.is-done .step-mark .ic { width: 14px; height: 14px; }
.steps li.is-done strong { color: var(--muted-fg); text-decoration: line-through; text-decoration-color: var(--line); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; font-weight: 700; color: var(--muted-fg); padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--gold) 4%, transparent); }
.tbl .n { text-align: end; white-space: nowrap; }
.tbl .act { text-align: end; white-space: nowrap; width: 1%; }
/* Stopped rows (paused service, disabled account, inactive employee): light red over the whole row. */
.tbl tr.is-stopped { background: var(--danger-tint); outline: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); outline-offset: -1px; }
.tbl tr.is-cancelled .amt { text-decoration: line-through; color: var(--muted-fg); }
.tbl.compact td, .tbl.compact th { padding: 9px 16px; }
.tbl tr.subtotal td { background: var(--surface); }
.row-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.qty { font-weight: 800; font-size: 15px; }
.tbl tr.flash td { animation: flash 1.8s ease-out; }
.tbl tr.flash .qty { color: var(--gold-text); }
@keyframes flash { 0%, 35% { background: var(--gold-tint-2); } 100% { background: transparent; } }

.statement { width: 100%; border-collapse: collapse; }
.statement th, .statement td { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.statement th { text-align: start; font-weight: 600; }
.statement th small { display: block; font-weight: 400; font-size: 12px; color: var(--muted-fg); }
.statement td { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement tr.minus th { color: var(--muted-fg); font-weight: 500; }
.statement tr.subtotal th, .statement tr.subtotal td { font-weight: 700; border-bottom-style: solid; }
.statement tr.total th, .statement tr.total td { font-size: 17px; font-weight: 800; border-bottom: 0; padding-top: 14px; color: var(--gold-text); }
.statement tr.total.neg th, .statement tr.total.neg td { color: var(--danger); }

/* ---------- Charts ---------- */
.chart7 { position: relative; padding-top: 18px; container-type: inline-size; }
/* Narrow chart (phone, or beside the sidebar): day numbers instead of weekday names. */
@container (max-width: 560px) {
  .c7-xl .wd, .c7-xl .dm { display: none; }
  .c7-xl .dn { display: block; font-size: 12px; }
}
.c7-plot { position: relative; height: 200px; margin-inline-start: 56px; }
.c7-line { position: absolute; inset-inline: 0; height: 0; border-top: 1px dashed var(--line); }
.c7-line.is-base { border-top: 1px solid var(--border); }
.c7-ax { position: absolute; inset-inline-start: -56px; width: 48px; transform: translateY(-50%); text-align: end; font-size: 11.5px; color: var(--muted-fg); }
.c7-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.c7-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 6px; }
.c7-col:focus-visible { outline-offset: -2px; }
.c7-bar { width: min(44px, 58%); border-radius: 4px 4px 0 0; background: var(--gold-2); transition: filter 0.15s; }
.c7-col.is-today .c7-bar { background: var(--grad); }
.c7-col:hover .c7-bar, .c7-col:focus-visible .c7-bar { filter: brightness(1.18); }
.c7-bar.is-zero { height: 2px !important; background: var(--line); border-radius: 1px; }
.c7-val { font-size: 11.5px; font-weight: 700; color: var(--fg); }
.c7-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-fg); font-size: 14px; }
.c7-x { display: flex; margin-inline-start: 56px; margin-top: 8px; }
.c7-xl { flex: 1; min-width: 0; display: grid; justify-items: center; text-align: center; line-height: 1.3; }
.c7-xl b { font-size: 12px; font-weight: 600; color: var(--muted-fg); }
.c7-xl small { font-size: 11px; color: var(--muted-fg); }
.c7-xl.is-today b, .c7-xl.is-today .dn { color: var(--gold-text); font-weight: 800; }
.c7-xl .dn { display: none; }
.c7-tip { position: absolute; z-index: 5; display: grid; gap: 2px; min-width: 150px; padding: 8px 12px; background: var(--popover); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; }
.c7-tip b { font-size: 12.5px; }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rank-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rank-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rank-val { color: var(--muted-fg); white-space: nowrap; font-size: 13px; }
.rank-bar { height: 8px; border-radius: 4px; background: var(--muted); margin-top: 6px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 4px; background: var(--gold-2); }
.rank li:first-child .rank-bar span { background: var(--grad); }
.rank-sub { font-size: 12.5px; color: var(--muted-fg); margin-top: 2px; }

.gauge { width: min(300px, 100%); height: auto; }
.g-track { fill: none; stroke: var(--muted); stroke-width: 16; stroke-linecap: round; }
.g-fill { fill: none; stroke: var(--gold); stroke-width: 16; stroke-linecap: round; }
.g-fill.is-done { stroke: var(--success); }
.g-tick { stroke: var(--border); stroke-width: 2; }
.g-pct { fill: var(--fg); font-size: 34px; font-weight: 800; font-family: var(--font); }
.g-sub { fill: var(--muted-fg); font-size: 13px; font-weight: 600; font-family: var(--font); }
.gauge-note { text-align: center; color: var(--muted-fg); font-size: 14px; max-width: 40ch; }

.formula { margin: 0; padding-inline-start: 22px; display: grid; gap: 16px; }
.formula li { padding-inline-start: 4px; }
.formula li::marker { color: var(--gold-text); font-weight: 800; }
.formula .calc { margin-top: 6px; padding: 8px 12px; background: var(--muted); border-radius: var(--r-sm); font-size: 14px; direction: rtl; }
.formula .calc b { color: var(--gold-text); }

/* ---------- Sales ---------- */
.sales-layout { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.sales-layout.no-form { grid-template-columns: minmax(0, 1fr); }
.sale-panel { position: sticky; top: 76px; }
.sale-form { display: grid; gap: 18px; }
.fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.fs legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.svc-opt { position: relative; display: grid; gap: 2px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-height: 64px; align-content: center; }
.svc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.svc-opt:hover { border-color: var(--border); }
.svc-opt:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }
.svc-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.svc-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.svc-price { font-size: 13px; color: var(--muted-fg); }
.svc-opt:has(input:checked) .svc-price { color: var(--gold-text); }
.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper input { text-align: center !important; font-size: 20px; font-weight: 800; min-height: 50px !important; }
.step-btn { width: 54px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--gold-text); }
.step-btn:hover { background: var(--gold-tint); }
.seg-pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.seg-pay > label > span { min-height: 42px; }
.sale-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border); background: linear-gradient(180deg, var(--gold-tint), transparent); }
.sale-total span { font-weight: 700; color: var(--muted-fg); }
.sale-total strong { font-size: 28px; font-weight: 800; color: var(--gold-text); }

/* ---------- Settings / subscription ---------- */
.logo-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
/* business logos are round (owner 2026-10-21): cropped into a circle on upload, shown in a circle everywhere */
.logo-preview { width: 112px; height: 112px; border-radius: 50%; border: 1px dashed var(--border); display: grid; place-items: center; text-align: center; font-size: 12px; background: var(--surface); overflow: hidden; }
.logo-preview:has(img) { border: 2px solid var(--gold); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.crop-stage { --crop-bg: #ffffff; position: relative; width: min(340px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: var(--r); background: repeating-conic-gradient(#2A2D31 0 25%, #1E2023 0 50%) 0 0 / 18px 18px; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: var(--crop-bg); }
.crop-img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; pointer-events: none; }
/* everything outside the circle is dimmed; a gold ring marks what will be kept */
.crop-ring { position: absolute; inset: 14px; border-radius: 50%; box-shadow: 0 0 0 999px rgba(8, 9, 10, 0.68); outline: 2px solid var(--gold); pointer-events: none; }
.crop-zoom { direction: ltr; display: flex; align-items: center; gap: 8px; width: min(340px, 100%); margin: 0 auto; }
.crop-range { flex: 1; accent-color: var(--gold); min-height: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
.crop-bg { display: grid; justify-items: center; gap: 6px; }
.logo-actions { display: grid; gap: 8px; justify-items: start; }
.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted-fg); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 700; text-align: end; }
.sub-hero { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-hero > div { display: grid; }
.sub-hero strong { font-size: 30px; font-weight: 800; color: var(--gold-text); line-height: 1.2; }
.meter { height: 10px; border-radius: 5px; background: var(--muted); overflow: hidden; margin-bottom: 10px; }
.meter span { display: block; height: 100%; border-radius: 5px; background: var(--grad); }
.roles { margin: 0; padding: 6px 18px 14px; display: grid; }
.roles > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.roles > div:last-child { border-bottom: 0; }
.roles dt { font-weight: 700; font-size: 14px; color: var(--gold-text); }
.roles dd { margin: 2px 0 0; font-size: 13.5px; color: var(--muted-fg); }

/* ---------- Branches ---------- */
.branch-btn { max-width: 240px; }
.branch-btn .branch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold-tint); color: var(--gold-text); font-size: 12px; font-weight: 700; }
.branch-list { display: grid; gap: 8px; }
.branch-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); text-align: start; font: inherit; cursor: pointer; }
.branch-item:hover:not(.is-current) { border-color: var(--gold); }
.branch-item.is-current { border-color: var(--gold); background: var(--gold-tint); cursor: default; }
.branch-item:disabled { opacity: 0.6; cursor: progress; }
.branch-item .biz-logo { width: 36px; height: 36px; flex: none; }
.branch-text { flex: 1; min-width: 0; display: grid; }
.branch-text small { color: var(--muted-fg); font-size: 12.5px; }
.company-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.company-title { display: grid; gap: 2px; min-width: 0; }
.company-title h2 { font-size: 22px; overflow-wrap: anywhere; }
.company-hint { margin: 0; padding: 0; }
.branch-checks { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
.branch-checks legend { padding: 0 6px; }
.branch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.branch-head h2 { font-size: 20px; }
.delta { font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.delta.is-up { color: var(--success); }
.delta.is-down { color: var(--danger); }
.rank-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--muted); font-weight: 700; }
tr.is-link { cursor: pointer; }
tr.is-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.cmp { display: grid; gap: 14px; }
.cmp-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted-fg); }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-rev, .cmp-bar.rev { background: var(--gold); }
.sw-net, .cmp-bar.net { background: var(--success); }
.cmp-bar.is-neg { background: var(--danger); }
.cmp-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr); gap: 12px; align-items: center; }
.cmp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-bars { display: grid; gap: 4px; min-width: 0; }
.cmp-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-bar { height: 12px; border-radius: 3px; flex: none; max-width: calc(100% - 70px); }
.cmp-val { font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; }
.cmp-val.neg { color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .sales-layout { grid-template-columns: minmax(0, 1fr); }
  .sale-panel { position: static; }
  .sale-panel .sale-form { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; column-gap: 24px; }
  .sale-panel .sale-form > .fs:first-child { grid-row: span 4; }
}
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side, .grid-side.wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sale-panel .sale-form { grid-template-columns: minmax(0, 1fr); }
  .sale-panel .sale-form > .fs:first-child { grid-row: auto; }
}
@media (max-width: 1099px) {
  .auth { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .auth-bg { background-image: url(../assets/studio/bg-tall.webp); background-position: center 18%; }
  .auth-brand { padding: 26px 20px 0; align-items: center; text-align: center; gap: 6px; }
  .auth-lockup-m { display: block; width: min(320px, 52%); height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
  .auth-stamp { width: clamp(84px, 16vw, 150px); top: clamp(70px, 11vw, 120px); inset-inline-start: auto; inset-inline-end: 12px; }
  .auth-car { width: min(520px, 84%); margin-top: clamp(64px, 13vw, 120px); }
  .auth-floor { width: 100%; margin: 2px 0 24px; }
  .auth-app { width: min(340px, 70%); }
  .auth-title { font-size: clamp(20px, 3.6vw, 30px); }
  .auth-brand .auth-lead, .auth-brand .auth-points, .auth-main .auth-lockup { display: none; }
  .auth-main { padding: 20px 16px 36px; justify-content: flex-start; }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .auth .auth-card { width: min(560px, 100%); }
  .auth-points-t { display: grid; width: min(560px, 100%); margin-top: 4px; }
}
@media (max-width: 699px) {
  .auth .tabs { margin: 16px 14px 0; }
  .auth .tab { font-size: 13px; padding: 8px 2px; }
  .tab-long { display: none; }
  .auth .auth-body { padding: 16px 16px 20px; }
  .auth .auth-intro { font-size: 14px; }
  .auth .btn-google { min-height: 50px; font-size: 15px; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: min(300px, 86vw);
    transform: translateX(100%); transition: transform 0.22s ease; box-shadow: var(--shadow);
  }
  .shell.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 7, 5, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .sb-close, .nav-toggle { display: inline-grid; }
  .tb-mark-m { display: block; }
  .sb-lockup { max-width: 190px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tb-user > div { display: none; }
  .fab {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 30;
    inset-inline-start: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    min-height: 52px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 220, 140, 0.3);
    background: var(--grad); color: var(--gold-ink); font-weight: 800; font-size: 15px; box-shadow: var(--shadow); cursor: pointer;
  }
  .shell.on-sales .fab { display: none; }
  .page { padding-bottom: 96px; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .kpis, .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .tb-date { display: none; }
  .tb-title h1 { font-size: 17px; }
  .sum-strip > div { padding: 10px 12px; }
  .sum-strip strong { font-size: 15px; }
  .toolbar-end, .toolbar-end .btn { width: 100%; }
  .inline-field { width: 100%; }
  .inline-field input { flex: 1; min-width: 0; }
  .panel-head { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  /* Tables become stacked cards */
  .tbl.rt thead { display: none; }
  .tbl.rt, .tbl.rt tbody, .tbl.rt tr, .tbl.rt td { display: block; width: 100%; }
  .tbl.rt tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl.rt tbody tr:last-child { border-bottom: 0; }
  .tbl.rt td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: end; }
  .tbl.rt td::before { content: attr(data-label); color: var(--muted-fg); font-size: 12.5px; font-weight: 600; text-align: start; flex: none; }
  .tbl.rt td.act { width: 100%; padding-top: 8px; }
  .tbl.rt td.act::before { content: none; }
  .tbl.rt td.act .row-actions { width: 100%; justify-content: flex-start; }
  .tbl.rt tbody tr:hover td { background: none; }
  .c7-xl .wd, .c7-xl .dm { display: none; }
  .c7-xl .dn { display: block; font-size: 12px; }
  .c7-plot { margin-inline-start: 44px; height: 170px; }
  .c7-x { margin-inline-start: 44px; }
  .c7-ax { inset-inline-start: -44px; width: 38px; font-size: 10.5px; }
  .c7-val { font-size: 10.5px; }
  .tabs .tab { font-size: 12.5px; padding: 12px 4px; }
  .auth-body { padding: 18px; }
  .branch-btn .branch-name { display: none; }
  .tb-title h1 { line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* phone top bar: room for the page title next to the branch, theme and sign-out buttons */
  .topbar { gap: 8px; }
  .tb-end { gap: 2px; }
  .tb-user { display: none; }
  .tb-title { flex-wrap: nowrap; }
  .cmp-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
/* ---------- «الثيم الجديد» inside the app (dark mode, the default) ----------
   Carbon studio from marketing/mockups/theme-compare.html (theme A, approved 2026-10-21): the studio
   picture behind everything, carbon panels with a soft light from the top, gold hairlines, gold pills. */
:root[data-app-theme="dark"] {
  --bg: #0B0C0E;
  --surface: #121417;
  --sidebar: #0E0F11;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --card: #16181B;
  --popover: #1A1C1F;
  --gold: #E6B54E;
  --gold-2: #B9852A;
  --gold-text: #F0C45C;
  --gold-ink: #1A1407;
  --gold-tint: rgba(240, 196, 92, 0.10);
  --gold-tint-2: rgba(240, 196, 92, 0.20);
  --border: rgba(240, 196, 92, 0.32);
  --line: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.05);
  --muted-fg: #A3A8AE;
  --input: #0E0F11;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
  --grad: linear-gradient(180deg, #F7D77E, #E0AC45);
  background: #0B0C0E;
}
[data-app-theme="dark"] body { background: transparent; }
[data-app-theme="dark"] body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.6;
  background: url(../assets/studio/bg-wide.webp) center / cover no-repeat, #0B0C0E;
}
@media (max-width: 1099px) { [data-app-theme="dark"] body::before { background-image: url(../assets/studio/bg-tall.webp); background-position: center 20%; } }
[data-app-theme="dark"] :is(.panel, .kpi, .sum-strip.boxed, .modal, .auth-card) {
  background: var(--carbon-panel); border-color: rgba(255, 255, 255, 0.09); border-top-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 34px rgba(0, 0, 0, 0.45);
}
/* a slow light sweep across the gold controls */
@keyframes gold-sweep { 0%, 72% { transform: translateX(-140%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
[data-app-theme="dark"] :is(.btn-primary, .nav-item.is-active), .auth .tab.is-active { position: relative; overflow: hidden; }
[data-app-theme="dark"] .fab { overflow: hidden; } /* already position: fixed, which holds the sweep */
[data-app-theme="dark"] :is(.btn-primary, .fab, .nav-item.is-active)::after, .auth .tab.is-active::after {
  content: '; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: gold-sweep 5.5s ease-in-out infinite;
}
[data-app-theme="dark"] :is(.btn-primary, .fab), .auth .tab.is-active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 14px rgba(240, 196, 92, 0.28); }
[data-app-theme="dark"] .sidebar .sb-biz, [data-app-theme="dark"] .sub-chip { background: var(--gloss), rgba(0, 0, 0, 0.3); }
[data-app-theme="dark"] .modal { border-color: var(--border); }
[data-app-theme="dark"] .auth-main.solo .auth-card { position: relative; border: 0; border-radius: 24px; }
[data-app-theme="dark"] .auth-main.solo .auth-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 1; background: var(--gold-frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
[data-app-theme="dark"] .kpi { position: relative; isolation: isolate; }
[data-app-theme="dark"] .kpi::before { content: ''; position: absolute; inset-inline: 18px; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #E6B54E, transparent); opacity: 0.8; }
[data-app-theme="dark"] .kpi-ic { color: var(--gold-text); opacity: 1; }
[data-app-theme="dark"] .tbl th, [data-app-theme="dark"] .tbl tr.subtotal td { background: rgba(0, 0, 0, 0.3); }
[data-app-theme="dark"] .tbl td { border-bottom-color: rgba(255, 255, 255, 0.05); }
/* sidebar: darker carbon with a gold light along its edge */
[data-app-theme="dark"] .sidebar {
  background: linear-gradient(180deg, rgba(10, 11, 13, 0.55), rgba(8, 9, 10, 0.8)), radial-gradient(90% 30% at 50% 0%, rgba(255, 240, 205, 0.07), transparent), var(--carbon);
  border-inline-end: 1px solid transparent; border-image: linear-gradient(180deg, transparent, #B9852A 30%, #F7D77E 50%, #B9852A 70%, transparent) 1;
}
[data-app-theme="dark"] .sb-biz, [data-app-theme="dark"] .sub-chip { background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.08); }
[data-app-theme="dark"] .sb-lockup { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
[data-app-theme="dark"] .biz-initial, [data-app-theme="dark"] .avatar { color: #F0C45C; background: rgba(240, 196, 92, 0.12); border: 1px solid rgba(240, 196, 92, 0.3); }
[data-app-theme="dark"] .nav-item.is-active { color: #1A1407; font-weight: 800; background: linear-gradient(180deg, #F7D77E, #E0AC45); border-color: transparent; box-shadow: 0 4px 12px rgba(240, 196, 92, 0.25); }
[data-app-theme="dark"] .topbar { background: rgba(11, 12, 14, 0.72); border-bottom-color: rgba(240, 196, 92, 0.18); }
.tb-mark-m, .tb-mark { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
[data-app-theme="dark"] .btn-primary, [data-app-theme="dark"] .fab { border-color: transparent; box-shadow: 0 4px 12px rgba(240, 196, 92, 0.25); }
[data-app-theme="dark"] .seg { background: rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.06); }
[data-app-theme="dark"] .seg > button.is-active, [data-app-theme="dark"] .seg > label > input:checked + span { color: #1A1407; background: linear-gradient(180deg, #F7D77E, #E0AC45); border-color: transparent; }
[data-app-theme="dark"] .svc-opt { background: rgba(0, 0, 0, 0.3); }
/* charts: gold bars, today brightest with a glow */
[data-app-theme="dark"] .c7-bar, [data-app-theme="dark"] .rank-bar span { background: linear-gradient(180deg, #B9852A, #7A5717); }
[data-app-theme="dark"] .rank-bar span { background: linear-gradient(90deg, #E0AC45, #9C6B17); }
[data-app-theme="dark"] .c7-col.is-today .c7-bar, [data-app-theme="dark"] .rank li:first-child .rank-bar span { background: linear-gradient(180deg, #FBE4A2, #E0AC45 50%, #9C6B17); box-shadow: 0 0 18px rgba(240, 196, 92, 0.35); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
