/* ==========================================================================
   Dashboard design system (v0.23)
   1. fonts   2. tokens   3. base   4. controls   5. shell   6. components   7. pages   8. print
   A business's accent colour (and neutrals tinted to it) are injected over these defaults by public/shared/brand.js.
   ========================================================================== */

/* ---------- 1. fonts: IBM Plex Sans Arabic, self-hosted (SIL OFL, see /fonts/OFL.txt) ---------- */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/plex-arabic-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 2. tokens ---------- */
:root {
  /* neutrals: the default (un-branded) palette is warm; a brand colour replaces these with greys tinted to its hue */
  --bg: #FAF8F7; --surface: #FFFFFF; --side: #FDFCFB; --soft: #F5F0F1; --soft-2: #FAF7F7;
  --ink: #261D21; --ink-2: #4A3D43; --muted: #6E6066; --line: #EBE4E6; --line-2: #D9CED2;
  /* accent: derived from one colour by brandTheme() */
  --accent: #7A2E57; --accent-ink: #FFFFFF; --accent-hover: #6B284D; --accent-pressed: #5F2444; --accent-text: #7A2E57;
  --accent-soft: #F4EEF2; --accent-soft-2: #EBE0E6; --accent-line: #D4BCC9; --ring: #7A2E57;
  /* status language: ok = done/confirmed, warn = waiting on someone, bad = lost/cancelled/urgent, info = accent, done = neutral */
  --ok: #17663A; --ok-bg: #E6F4EA; --warn: #7A4B00; --warn-bg: #FDF1D7; --bad: #A32222; --bad-bg: #FCE8E8; --bad-solid: #C62828; --done-bg: var(--soft);
  --ig: #A42D6B; --ig-bg: #FCE8F1;
  /* spacing (4/8), radius, elevation, type */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --radius: var(--r-lg);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 6px 20px -6px rgba(16, 24, 40, .12), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-3: 0 24px 64px -12px rgba(16, 24, 40, .28), 0 2px 6px rgba(16, 24, 40, .08);
  --shadow: var(--shadow-1);
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 26px;
  --h: 36px; --h-sm: 30px; --h-lg: 44px;
  --side-w: 252px; --pad-x: 32px; --pad-y: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151113; --surface: #201B1E; --side: #1B1618; --soft: #2C2529; --soft-2: #261F23;
    --ink: #F1EEF0; --ink-2: #D5CDD1; --muted: #AEA3A9; --line: #342D31; --line-2: #4A3F45;
    --accent: #CF81AB; --accent-ink: #14181A; --accent-hover: #D590B5; --accent-pressed: #DA9DBD; --accent-text: #CF81AB;
    --accent-soft: #3C2B35; --accent-soft-2: #4E3643; --accent-line: #6F495D; --ring: #CF81AB;
    --ok: #8FD9A8; --ok-bg: #1B3324; --warn: #F2CC7A; --warn-bg: #3A2E14; --bad: #F2A3A3; --bad-bg: #401F1F; --bad-solid: #E5484D;
    --ig: #F29AC4; --ig-bg: #40202F;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .5); --shadow-3: 0 24px 64px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151113; --surface: #201B1E; --side: #1B1618; --soft: #2C2529; --soft-2: #261F23;
  --ink: #F1EEF0; --ink-2: #D5CDD1; --muted: #AEA3A9; --line: #342D31; --line-2: #4A3F45;
  --accent: #CF81AB; --accent-ink: #14181A; --accent-hover: #D590B5; --accent-pressed: #DA9DBD; --accent-text: #CF81AB;
  --accent-soft: #3C2B35; --accent-soft-2: #4E3643; --accent-line: #6F495D; --ring: #CF81AB;
  --ok: #8FD9A8; --ok-bg: #1B3324; --warn: #F2CC7A; --warn-bg: #3A2E14; --bad: #F2A3A3; --bad-bg: #401F1F; --bad-solid: #E5484D;
  --ig: #F29AC4; --ig-bg: #40202F;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .5); --shadow-3: 0 24px 64px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* fingers need bigger targets than a mouse */
@media (pointer: coarse) { :root { --h: 42px; --h-sm: 36px; --h-lg: 48px; } }

/* ---------- 3. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; font-size: var(--fs); line-height: 1.6; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 600; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-md); } h3 { font-size: var(--fs); }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
strong, b { font-weight: 600; }
small { font-size: var(--fs-xs); }
code { background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: var(--r-sm); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
svg.ic { flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; } /* layout classes (stack, kpi, label) must not un-hide hidden parts */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::selection { background: var(--accent-soft-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- 4. controls ---------- */
input, select, textarea { font: inherit; font-size: var(--fs); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 12px; min-height: var(--h); width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { padding: 8px 12px; min-height: 0; resize: vertical; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 32px; 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='%23808080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; }
[dir="ltr"] select, select[dir="ltr"] { background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; box-shadow: none; }
input[type=color] { padding: 3px; width: 44px; height: var(--h); cursor: pointer; }
input[type=file] { padding: 6px; height: auto; }
input[disabled], select[disabled], textarea[disabled] { opacity: .55; cursor: not-allowed; }
label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
label > small, label .muted { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px 14px; margin: 0; min-width: 0; }
legend { padding: 0 6px; font-weight: 600; font-size: var(--fs-sm); }
.label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; font-size: var(--fs-sm); line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-1); transition: background-color .12s, border-color .12s, color .12s; }
label.btn { flex-direction: row; color: var(--ink); }
.btn:hover { background: var(--soft); border-color: var(--muted); }
.btn:active { background: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--surface)); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.small { min-height: var(--h-sm); padding: 0 10px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn.lg { min-height: var(--h-lg); font-size: var(--fs); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--h); height: var(--h); flex: none; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; transition: background-color .12s, color .12s; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.link { white-space: nowrap; background: none; border: none; padding: 2px 0; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.small { font-size: var(--fs-sm); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 5. shell: side menu (right, RTL), page header, phone bars ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.topbar, .tabbar, .scrim { display: none; }
.side { width: var(--side-w); flex: none; background: var(--side); border-inline-end: 1px solid var(--line); padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: thin; }
.side > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: inherit; text-decoration: none; border-radius: var(--r); min-height: 44px; }
.brand.with-logo { flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 8px 14px; border-bottom: 1px solid var(--line); border-radius: 0; }
.brand.with-logo .blogo img { height: 62px; max-width: 200px; }
.brand-name { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.brand-text strong { font-size: var(--fs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text span { font-size: var(--fs-xs); color: var(--muted); }
.logo { width: 34px; height: 34px; flex: none; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.logo.big { width: 52px; height: 52px; border-radius: 14px; }

.brand-compact { display: none; }
.bmark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; }
.bmark img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
/* a business's logo: its dark-background variant in the dark theme, or a light plate behind a logo that has none */
.blogo { display: inline-flex; max-width: 100%; }
.blogo img { display: block; width: auto; max-width: 100%; object-fit: contain; }
.blogo .blogo-d { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .blogo.has-dark .blogo-l { display: none; }
  :root:not([data-theme="light"]) .blogo.has-dark .blogo-d { display: block; }
  :root:not([data-theme="light"]) .blogo.plate { background: #FFFFFF; padding: 6px 10px; border-radius: var(--r); }
  :root:not([data-theme="light"]) .bmark { background: #FFFFFF; padding: 5px; border-radius: var(--r); }
}
:root[data-theme="dark"] .bmark { background: #FFFFFF; padding: 5px; border-radius: var(--r); }
:root[data-theme="dark"] .blogo.has-dark .blogo-l { display: none; }
:root[data-theme="dark"] .blogo.has-dark .blogo-d { display: block; }
:root[data-theme="dark"] .blogo.plate { background: #FFFFFF; padding: 6px 10px; border-radius: var(--r); }

.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-title { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 0 10px 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 34px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; transition: background-color .12s, color .12s; }
.nav-item svg { color: var(--muted); }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item.active svg { color: var(--accent-text); }
.nav-item.active::before { content: ''; position: absolute; inset-inline-start: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
[dir="rtl"] .nav-item.active::before { border-radius: 3px 0 0 3px; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { margin-inline-start: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad-solid); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge[hidden] { display: none; }
@media (pointer: coarse) { .nav-item { min-height: 42px; } }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.bot-state { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); }
.bot-state .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #2E9E5B; box-shadow: 0 0 0 3px color-mix(in srgb, #2E9E5B 22%, transparent); }
.bot-state.off .dot { background: var(--bad-solid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-solid) 22%, transparent); }
.demo-note { font-size: var(--fs-xs); color: var(--warn); background: var(--warn-bg); border-radius: var(--r); padding: 8px 10px; }
.switcher { gap: 4px; }
.switcher-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 0 2px; }
.switcher select { min-height: 34px; font-size: var(--fs-sm); background-color: var(--surface); }
.account { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 0; }
[dir="rtl"] .account { padding: 4px 4px 4px 0; padding-inline: 4px 0; }
.account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.account-text strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text span { font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: var(--pad-y) var(--pad-x) 56px; display: flex; flex-direction: column; gap: var(--s5); outline: none; }
.main > * { width: 100%; max-width: 1320px; }
.main > .mt16, .main > .mt8, .set-body > .mt16 { margin-top: 0; }
/* the slim header of every page: title + one line on the right, the page's actions on the left */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; position: sticky; top: 0; z-index: 10; max-width: none !important; width: auto !important; margin: calc(var(--pad-y) * -1) calc(var(--pad-x) * -1) 0; padding: 12px var(--pad-x); min-height: 64px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.page-head > div:first-child { min-width: 0; }
.page-head h1 { font-size: var(--fs-lg); letter-spacing: 0; }
.page-head p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.page-head input[type=date] { width: auto; }

/* A business's own typeface (uploaded in Settings → الهوية): headings, numbers and the menu wear it; dense text, tables
   and forms stay in IBM Plex Sans Arabic. Brand fonts usually come in one weight, so bold is never faked. */
:root[data-brand-font] :is(.page-head h1, .card h2, .modal-head h2, .kpi strong, .nav-label, .brand-name, .brand-text strong, .topbar-title, .login-head h1, .report-headline, .report-brand-text strong) { font-family: var(--font-brand); font-synthesis: none; font-weight: 400; }
/* (each brand font is scaled to sit level with the interface font, see measureFonts in ui.js, so the sizes below are the usual ones) */
:root[data-brand-font] .page-head h1 { font-size: 23px; }
:root[data-brand-font] :is(.card h2, .modal-head h2) { font-size: 18px; }
:root[data-brand-font] .nav-label { font-size: 14.5px; }
:root[data-brand-font] .brand-name { font-size: 13.5px; }
:root[data-brand-font] .kpi strong { font-size: 30px; }
:root[data-brand-font] .kpi strong.kpi-text { font-size: 21px; }
@media (max-width: 760px) { :root[data-brand-font] .page-head h1 { font-size: 19px; } :root[data-brand-font] .kpi strong { font-size: 25px; } }

/* tablet: the menu shrinks to an icon rail */
@media (max-width: 1100px) and (min-width: 761px) {
  :root { --side-w: 68px; --pad-x: 24px; }
  .side { padding: 12px 10px; align-items: stretch; gap: 12px; }
  .brand { justify-content: center; padding: 4px 0; }
  .brand.with-logo { align-items: center; padding: 4px 0 12px; }
  .brand-full { display: none; }
  .brand-compact { display: inline-flex; }
  .brand-compact .bmark { width: 40px; height: 40px; }
  .brand-text, .brand-name, .nav-label, .nav-title, .bot-state-text, .account-text, .switcher-label, .demo-note { display: none; }
  .nav { gap: 8px; }
  .nav-group + .nav-group { border-top: 1px solid var(--line); padding-top: 8px; }
  .nav-item { justify-content: center; padding: 0; min-height: 40px; }
  .nav-item.active::before { inset-inline-start: -10px; }
  .nav-badge { position: absolute; top: 2px; inset-inline-end: 2px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
  .bot-state { justify-content: center; padding: 6px 0; }
  .switcher { position: relative; height: 40px; align-items: center; justify-content: center; border-radius: var(--r); }
  .switcher::before { content: '⇄'; font-size: 18px; color: var(--ink-2); }
  .switcher:hover { background: var(--soft); }
  .switcher select { position: absolute; inset: 0; opacity: 0; min-height: 0; height: 100%; cursor: pointer; }
  .account { flex-direction: column; gap: 6px; padding: 0; }
}

/* phone: logo bar on top, the most used pages at the bottom, the full menu in a drawer */
@media (max-width: 760px) {
  :root { --pad-x: 16px; --pad-y: 16px; }
  .app { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; padding: 0 var(--pad-x); padding-inline-end: 8px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: inherit; text-decoration: none; }
  .topbar-brand .bmark { width: 34px; height: 34px; }
  .topbar-brand .logo { width: 30px; height: 30px; font-size: 14px; }
  .topbar-title { font-weight: 600; font-size: var(--fs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .icon-btn { width: 44px; height: 44px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(10, 14, 16, .5); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 30; width: min(300px, 86vw); height: 100dvh; transform: translateX(105%); transition: transform .22s ease; box-shadow: var(--shadow-3); visibility: hidden; }
  [dir="ltr"] .side { transform: translateX(-105%); }
  .side.open { transform: none; visibility: visible; }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); gap: var(--s4); }
  .page-head { position: static; min-height: 0; padding: 14px var(--pad-x); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .table-wrap > .table { min-width: 640px; }
  .tabbar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .tabbar-item { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: none; background: none; border-radius: var(--r); color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none; cursor: pointer; }
  .tabbar-item span:not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-item.active { color: var(--accent-text); font-weight: 600; }
  .tabbar-item.active::before { content: ''; position: absolute; top: -4px; inset-inline: 28%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
  .tabbar-item .nav-badge { position: absolute; top: 2px; inset-inline-end: calc(50% - 30px); margin: 0; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 6. components ---------- */
.loading { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.empty p { max-width: 42ch; }
.empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); color: var(--muted); }
.skel { display: flex; flex-direction: column; gap: var(--s5); }
.skel i, .skel-block { display: block; border-radius: var(--r); background: linear-gradient(90deg, var(--soft) 25%, var(--line) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel-head { display: flex; flex-direction: column; gap: 8px; }
.skel-head i:first-child { width: 160px; height: 22px; } .skel-head i:last-child { width: 240px; height: 14px; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4); }
.skel-row i { height: 92px; border-radius: var(--r-lg); }
.skel-block { height: 260px; border-radius: var(--r-lg); } .skel-block.short { height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); min-width: 0; }
.card.soft { background: var(--soft-2); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: var(--s3); min-height: var(--h-sm); }
.card > h2:first-child, .card.stack > h2:first-child { margin-bottom: 0; }
.card h3 { margin-top: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: var(--fs); }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.gap { gap: 8px; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; gap: 8px; }
.align-end { align-items: flex-end; } .align-center { align-items: center; }
.col { display: flex; flex-direction: column; } .col.end { align-items: flex-end; gap: 2px; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--s4); }
.split { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: flex-start; }
.split > .grow { flex: 999 1 520px; min-width: 0; }
.split > .aside, .split > .conv-list { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); } .block { display: block; } .center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .pad { padding: 8px; }
.ta-r { text-align: right; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok { color: var(--ok); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.only-phone { display: none; }
@media (max-width: 760px) { .only-phone { display: inline-flex; } }
.notice { display: block; background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); border-radius: var(--r); padding: 10px 14px; font-size: var(--fs-sm); }

/* badges and status chips: one colour language everywhere */
.badge, .chip, .size-pill { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 11.5px; font-weight: 600; line-height: 1; border-radius: 999px; padding: 4px 8px; white-space: nowrap; background: var(--soft); color: var(--ink-2); vertical-align: middle; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-solid); color: #fff; }
.badge.ig { background: var(--ig-bg); color: var(--ig); }
.badge.wa { background: var(--ok-bg); color: var(--ok); }
.chip { background: var(--accent-soft); color: var(--accent-text); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.st-confirmed, .chip.lead-visit, .chip.lead-won, .chip.ost-shipped, .chip.ost-delivered { background: var(--ok-bg); color: var(--ok); }
.chip.st-pending_deposit, .chip.lead-new, .chip.ost-pending_payment { background: var(--warn-bg); color: var(--warn); }
.chip.st-completed, .chip.lead-lost { background: var(--done-bg); color: var(--ink-2); }
.chip.st-no_show, .chip.st-cancelled, .chip.ost-cancelled { background: var(--bad-bg); color: var(--bad); }
.chip.ost-paid { background: var(--accent-soft); color: var(--accent-text); }
.size-pill { font-weight: 500; }
.size-pill.low { background: var(--warn-bg); color: var(--warn); }
.size-pill.out { background: var(--bad-bg); color: var(--bad); }

.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--surface)); color: color-mix(in srgb, var(--c, var(--accent)) 82%, var(--ink)); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--fs-sm); }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--surface)); color: color-mix(in srgb, var(--c, var(--accent)) 35%, white); } }
:root[data-theme="dark"] .avatar { background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--surface)); color: color-mix(in srgb, var(--c, var(--accent)) 35%, white); }

.list-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-of-type { border-top: none; }
.list-item p { margin: 0; color: var(--ink-2); }
.list-item.plain { background: none; border-inline: none; border-bottom: none; width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; text-decoration: none; padding: 10px 8px; border-radius: 0; transition: background-color .12s; }
.list-item.plain:hover { background: var(--soft-2); }
.list-item.plain.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .list-item.plain.active { box-shadow: inset -3px 0 0 var(--accent); }
.list-item.row { flex-direction: row; }
.list-item.others { opacity: .7; }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* stat tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s4); }
.kpis.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-1); min-width: 0; }
.kpi > span { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi-ic ~ span { padding-inline-end: 38px; } /* a long label wraps before the icon in the corner, never under it */
.kpi strong { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.25; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpis.small .kpi { padding: 12px 14px; } .kpis.small .kpi strong { font-size: var(--fs-lg); }
.kpi small { font-size: var(--fs-xs); color: var(--ink-2); }
.kpi-ic { position: absolute; top: 14px; inset-inline-end: 14px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.kpi.attn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.kpi.attn .kpi-ic { background: var(--warn-bg); color: var(--warn); }
.kpi strong.kpi-text { font-size: var(--fs-xl); line-height: 1.4; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); } .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } .kpi { padding: 14px; } .kpi strong { font-size: 22px; } .kpi-ic { width: 26px; height: 26px; top: 12px; inset-inline-end: 12px; } }

/* tables: scroll inside their own box, header stays put */
.table-wrap { overflow: auto; max-height: min(70vh, 720px); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.card > .table-wrap:only-child, .card.flush > .table-wrap { border: none; border-radius: 0; }
.card.flush { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th { position: sticky; top: 0; z-index: 1; text-align: start; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: 9px 14px; background: var(--soft-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color .1s; }
.table tbody tr:hover { background: var(--soft-2); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.perm td:not(:first-child), .perm th:not(:first-child) { text-align: center; }
.small-select { min-height: var(--h-sm); padding-block: 0; width: auto; font-size: var(--fs-xs); }

/* tabs (pills) and segmented control */
.tabs, .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; width: auto !important; align-self: flex-start; max-width: 100%; }
.tab, .seg > a, .seg > button { display: inline-flex; align-items: center; gap: 6px; min-height: calc(var(--h-sm) - 2px); padding: 0 12px; border-radius: 7px; border: none; background: none; text-decoration: none; color: var(--ink-2); font: inherit; font-weight: 500; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.tab:hover, .seg > a:hover { color: var(--ink); }
.tab.on, .seg > .on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg .count { font-size: 11px; color: var(--muted); font-weight: 600; }
.search { display: flex; gap: 8px; max-width: 520px; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 14, 16, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; animation: fade .14s ease-out; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 460px; box-shadow: var(--shadow-3); animation: pop .16s ease-out; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 14px 10px; padding-inline: 20px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: var(--fs-md); }
.modal-body { padding: 18px 20px 20px; }
.modal-body > p { margin-bottom: var(--s4); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@media (max-width: 520px) { .modal-wrap { padding: 0; align-items: flex-end; } .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92dvh; overflow-y: auto; } }
.detail { display: flex; flex-direction: column; gap: 6px; }
.kv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); min-width: 0; }
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: end; min-width: 0; }
.kv .row { min-width: 0; }
.slots-box { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; }
.slot-staff { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { min-height: var(--h-sm); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
.slot:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: none; }
label.switch-row { flex-direction: row; align-items: center; justify-content: space-between; text-align: start; font-weight: 500; cursor: pointer; }
label.switch-row input { flex: none; }

/* toasts */
#toasts { position: fixed; bottom: 24px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 70; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: var(--r); font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-2); animation: pop .16s ease-out; pointer-events: auto; }
.toast.err { background: var(--bad-solid); color: #fff; }

/* ---------- 7. pages ---------- */
/* today */
.staff-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); }
.staff-col { background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.staff-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 6px; }
.staff-head div { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; } .staff-head small { color: var(--muted); }
.appt-card { display: flex; flex-direction: column; gap: 3px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font: inherit; font-size: var(--fs-sm); color: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.appt-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.appt-card .chip { margin-top: 4px; }

/* calendar */
.cal-card { padding: 0; overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100dvh - 190px); }
.cal { min-width: calc(64px + var(--cols) * 170px); }
.cal-head { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(170px, 1fr)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 4; }
.cal-staff { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; font-size: var(--fs-sm); border-inline-start: 1px solid var(--line); }
.cal-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(170px, 1fr)); position: relative; }
.cal-times { position: relative; background: var(--soft-2); }
.cal-times span { position: absolute; inset-inline: 0; text-align: center; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-times span:first-child { transform: translateY(2px); }
.cal-times span:last-child { transform: translateY(-110%); }
.cal-col { position: relative; border-inline-start: 1px solid var(--line); cursor: copy; }
.cal-col:hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.cal-col:focus-visible { outline-offset: -2px; }
.cal-line { position: absolute; inset-inline: 0; border-top: 1px solid var(--line); }
.cal-appt { position: absolute; inset-inline: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; text-align: start; border: 1px solid color-mix(in srgb, var(--c) 28%, var(--surface)); border-inline-start: 3px solid var(--c); border-radius: var(--r-sm); padding: 4px 8px; background: color-mix(in srgb, var(--c) 11%, var(--surface)); color: var(--ink); font: inherit; font-size: var(--fs-xs); line-height: 1.45; cursor: pointer; z-index: 1; transition: box-shadow .12s; }
.cal-appt:hover { box-shadow: var(--shadow-2); z-index: 2; }
.cal-appt strong { font-size: var(--fs-xs); font-weight: 600; }
.cal-appt span { color: var(--ink-2); }
.cal-appt.st-pending_deposit { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 8px, var(--surface) 8px 16px); }
.cal-appt.st-completed { opacity: .62; }
.cal-appt.st-no_show { opacity: .5; text-decoration: line-through; }
.cal-now { position: absolute; inset-inline: 64px 0; border-top: 2px solid var(--bad-solid); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; inset-inline-start: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad-solid); }

/* hours */
.hours { display: flex; flex-direction: column; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 130px minmax(0, 140px) auto minmax(0, 140px); align-items: center; gap: 8px; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row > .muted { display: none; } }

/* staff */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.staff-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); font: inherit; color: inherit; cursor: pointer; text-align: center; transition: border-color .12s, box-shadow .12s; }
.staff-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.staff-card.off { opacity: .55; }

/* messages: inbox on the right, the open conversation beside it */
.inbox-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--s4); align-items: start; }
/* with a conversation open, the conversation comes first and the two summary cards move under it */
.main.has-thread > .inbox-top { order: 3; }
.inbox { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.inbox > .conv-list { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100dvh - 120px); position: sticky; top: 84px; }
.inbox > .conv-list .card-head { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--line); }
.conv-scroll { overflow-y: auto; }
.conv-list .list-item.plain { padding: 12px 16px; gap: 3px; }
.conv-list .list-item.plain .badge { padding: 3px 6px; font-size: 10.5px; }
.conv-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.conv-meta:empty { display: none; }
.thread { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.thread > .card-head { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread > .card-head h2 { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread > .empty { padding: 72px 16px; }
.thread-note { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--soft-2); }
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox > .conv-list { position: static; max-height: 420px; }
  .has-thread .inbox-top, .has-thread .inbox > .conv-list, .main.has-thread > .page-head { display: none; }
  .thread .chat { max-height: calc(100dvh - 400px); min-height: 220px; }
}
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 280px; max-height: 58vh; overflow-y: auto; padding: 16px; background: var(--soft-2); }
.thread .chat { max-height: calc(100dvh - 330px); min-height: 320px; }
.bubble { max-width: min(78%, 560px); padding: 8px 12px; border-radius: 14px; font-size: var(--fs); line-height: 1.65; overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
/* the customer: neutral, on the right. the bot: tinted. a person from the team: solid accent. */
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--accent-soft-2); color: var(--ink); border-start-end-radius: 4px; }
.bubble.out.staff { background: var(--accent); color: var(--accent-ink); }
.bubble small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bubble.out.staff small, .bubble.out.staff .who { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
.bubble.out.auto { background: var(--soft-2); color: var(--ink-2); border: 1px dashed var(--line); box-shadow: none; }
.bubble.out.auto .who { color: var(--muted); font-weight: 500; }
.auto-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.auto-notice > span:first-child { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 320px; }
.auto-notice svg { flex: none; margin-top: 3px; }
.card h4 { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.auto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.auto-list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft-2); }
.auto-list li p { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; flex: 1; }
.auto-add { display: flex; gap: 8px; align-items: flex-end; }
/* Settings → comment replies (v0.31) */
.cdm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cdm-list li { display: flex; gap: 12px 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.cdm-list li.off { background: var(--soft-2); }
.cdm-list li.off .cdm-dm { opacity: .7; }
.cdm-main { display: flex; flex-direction: column; gap: 7px; flex: 1 1 320px; min-width: 0; }
.cdm-main strong { font-size: var(--fs-md); overflow-wrap: anywhere; }
.cdm-post { color: var(--ink-2); overflow-wrap: anywhere; }
.cdm-post a { color: var(--accent-text); }
.cdm-dm { margin: 0; padding: 8px 12px; border-radius: 4px 12px 12px 12px; background: var(--ig-bg); color: var(--ink); font-size: var(--fs-sm); white-space: pre-line; overflow-wrap: anywhere; align-self: flex-start; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
[dir="rtl"] .cdm-dm { border-radius: 12px 4px 12px 12px; }
.cdm-acts { flex: none; }
.cdm-main small:empty { display: none; }
.cdm-foot { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.cdm-foot svg { flex: none; margin-top: 3px; }
.cdm-field { display: flex; flex-direction: column; gap: 6px; }
.cdm-field > .row > label { flex-direction: row; gap: 6px; align-items: baseline; }
.cdm-count { font-variant-numeric: tabular-nums; direction: ltr; }
.cdm-count.over { color: var(--bad); font-weight: 600; }
.cdm-var { display: flex; gap: 8px; align-items: flex-start; }
.cdm-var textarea { flex: 1; }
.kw-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--h); padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: text; }
.kw-box:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.kw-box input { flex: 1 1 140px; min-width: 100px; width: auto; border: none; outline: none; box-shadow: none; background: none; padding: 2px 4px; min-height: 26px; height: 26px; }
.kw-box input:focus-visible { box-shadow: none; outline: none; border: none; }
.kw { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; padding-inline: 10px 4px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.kw button { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: none; border-radius: 50%; background: none; color: inherit; cursor: pointer; padding: 0; opacity: .75; }
.kw button:hover { opacity: 1; background: color-mix(in srgb, currentColor 16%, transparent); }
.auto-add textarea { flex: 1; }
.bubble.typing { opacity: .7; }
.bubble .who { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--accent-text); margin-bottom: 1px; }
.bot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: var(--fs-sm); }
.bot-bar > span { flex: 1 1 260px; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.bot-bar > span > svg { margin-top: 3px; color: var(--accent-text); }
.bot-bar .bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.bot-bar.paused { background: var(--warn-bg); color: var(--warn); }
.bot-bar.paused > span > svg { color: var(--warn); }
.bot-bar.skipped { background: var(--soft); color: var(--ink-2); border-bottom-style: dashed; border-bottom-color: var(--line-2); }
.bot-bar.skipped > span > svg { color: var(--muted); }
.card:not(.thread) > .bot-bar { border: none; border-radius: var(--r); margin-bottom: 10px; }
.sys-note { align-self: center; font-size: var(--fs-xs); background: var(--ok-bg); color: var(--ok); border-radius: 999px; padding: 4px 12px; text-align: center; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.thread .chat-input { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input input { min-height: 40px; }
.chat-input .btn { min-height: 40px; }
.phone-sim .chat { min-height: 420px; border-radius: var(--r); border: 1px solid var(--line); }

/* customers waiting for a person's reply */
.wait-tag { color: var(--bad); font-weight: 600; font-size: var(--fs-xs); }
.sub-head { font-size: var(--fs-sm); margin: 0; }
.card h3.sub-head { border: none; padding: 0; margin: 0; }
.wait-box { margin-top: 12px; padding: 12px 14px 4px; border-radius: var(--r); background: var(--bad-bg); }
.wait-card { border-color: color-mix(in srgb, var(--bad-solid) 55%, var(--line)); box-shadow: inset 0 3px 0 var(--bad-solid), var(--shadow-1); }
.wait-alert { z-index: 60; }
.wait-alert .modal { border-top: 4px solid var(--bad-solid); }
.wait-alert .modal-head h2 { color: var(--bad); }

/* reports */
.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hbar-val { font-weight: 600; white-space: nowrap; }

/* shops: orders board, stock */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: 14px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.board-col { background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.board-head h2 { font-size: var(--fs); margin: 0; }
.board-head .count { background: var(--accent-soft-2); color: var(--accent-text); border-radius: 999px; padding: 1px 9px; font-size: var(--fs-xs); font-weight: 600; }
.order-card { display: flex; flex-direction: column; gap: 6px; text-align: start; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font: inherit; font-size: var(--fs-sm); color: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.order-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); }

/* trial report */
.report-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: var(--s5); }
.report-brand .blogo img { height: 64px; max-width: 220px; }
.report-brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.report-brand-text strong { font-size: var(--fs-lg); }
.report-head { background: var(--accent-soft); border-color: var(--accent-line); box-shadow: none; }
.report-headline { font-size: var(--fs-xl); font-weight: 600; line-height: 1.6; margin: 0 0 4px; }
.report-notes ul { margin: 8px 0 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); }
.main[data-page="trial"] .card > h2 { margin-bottom: 6px; }

/* settings: sections down the page, a small index beside them */
.set-layout { display: grid; grid-template-columns: 190px minmax(0, 820px); gap: var(--s6); align-items: start; }
.set-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 1px; }
.set-nav button { display: flex; align-items: center; min-height: 32px; padding: 0 10px; border: none; background: none; border-radius: var(--r); color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: 500; text-align: start; cursor: pointer; }
.set-nav button:hover { background: var(--soft); color: var(--ink); }
.set-nav button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.set-body { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.set-body > .card { scroll-margin-top: 84px; }
.set-body h3 { scroll-margin-top: 84px; }
@media (max-width: 1000px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 12px; }
}
/* brand card */
.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 900px) { .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .brand-grid, .brand-grid.fonts { grid-template-columns: minmax(0, 1fr); } }
.logo-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.brand-grid.fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.font-slot { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.card h3 small { font-weight: 400; }
.logo-slot-head { display: flex; flex-direction: column; line-height: 1.5; }
.logo-drop { display: flex; align-items: center; justify-content: center; height: 132px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: #FFFFFF; color: #6B7376; overflow: hidden; }
.logo-drop.on-dark { background: #14181A; color: #A3ACAE; border-color: #3F484A; }
.logo-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-drop .ph { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--fs-xs); text-align: center; }
.logo-slot .row { flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; height: 100%; }
.file-btn:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.color-row input[type=text] { width: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); background: var(--c); cursor: pointer; padding: 0; }
.swatch:hover { box-shadow: 0 0 0 2px var(--ink-2); }
.brand-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 640px) { .brand-preview { grid-template-columns: minmax(0, 1fr); } }
.pv { border: 1px solid var(--pv-line); border-radius: var(--r-lg); padding: 14px; background: var(--pv-bg); color: var(--pv-ink); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pv-title { font-size: var(--fs-xs); color: var(--pv-muted); font-weight: 500; }
.pv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pv-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r); background: var(--pv-accent); color: var(--pv-accent-ink); font-size: var(--fs-sm); font-weight: 600; }
.pv-nav { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: var(--r); background: var(--pv-soft); color: var(--pv-text); font-size: var(--fs-sm); font-weight: 600; }
.pv-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--pv-soft); color: var(--pv-text); font-size: 11.5px; font-weight: 600; }
.pv-link { color: var(--pv-text); font-size: var(--fs-sm); font-weight: 600; }
.pv-card { background: var(--pv-surface); border: 1px solid var(--pv-line); border-radius: var(--r); padding: 10px 12px; font-size: var(--fs-sm); }

/* login */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--s5); }
.login-brand { display: flex; justify-content: center; }
.login-brand .blogo img { height: 104px; max-width: 280px; }
.login { display: flex; flex-direction: column; gap: 14px; padding: var(--s6); box-shadow: var(--shadow-2); }
.login-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.login-head h1 { font-size: var(--fs-xl); }
.login input { min-height: 42px; }
.login-foot { text-align: center; }
.demo-roles { padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- 7b. the platform (0.26): the product's own look, and the platform owner inside a business ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* the product's mark: fixed neutral colours, never a business's accent */
/* يمينك (Yaminak, v0.30). THE ONE PLACE for the platform's brand colours: change them here and nowhere else.
   --yk-ink: the mark and the name, the owner bar, and (through applyBrand in js/ui.js) the accent of the platform's own pages.
   --yk-accent: the second colour (the two dots).  --yk-cream: the light background that goes with them.
   The drawings themselves are files: public/brand/yaminak-*.svg (and the two PNG icons made from the mark by scripts/brand-icons.js). */
:root { --yk-ink: #2E3946; --yk-accent: #25D366; --yk-cream: #F4F5F7; --yk-gray: #7A8594; }
:root { --p-ink: var(--yk-ink); --p-on: #FFFFFF; --bar-h: 0px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --p-ink: #F1EEF0; --p-on: #201B1E; } }
:root[data-theme="dark"] { --p-ink: #F1EEF0; --p-on: #201B1E; }
.pmark { display: inline-flex; width: 34px; height: 34px; flex: none; }
.pmark img, .plogo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pmark.big { width: 52px; height: 52px; }
.pmark.sm { width: 22px; height: 22px; }
.pmark.xs { width: 14px; height: 14px; }
.plogo { display: inline-flex; height: 60px; max-width: 100%; }
.plogo img { width: auto; }
/* two drawings of each: .pm-l for light backgrounds, .pm-d for dark ones. The owner bar is the ink itself, so .sm is the other way round. */
:is(.pmark, .plogo) .pm-d, .pmark.sm .pm-l { display: none; }
.pmark.sm .pm-d { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.pmark, .plogo) .pm-l { display: none; }
  :root:not([data-theme="light"]) :is(.pmark, .plogo) .pm-d { display: block; }
  :root:not([data-theme="light"]) .pmark.sm .pm-l { display: block; }
  :root:not([data-theme="light"]) .pmark.sm .pm-d { display: none; }
}
:root[data-theme="dark"] :is(.pmark, .plogo) .pm-l { display: none; }
:root[data-theme="dark"] :is(.pmark, .plogo) .pm-d { display: block; }
:root[data-theme="dark"] .pmark.sm .pm-l { display: block; }
:root[data-theme="dark"] .pmark.sm .pm-d { display: none; }
.login-wrap.platform { background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--yk-accent) 12%, transparent), transparent 70%), var(--bg); }
.login-by { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
/* the owner inside a business: one bar over every page, in the product's ink (not the business's colours) */
:root[data-owner-bar] { --bar-h: 40px; }
.owner-bar { position: sticky; top: 0; z-index: 21; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--pad-x); background: var(--p-ink); color: var(--p-on); font-size: var(--fs-sm); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.owner-bar-text { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.owner-bar-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-bar-line strong { font-weight: 700; }
.owner-bar-role { opacity: .78; }
.owner-bar-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--p-on) 38%, transparent); background: color-mix(in srgb, var(--p-on) 12%, transparent); color: var(--p-on); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
.owner-bar-btn:hover { background: var(--p-on); color: var(--p-ink); }
.owner-bar-btn:focus-visible { outline: 2px solid var(--p-on); outline-offset: 2px; }
/* everything that sticks to the top of the window moves down by the bar's height */
:root[data-owner-bar] .app { min-height: calc(100vh - var(--bar-h)); min-height: calc(100dvh - var(--bar-h)); }
:root[data-owner-bar] .page-head { top: var(--bar-h); }
:root[data-owner-bar] .inbox > .conv-list { top: calc(84px + var(--bar-h)); max-height: calc(100dvh - 120px - var(--bar-h)); }
:root[data-owner-bar] .set-nav { top: calc(88px + var(--bar-h)); }
:root[data-owner-bar] :is(.set-body > .card, .set-body h3) { scroll-margin-top: calc(84px + var(--bar-h)); }
/* the owner's menu has one block more (the switcher): his name and the way out stay in view on a short screen */
:root[data-owner-bar] .side-foot { position: sticky; bottom: -12px; z-index: 1; margin-bottom: -12px; padding-bottom: 12px; background: var(--side); }
@media (min-width: 761px) { :root[data-owner-bar] .side { top: var(--bar-h); height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h)); } }
@media (max-width: 760px) {
  :root[data-owner-bar] { --bar-h: 44px; }
  :root[data-owner-bar] .topbar { top: var(--bar-h); }
  .owner-bar { padding: 0 12px; gap: 8px; font-size: 12.5px; }
  .owner-bar-text { gap: 8px; }
  .owner-bar-btn { height: 32px; padding: 0 10px; }
  .topbar-brand .pmark { width: 30px; height: 30px; }
}
@media (max-width: 370px) { .owner-bar-role { display: none; } }
/* «كل الأنشطة»: the list of businesses */
.biz-head { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--line); }
.biz { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.biz-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: var(--r); font-weight: 700; font-size: 15px; background: color-mix(in srgb, var(--c, var(--muted)) 14%, var(--surface)); color: color-mix(in srgb, var(--c, var(--muted)) 82%, var(--ink)); }
.biz-mark.img { background: #FFFFFF; border: 1px solid var(--line); padding: 5px; }
.biz-mark img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.biz-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.biz-text strong { font-size: var(--fs); }
.biz-text small { font-size: 11.5px; text-align: start; }
[dir="rtl"] .biz-text small { text-align: right; }
.biz-off :is(.biz-mark, .biz-text) { opacity: .6; }
.biz-table td { white-space: nowrap; }
.biz-actions .row { justify-content: flex-end; gap: 14px; }
.biz-actions .btn { min-width: 64px; font-weight: 600; }
/* tablet: the two least needed columns step aside so «دخول» stays in view */
@media (max-width: 1100px) and (min-width: 761px) { .biz-table :is(th, td):nth-child(5), .biz-table :is(th, td):nth-child(6) { display: none; } }
@media (max-width: 760px) {
  .main[data-page="owner"] .table-wrap { max-height: none; overflow: visible; }
  .table-wrap > .table.biz-table { min-width: 0; display: block; }
  .biz-table thead { display: none; }
  .biz-table tbody { display: block; }
  .biz-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .biz-table tbody tr:last-child { border-bottom: none; }
  .biz-table td { padding: 0; border: none; }
  .biz-table td.biz-cell, .biz-table td.biz-actions { flex: 1 1 100%; }
  .biz-table td[data-th] { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); }
  .biz-table td[data-th]::before { content: attr(data-th); color: var(--muted); font-weight: 500; }
  .biz-table td[data-th="النوع"]::before, .biz-table td[data-th="الحالة"]::before { content: none; }
  .biz-actions .row { justify-content: space-between; }
  .biz-actions .btn { flex: 0 1 56%; min-height: 38px; }
}

/* ---------- 8. printing (the trial report saved as PDF): the page only, on white, without the menu and buttons ---------- */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --side: #fff; --soft: #F3F4F5; --soft-2: #fff; --ink: #1B1F21; --ink-2: #3A4245; --muted: #5A6367; --line: #D8DDDF; --line-2: #C3CACD;
    --accent: #7A2E57; --accent-ink: #fff; --accent-text: #7A2E57; --accent-soft: #F4EEF2; --accent-soft-2: #EBE0E6; --accent-line: #D4BCC9;
    --ok: #17663A; --ok-bg: #E6F4EA; --warn: #7A4B00; --warn-bg: #FDF1D7; --bad: #A32222; --bad-bg: #FCE8E8;
    --shadow-1: none; --shadow-2: none; color-scheme: light;
  }
  body { background: #fff; font-size: 10.5pt; }
  .side, .topbar, .tabbar, .scrim, .no-print, #toasts, .modal-wrap, .owner-bar { display: none !important; }
  .app { display: block; }
  .main { padding: 0; gap: 12px; }
  .main > * { max-width: none; }
  .page-head { position: static; margin: 0; padding: 0 0 8px; background: none; backdrop-filter: none; min-height: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-headline { font-size: 15pt; }
  .blogo .blogo-l { display: block !important; } .blogo .blogo-d { display: none !important; }
  .blogo.plate { background: none !important; padding: 0 !important; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* Left-to-right tokens inside Arabic text (phone numbers, @usernames, emails, links): kept in their own direction,
   so "+968 9723 1896" never shows as "1896 9723 968+". See ltr() in ui.js. */
.ltr, bdi[dir="ltr"] { unicode-bidi: isolate; direction: ltr; }
bdi.ltr { white-space: nowrap; }
.bubble .msg { display: block; unicode-bidi: isolate; text-align: start; }

/* English (v0.28): <html lang="en" dir="ltr">. The layout is written with logical properties, so it mirrors by itself;
   what is left are the icons that point somewhere (drawn for right-to-left) and the language switch. */
[dir="ltr"] .ic.dir { transform: scaleX(-1); }
.lang-btn { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); border-color: var(--line); }
.lang-btn:hover { color: var(--ink); }
.login-foot .link { font-size: inherit; }
.lang-seg > button { min-width: 96px; justify-content: center; cursor: pointer; }
.lang-seg > button:hover { color: var(--ink); }
.loading .spin { display: inline-block; width: 20px; height: 20px; }
