/* Primoura CRM: the Primoura look (as Primoura Center): ivory and ink, one champagne accent, light and dark.
   Arabic RTL by default; English flips to LTR (<html dir>). */

/* Self-hosted OFL fonts (licenses in /fonts/OFL-*.txt), Google Fonts subsets: IBM Plex Sans Arabic (Arabic + its
   Latin, 300–600) for text and numbers; El Messiri (Arabic) + Cormorant Garamond (Latin) for page titles. */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 300; font-display: swap; src: url(/fonts/IBMPlexSansArabic-arabic-300.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexSansArabic-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-display: swap; src: url(/fonts/IBMPlexSansArabic-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-display: swap; src: url(/fonts/IBMPlexSansArabic-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 300; font-display: swap; src: url(/fonts/IBMPlexSansArabic-latin-300.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: 400; font-display: swap; src: url(/fonts/IBMPlexSansArabic-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-display: swap; src: url(/fonts/IBMPlexSansArabic-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-display: swap; src: url(/fonts/IBMPlexSansArabic-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: 'El Messiri'; font-weight: 400 700; font-display: swap; src: url(/fonts/ElMessiri-arabic-var.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 300 700; font-display: swap; src: url(/fonts/CormorantGaramond-latin-var.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; }

:root {
  color-scheme: light;
  /* Primoura "ivory and ink" (same palette as Primoura Center), one champagne accent. */
  --bg: #F6F4EF;
  --surface: #FDFCF9;
  --surface-2: #EFECE4;
  --surface-3: #E8E4DA;
  --line: #E4E0D6;
  --line-strong: #CFC9BB;
  --hover-line: #BDB6A6;
  --text: #141414;
  --text-2: #4A4945;
  --muted: #8A877F;
  --accent: #9A7B4F;
  --accent-ink: #7E6340;
  --accent-soft: #EFE6D6;
  /* the old gold names now carry the champagne accent */
  --gold-deep: #7E6340;
  --gold: #9A7B4F;
  --gold-2: #8A6D45;
  --gold-3: #6E5636;
  --gold-ink: #FDFCF9;
  --gold-grad: linear-gradient(180deg, #A88A5E 0%, #9A7B4F 100%);
  --gold-soft: #EFE6D6;
  --brand-grad: linear-gradient(180deg, #A88A5E 0%, #7E6340 100%);
  --danger: #B4483C;
  --ok: #3F7A5A;
  --warn: #A8711A;
  /* lead statuses (dots + labels), as on Primoura Center's leads board */
  --st-new: #9A7B4F;
  --st-contacted: #4F7FB3;
  --st-booked: #8A5FB5;
  --st-attended: #3F7A5A;
  --st-no_show: #B4483C;
  --st-lost: #A9A396;
  --ok-ink: #2F6247; --ok-bg: rgba(63, 122, 90, .10); --ok-line: rgba(63, 122, 90, .30);
  --err-ink: #9C3A30; --err-bg: rgba(180, 72, 60, .08); --err-line: rgba(180, 72, 60, .30);
  --warn-ink: #8A5B12; --warn-bg: rgba(168, 113, 26, .12);
  --wa-ink: #0F3D26; --wa-bg: #E3F4EA; --wa-line: #C2E3CF; --wa-btn: #1A9E74; --wa-btn-line: #9AD4BE;
  --env-a: #F3EAD7; --env-b: #EBDDC2;
  --tooltip-bg: #141414; --tooltip-ink: #F6F4EF;
  --overlay: rgba(20, 20, 20, .30);
  --drop-bg: rgba(154, 123, 79, .08);
  --hover-fill: rgba(20, 20, 20, .035);
  --grid-dot: rgba(20, 20, 20, .08);
  --stage-1: #E3D3B8; --stage-2: #B8996A; --stage-3: #7E6340;
  --pill-bg: var(--surface-2);
  --pill-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow: 0 18px 50px -12px rgba(20, 20, 20, .18);
  --shadow-sm: none;
  --radius: 16px;
  --radius-sm: 12px;
  --ease-spring: cubic-bezier(.34, 1.32, .64, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  /* Type as in Primoura Center: IBM Plex Sans Arabic (it carries its own Latin) for everything people read
     and count; a classic display face for page titles (El Messiri for Arabic, Cormorant Garamond for Latin). */
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-head: var(--font);
  --font-display: 'Cormorant Garamond', 'El Messiri', Georgia, serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #08090A;
  --surface: #0F1012;
  --surface-2: #16171A;
  --surface-3: #1D1E22;
  --line: #1F2023;
  --line-strong: #2E2F33;
  --hover-line: #3A3B40;
  --text: #F3F1EC;
  --text-2: #C4C1B9;
  --muted: #7D7A73;
  --accent: #CFB27E;
  --accent-ink: #DCC497;
  --accent-soft: #221D14;
  --gold-deep: #B89A66;
  --gold: #CFB27E;
  --gold-2: #DCC497;
  --gold-3: #E8D6B2;
  --gold-ink: #08090A;
  --gold-grad: linear-gradient(180deg, #DCC497 0%, #CFB27E 100%);
  --gold-soft: #221D14;
  --brand-grad: linear-gradient(180deg, #E8D6B2 0%, #CFB27E 100%);
  --danger: #E07A6C;
  --ok: #7FBF98;
  --warn: #E2B35C;
  --st-new: #CFB27E;
  --st-contacted: #6F9FD3;
  --st-booked: #A585D0;
  --st-attended: #7FBF98;
  --st-no_show: #E07A6C;
  --st-lost: #6A675F;
  --ok-ink: #9ED3B2; --ok-bg: rgba(127, 191, 152, .12); --ok-line: rgba(127, 191, 152, .32);
  --err-ink: #F0A096; --err-bg: rgba(224, 122, 108, .12); --err-line: rgba(224, 122, 108, .35);
  --warn-ink: #EEC983; --warn-bg: rgba(226, 179, 92, .13);
  --wa-ink: #E3F4EA; --wa-bg: #12301F; --wa-line: #1D4D33; --wa-btn: #4FCB9E; --wa-btn-line: #1F6B4C;
  --env-a: #2A2214; --env-b: #221B10;
  --tooltip-bg: #F3F1EC; --tooltip-ink: #08090A;
  --overlay: rgba(0, 0, 0, .6);
  --drop-bg: rgba(207, 178, 126, .08);
  --hover-fill: rgba(255, 255, 255, .04);
  --grid-dot: rgba(255, 255, 255, .06);
  --stage-1: #4A3E2A; --stage-2: #9C8358; --stage-3: #E8D6B2;
  --pill-bg: var(--surface-2);
  --pill-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .7);
  --shadow-sm: none;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090A;
  --surface: #0F1012;
  --surface-2: #16171A;
  --surface-3: #1D1E22;
  --line: #1F2023;
  --line-strong: #2E2F33;
  --hover-line: #3A3B40;
  --text: #F3F1EC;
  --text-2: #C4C1B9;
  --muted: #7D7A73;
  --accent: #CFB27E;
  --accent-ink: #DCC497;
  --accent-soft: #221D14;
  --gold-deep: #B89A66;
  --gold: #CFB27E;
  --gold-2: #DCC497;
  --gold-3: #E8D6B2;
  --gold-ink: #08090A;
  --gold-grad: linear-gradient(180deg, #DCC497 0%, #CFB27E 100%);
  --gold-soft: #221D14;
  --brand-grad: linear-gradient(180deg, #E8D6B2 0%, #CFB27E 100%);
  --danger: #E07A6C;
  --ok: #7FBF98;
  --warn: #E2B35C;
  --st-new: #CFB27E;
  --st-contacted: #6F9FD3;
  --st-booked: #A585D0;
  --st-attended: #7FBF98;
  --st-no_show: #E07A6C;
  --st-lost: #6A675F;
  --ok-ink: #9ED3B2; --ok-bg: rgba(127, 191, 152, .12); --ok-line: rgba(127, 191, 152, .32);
  --err-ink: #F0A096; --err-bg: rgba(224, 122, 108, .12); --err-line: rgba(224, 122, 108, .35);
  --warn-ink: #EEC983; --warn-bg: rgba(226, 179, 92, .13);
  --wa-ink: #E3F4EA; --wa-bg: #12301F; --wa-line: #1D4D33; --wa-btn: #4FCB9E; --wa-btn-line: #1F6B4C;
  --env-a: #2A2214; --env-b: #221B10;
  --tooltip-bg: #F3F1EC; --tooltip-ink: #08090A;
  --overlay: rgba(0, 0, 0, .6);
  --drop-bg: rgba(207, 178, 126, .08);
  --hover-fill: rgba(255, 255, 255, .04);
  --grid-dot: rgba(255, 255, 255, .06);
  --stage-1: #4A3E2A; --stage-2: #9C8358; --stage-3: #E8D6B2;
  --pill-bg: var(--surface-2);
  --pill-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .7);
  --shadow-sm: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; font-family: var(--font-head); }
.tile-value, .b-time, .col-title, .day-title { font-family: var(--font-head); }
h1 { font-size: 18px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--text-2); }
p { margin: .4em 0; }
/* Arabic inside code (e.g. form snippets) falls back to the UI font so letters stay joined. */
code, pre, .mono { font-family: ui-monospace, 'SF Mono', Menlo, 'IBM Plex Sans Arabic', monospace; font-size: 12.5px; }
.mono { unicode-bidi: isolate; }
html[dir=rtl] :is(div, .sub).mono[dir=ltr] { text-align: right; }
/* Read-only value inside a form grid (e.g. the lead's ad ids): looks like a quiet input. */
.ro-value { padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-2); line-height: 20px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; color: var(--text-2); text-align: left;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: inline-block; vertical-align: bottom;
  unicode-bidi: plaintext; }
/* Long names/campaigns: up to two lines, then "…" (full text in the auto tooltip). plaintext = an English
   name in the Arabic UI (or the reverse) is cut at its own end, not its start. */
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  white-space: normal; overflow-wrap: anywhere; unicode-bidi: plaintext; }
/* plaintext would align each text by its own language; keep columns aligned with the page instead. */
html[dir=rtl] :is(.ellipsis, .clamp2, selectedcontent) { text-align: right; }
html[dir=ltr] :is(.ellipsis, .clamp2, selectedcontent) { text-align: left; }
.sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 400; }
.sub.clamp2 { display: -webkit-box; }
.nowrap { white-space: nowrap; }
.cards-grid > *, .tiles > *, .grid2 > *, .grid4 > *, .profile-grid > *, .kv > *, .hours-day > * { min-width: 0; }
td.ellipsis { display: table-cell; max-width: 220px; }
.spacer { flex: 1; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.stale { opacity: .55; transition: opacity .15s; pointer-events: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; background: var(--bg); }
.boot-bar { width: 120px; height: 3px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; opacity: 0; animation: boot-show .3s ease .8s forwards; }
/* the bar only appears if start-up takes longer than a moment */
@keyframes boot-show { to { opacity: 1; } }
.boot-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--gold-grad); border-radius: inherit; animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
html[dir=rtl] .boot-bar::after { animation-direction: reverse; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .boot-bar::after { animation: none; width: 100%; } }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); border-color: var(--hover-line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold-grad); border-color: var(--gold-deep); color: var(--gold-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 42px; }
.btn.wa { border-color: var(--wa-btn-line); color: var(--wa-btn); }
.btn.big { height: 46px; padding: 0 20px; font-size: 15px; font-weight: 600; min-width: 108px; }
.btn.ok { background: var(--ok-bg); border-color: var(--st-attended); color: var(--ok-ink); }
.btn.warn { background: var(--warn-bg); border-color: var(--st-no_show); color: var(--warn-ink); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

input, select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit;
}
textarea { resize: vertical; }
/* Selects in the brand style: gold chevron, dark list. Chromium's customizable select
   (appearance: base-select) also styles the open list; other browsers keep their native list. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-inline-end: 32px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4A63D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 10px center / 14px;
}
html[dir=ltr] select { background-position: right 10px center; }
select:hover { border-color: var(--hover-line); }
select option { background: var(--surface-2); color: var(--text); }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { background-image: none; display: flex; align-items: center; gap: 8px; padding-inline-end: 10px; max-width: 100%; }
  /* The chosen label sits in <selectedcontent> (added by ui.js) so it can end in "…". */
  select > button { all: unset; display: flex; flex: 1; min-width: 0; }
  select selectedcontent { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    unicode-bidi: plaintext; }
  select option { white-space: normal; max-width: min(460px, 92vw); }
  select::picker-icon { color: var(--gold); transition: rotate .15s; }
  select:open::picker-icon { rotate: 180deg; }
  select:open { border-color: var(--gold); }
  ::picker(select) {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
    box-shadow: var(--shadow); padding: 4px; margin-block: 4px; max-height: min(60vh, 360px); overflow-y: auto;
  }
  select option { padding: 7px 10px; border-radius: 6px; background: transparent; gap: 8px; }
  select option:hover, select option:focus-visible { background: var(--surface-3); color: var(--gold-3); outline: none; }
  select option:checked { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-2); font-weight: 600; }
  select option::checkmark { color: var(--gold); }
}

input[type=file] { padding: 5px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; margin-inline-end: 10px; padding: 4px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gold-deep); background: var(--surface-3); color: var(--gold-2); cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .75; background: var(--surface); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--gold); margin: 0; flex: none; }
input[dir=ltr] { text-align: left; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: 1 / -1; }
.end { display: flex; justify-content: flex-end; }
.form-error { color: var(--danger); min-height: 1.2em; font-size: 13px; }

/* chips */
.chip {
  display: inline-block; vertical-align: middle; height: 22px; line-height: 20px; padding: 0 8px; max-width: 100%;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--surface-3); color: var(--text-2); border: 1px solid transparent;
}
.chip[class*="st-"]::before { content: ''; display: inline-block; vertical-align: middle; margin: -2px 0 0; margin-inline-end: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.st-new { --c: var(--st-new); } .st-contacted { --c: var(--st-contacted); } .st-booked { --c: var(--st-booked); }
.st-attended { --c: var(--st-attended); } .st-no_show { --c: var(--st-no_show); } .st-lost { --c: var(--st-lost); }
.chip[class*="st-"] { background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 62%, var(--text)); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.chip.src { background: transparent; border-color: var(--line-strong); }
.chip.ok, .cv-sent { color: var(--ok-ink); background: var(--ok-bg); }
.cv-failed { color: var(--err-ink); background: var(--err-bg); }
.cv-pending { color: var(--gold-2); background: var(--gold-soft); }
.muted-chip, .cv-skipped { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }

/* ---------- auth ---------- */


.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 8px rgba(180, 140, 60, .25)); }
.brand-name { font: 600 12px/1.2 var(--font); letter-spacing: 2.5px; direction: ltr;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 3px; direction: ltr; text-align: right; }
html[dir=ltr] .brand-sub { text-align: left; }

/* ---------- layout ---------- */

.layout { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px; background: var(--surface); border-inline-end: 1px solid var(--line); }
.sidebar .brand { padding: 0 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-short { display: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--gold-2); box-shadow: inset -2px 0 0 var(--gold); }
html[dir=ltr] .nav a.active { box-shadow: inset 2px 0 0 var(--gold); }
.me { display: flex; align-items: center; gap: 4px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); border-radius: var(--radius-sm); padding: 4px; margin: -4px; text-decoration: none !important; }
.me-link:hover { background: var(--surface-2); }
.lang-code { font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.lang-btn:hover, .theme-btn:hover { color: var(--gold-2); }
.me-info { flex: 1; min-width: 0; line-height: 1.3; }
.me-info small { display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--gold-2); font-weight: 600; flex: none; }

.page { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.topbar-end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scope { display: flex; align-items: center; gap: 8px; min-width: 0; }
.client-select { width: auto; min-width: 180px; max-width: 280px; }
.branch-select { width: auto; min-width: 140px; max-width: 220px; }
.bell { position: relative; width: 38px; height: 38px; color: var(--text-2); }
.bell:hover { color: var(--gold-2); }
.bell .badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--gold-grad); color: var(--gold-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.toolbar:empty { display: none; }
.toolbar select, .toolbar input:not([type=checkbox]) { width: auto; min-height: 32px; padding: 4px 10px; }
.toolbar input.search { width: 290px; }
.range { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }
.content { padding: 20px 24px 40px; min-width: 0; flex: 1; }
.list-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
/* Wide tables scroll sideways on small screens with an always-visible bar (like the board). */
.table-wrap::-webkit-scrollbar, .import-preview::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap::-webkit-scrollbar-track, .import-preview::-webkit-scrollbar-track { background: var(--surface); }
.table-wrap::-webkit-scrollbar-thumb, .import-preview::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 999px; border: 2px solid var(--surface); }
@supports not selector(::-webkit-scrollbar) { .table-wrap, .import-preview { scrollbar-color: var(--gold-deep) var(--surface); } }
.table td.cell-text { white-space: normal; min-width: 96px; max-width: 200px; }
.table td.cell-text.wide { max-width: 240px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 9px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[tabindex] { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
tr.inactive { opacity: .55; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* ---------- board ---------- */

.view-board { padding: 16px 24px; overflow: hidden; }
/* All six statuses side by side; below ~1250px the board scrolls sideways with a visible bar. */
.board { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; height: calc(100vh - 150px); }
.board::-webkit-scrollbar { height: 10px; }
.board::-webkit-scrollbar-track { background: var(--surface); border-radius: 999px; border: 1px solid var(--line); }
.board::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 999px; border: 2px solid var(--surface); }
.board::-webkit-scrollbar-thumb:hover { background: var(--gold); }
@supports not selector(::-webkit-scrollbar) { .board { scrollbar-color: var(--gold-deep) var(--surface); } }
.col { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .12s, opacity .12s, background .12s; }
.col { min-width: 0; }
.col header { display: flex; align-items: center; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); font-weight: 600; flex-wrap: wrap; }
.col-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-value { flex-basis: 100%; }
.col .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-body { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.board.dragging .col.no { opacity: .4; }
.board.dragging .col.ok { border-color: var(--line-strong); border-style: dashed; }
.col.over { border-color: var(--gold) !important; background: var(--drop-bg); }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, transform .12s; }
.card:hover { border-color: var(--line-strong); }
.card[draggable=true] { cursor: grab; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; min-width: 0; }
.card-top strong { min-width: 0; flex: 1 1 110px; }
.card-top .chip { flex: none; max-width: 100%; }
.card-foot { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.card-foot > :first-child { flex: 1; min-width: 0; }
.card-foot > :last-child { flex: none; white-space: nowrap; }
.card .booking { color: var(--gold-2); display: flex; align-items: center; gap: 4px; }
.more { text-align: center; padding: 6px; }

/* ---------- drawer ---------- */

.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100vw); z-index: 40;
  background: var(--surface); border-inline-start: 1px solid var(--line-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .2s ease; }
.drawer.open { transform: none; }
html[dir=ltr] .drawer { transform: translateX(100%); }
html[dir=ltr] .drawer.open { transform: none; }
.drawer .loading { padding: 40px; text-align: center; color: var(--muted); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.drawer-body section h3 { margin-bottom: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.status-now, .status-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-btn { border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.st-btn:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.conv-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line-strong); }
.ev { position: relative; padding: 4px 16px 14px; }
.ev::before { content: ''; position: absolute; inset-inline-start: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-strong); }
.ev-note::before { }
.ev.ev-note::before { background: var(--gold); border-color: var(--gold); }
.ev.ev-status::before { background: var(--gold-2); border-color: var(--gold-2); }
.ev-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ev-note { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }

/* ---------- modal / toast / tooltip ---------- */

.overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.modal.wide { width: min(980px, 100%); }
.modal { width: min(620px, 100%); max-width: 100%; min-width: 0; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); }
.modal header, .modal footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.modal header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--line-strong); border-inline-start: 3px solid var(--gold); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; max-width: 90vw; }
.toast.err { border-inline-start-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); }
.tooltip { position: fixed; z-index: 90; pointer-events: none; background: var(--tooltip-bg); color: var(--tooltip-ink); border: 1px solid var(--line-strong); padding: 5px 9px; border-radius: 6px; font-size: 12.5px; max-width: 320px; white-space: pre-wrap; }

/* ---------- dashboard ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.tile-label, .tile-sub { overflow-wrap: anywhere; }
.money .cur { font-size: .55em; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.tile-label { color: var(--text-2); font-size: 13px; }
.tile-value { font-size: 26px; font-weight: 600; margin-top: 4px; color: var(--text); line-height: 1.25; overflow-wrap: anywhere; }
.tile-sub { font-size: 12px; margin-top: 2px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.strip-item { display: inline-flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel .table-wrap { border: 0; border-radius: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars-cell { width: 34%; min-width: 160px; }
.fbars { display: flex; flex-direction: column; gap: 2px; }
.fbar-track { height: 8px; display: flex; }
.fbar { height: 100%; border-radius: 0 4px 4px 0; }
[dir=rtl] .fbar { border-radius: 4px 0 0 4px; }
.chart-wrap { width: 100%; min-height: 190px; }
.chart { display: block; }
.chart .chart-empty { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--gold); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--hover-fill); }
.conv-sum { display: flex; flex-direction: column; gap: 6px; }

/* ---------- today ---------- */

.view-today { max-width: 900px; }
.day-title { margin-inline-start: 8px; }
.today-list { display: flex; flex-direction: column; gap: 10px; }
.booking-row { display: grid; grid-template-columns: minmax(76px, auto) 1fr auto auto; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.b-time { font-size: 17px; font-weight: 600; color: var(--gold-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.b-main { cursor: pointer; min-width: 0; }
.b-tags, .b-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-row-attended { border-inline-start: 3px solid var(--st-attended); }
.st-row-no_show { border-inline-start: 3px solid var(--st-no_show); opacity: .8; }

/* ---------- settings ---------- */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { white-space: nowrap; }
.tabs a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-2); }
.tabs a.active { background: var(--surface-3); color: var(--gold-2); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.client-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.client-card.inactive { opacity: .6; }
.client-card h3 { color: var(--text); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.copy-row { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding-block: 4px; padding-inline: 8px 4px; }
.copy-row code { flex: 1; min-width: 0; color: var(--text-2); }
.help summary { cursor: pointer; color: var(--gold-2); }
.help { margin-top: 16px; }
.client-checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.client-checks legend { color: var(--text-2); font-size: 12.5px; padding: 0 4px; }

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; top: auto; inset-inline: 0; height: auto; z-index: 30; flex-direction: row; padding: 6px; border: 0; border-top: 1px solid var(--line); gap: 0; }
  .sidebar .brand, .me-info { display: none; }
  .me { border: 0; padding: 0; }
  /* Bottom bar: pages + avatar only (language and sign-out live on the profile page), every item
     gets an equal share and a short label of up to two lines. */
  .nav { flex-direction: row; justify-content: space-around; min-width: 0; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; line-height: 1.25; padding: 5px 2px; flex: 1 1 0; min-width: 0; text-align: center; }
  .nav-full { display: none; }
  .nav-short { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; max-width: 100%; }
  .me .lang-btn, .me .theme-btn, .me .logout-btn { display: none; }
  .me-link { margin: 0; padding: 0; }
  .sidebar { gap: 4px; }
  .nav a.active { box-shadow: none; }
  .page { padding-bottom: 64px; }
  .topbar, .toolbar, .content, .view-board { padding-inline: 16px; }
  .toolbar input.search { width: 100%; }
  /* One full column per screen, snapping on swipe (no half-visible neighbour). */
  .board { height: calc(100vh - 230px); grid-template-columns: repeat(6, calc(100vw - 32px)); scroll-snap-type: x mandatory; gap: 16px; }
  .board .col { scroll-snap-align: start; }
  .topbar { flex-wrap: wrap; }
  .topbar-end { width: 100%; }
  .scope { flex: 1; }
  .scope select { flex: 1; min-width: 0; max-width: none; }
  .me-link { flex: none; }
  .avatar { display: grid; }
  .grid2 { grid-template-columns: 1fr; }
  .booking-row { grid-template-columns: auto 1fr; }
  .b-time { white-space: nowrap; }
  .b-tags, .b-actions { grid-column: 1 / -1; }
  .b-actions .btn { flex: 1; }
  .cards-grid { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .client-select { min-width: 0; max-width: 55vw; }
}

/* ---------- WhatsApp menu & contact buttons ---------- */

.btn.icon-only { width: 30px; padding: 0; }
.row-actions { display: flex; gap: 4px; }
.menu { position: fixed; z-index: 70; min-width: 240px; max-width: min(340px, calc(100vw - 16px)); max-height: 60vh; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: start;
  padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item.sep { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 4px; }
.menu-title { font-weight: 500; }
.menu-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.warn-text { color: var(--warn); }
.late { color: var(--warn-ink); }
.status-btns.follow strong { font-weight: 600; }

/* ---------- call list / no-shows ---------- */

.view-followups { max-width: 1100px; }
.call-section { margin-bottom: 22px; }
.call-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.call-section h3 .count { color: var(--muted); font-weight: 500; }
.call-section.overdue h3 { color: var(--warn-ink); }
.call-list, .call-section { display: flex; flex-direction: column; gap: 8px; }
.call-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto minmax(160px, 1.4fr) auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.call-section.overdue .call-row { border-inline-start: 3px solid var(--st-no_show); }
.call-info { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; color: var(--text-2); }
.call-info .ellipsis { flex-basis: 100%; }
.warn-chip { color: var(--warn-ink); background: var(--warn-bg); }

/* ---------- response-time bars ---------- */

.hbars { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 90px; align-items: center; gap: 12px; font-size: 13px; }
.hbar-track { height: 12px; display: flex; }
.hbar { height: 100%; background: var(--gold); border-radius: 4px 0 0 4px; min-width: 2px; }
html[dir=ltr] .hbar { border-radius: 0 4px 4px 0; }
.hbar-row .num { font-variant-numeric: tabular-nums; }

/* ---------- templates ---------- */

select.auto { width: auto; min-width: 200px; }
.tpl-card { display: flex; flex-direction: column; gap: 12px; }
.tpl-edit { display: flex; flex-direction: column; gap: 10px; }
.wa-preview { margin-top: 4px; background: var(--wa-bg); border: 1px solid var(--wa-line); color: var(--wa-ink); border-radius: 10px 10px 2px 10px;
  padding: 10px 12px; white-space: pre-wrap; min-height: 80px; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-btn { cursor: pointer; border: 1px solid var(--line-strong); font-family: var(--font); }
.chip-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.end.gap { gap: 8px; }
.section-title { margin: 18px 0 10px; }

@media (max-width: 860px) {
  .call-row { grid-template-columns: 1fr auto; }
  .call-info, .call-row .b-actions { grid-column: 1 / -1; }
  .hbar-row { grid-template-columns: 96px 1fr 70px; }
}

/* ---------- work hours ---------- */

.hours-panel { display: flex; flex-direction: column; gap: 14px; }
.modes { display: flex; gap: 20px; }
.hours-grid { display: flex; flex-direction: column; gap: 6px; }
.hours-day { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.hours-day.closed { opacity: .6; }
.day-name { font-weight: 500; color: var(--text); }
.shifts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.shift { display: inline-flex; align-items: center; gap: 6px; }
.shift input[type=time] { width: 120px; }
@media (max-width: 860px) { .hours-day { grid-template-columns: 1fr; } }

/* ---------- settings: client cards, branches, connection guide ---------- */

.gap-row { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.kv > span:nth-child(even) { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-2); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.form-section { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); }
.branches-editor { display: flex; flex-direction: column; gap: 10px; }
.branch-list { display: flex; flex-direction: column; gap: 6px; }
.branch-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.branch-row.add { grid-template-columns: 1fr auto; padding-top: 10px; border-top: 1px solid var(--line); }
.branch-row.inactive input:not([type=checkbox]) { opacity: .6; }
.guide { display: flex; flex-direction: column; gap: 10px; }
.guide h3 { color: var(--text); margin-top: 8px; }
.steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.copy-block { display: flex; flex-direction: column; gap: 4px; }
.copy-block-head { display: flex; justify-content: space-between; align-items: center; }
.copy-block pre { margin: 0; max-height: 260px; overflow-y: auto; }
.help ul { margin: 6px 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- import ---------- */

.import { display: flex; flex-direction: column; gap: 14px; }
.import-map { display: flex; flex-direction: column; gap: 8px; }
.import-map:empty, .import-summary:empty, .import-preview:empty { display: none; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.import-preview { max-height: 320px; overflow: auto; }

/* ---------- dashboard: team ---------- */

.rate { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.rate .num { min-width: 38px; }
.rate-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; display: flex; }
.rate-bar { height: 100%; background: var(--gold); border-radius: 999px; }
.rate-bar.alt { background: var(--gold-deep); }

/* ---------- profile / activity ---------- */

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; max-width: 900px; align-items: start; }
.profile-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.profile-card h3 { color: var(--text); }
.view-activity { max-width: 1000px; }
.activity-list .ev { padding-bottom: 12px; }
.ev.ev-system::before { background: var(--surface-3); border-color: var(--gold-deep); }
.last-note { display: flex; align-items: center; gap: 4px; }

@media (max-width: 860px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .branch-row { grid-template-columns: 1fr auto; }
  .kv { grid-template-columns: 1fr; }
}

/* ---------- phones: tables as cards, tiles ---------- */

@media (max-width: 860px) {
  .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  /* Label on one side, the cell's content stacked on the other. */
  .table td, .table td.cell-text, .table td.cell-text.wide { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); column-gap: 12px;
    align-items: center; padding: 4px 12px; border: 0; white-space: normal; max-width: none; min-width: 0; text-align: end; }
  .table td > * { grid-column: 2; justify-self: end; min-width: 0; max-width: 100%; }
  .table td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; color: var(--muted); font-size: 12px; text-align: start; }
  .table td[data-label=""] { display: flex; justify-content: flex-start; gap: 6px; }
  .table td[data-label=""]::before { content: none; }
  html[dir=rtl] .table td > :is(.clamp2, .ellipsis) { text-align: left; }
  html[dir=ltr] .table td > :is(.clamp2, .ellipsis) { text-align: right; }
  /* First cell = the row's title (name + phone): stacked, no label. */
  .table td:first-child { display: block; font-size: 15px; text-align: start; }
  .table td:first-child > * { text-align: inherit; }
  html[dir=rtl] .table td:first-child > :is(.clamp2, .sub) { text-align: right; }
  html[dir=ltr] .table td:first-child > :is(.clamp2, .sub) { text-align: left; }
  .table td:first-child::before { content: none; }
  .table td.empty { display: block; text-align: center; }
  .table .bars-cell { width: 100%; }
  .table .bars-cell .fbars { width: 100%; }
  .rate { flex: 1; max-width: 220px; }
}

/* Staging marker (never shown in production). */
.env-banner { background: repeating-linear-gradient(135deg, var(--env-a) 0 12px, var(--env-b) 12px 24px); color: var(--gold-3);
  border-bottom: 1px solid var(--gold-deep); padding: 6px 24px; font-size: 12.5px; font-weight: 600; text-align: center; }

.notice { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.notice.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.notice.err { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }

/* ---------- two-step verification ---------- */
.code-input { font: 600 22px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 6px; text-align: center !important; min-height: 48px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qr-box { display: grid; place-items: center; padding: 6px; }
.qr { border-radius: 8px; background: #fff; max-width: 100%; height: auto; }
.secret { display: block; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; letter-spacing: 1px; text-align: center; overflow-wrap: anywhere; user-select: all; }
.manual-key summary { cursor: pointer; color: var(--gold-2); }
.manual-key .secret { margin-top: 8px; }
.recovery { display: flex; flex-direction: column; gap: 10px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; padding: 12px 12px 12px 34px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; }
.grid1 { display: flex; flex-direction: column; gap: 12px; }
.enroll-inline { display: flex; flex-direction: column; gap: 12px; }
.enroll-inline h1 { font-size: 16px; }
.user-resets { padding-top: 10px; border-top: 1px solid var(--line); }

.rules { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }

/* ---------- privacy policy (static page) ---------- */
.doc-page { min-height: 100%; }
.doc { max-width: 820px; margin: 0 auto; padding: 24px 20px 64px; line-height: 1.8; }
.doc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.doc h1 { font-size: 24px; margin-bottom: 4px; }
.doc h2 { font-size: 17px; margin: 26px 0 8px; color: var(--gold-2); }
.doc ul { padding-inline-start: 22px; margin: 0; }
.doc li { margin: 4px 0; }
.doc hr { border: 0; border-top: 1px solid var(--line-strong); margin: 40px 0; }

.alert-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.alert-steps li { overflow-wrap: anywhere; }

.lp-editor input[type=color] { min-height: 40px; padding: 4px; cursor: pointer; }
.lp-editor [hidden] { display: none !important; }
.lp-clinic { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.lp-clinic h3 { margin: 0; font-size: 15px; }
.lp-hint { display: block; margin: 2px 0 8px; }
.lp-cases { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.lp-case { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.lp-case-text { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.lp-slot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lp-thumb { width: 84px; height: 84px; border-radius: 8px; border: 1px dashed var(--line-strong); display: grid; place-items: center; overflow: hidden; text-align: center; }
.lp-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .lp-case { grid-template-columns: auto auto; } .lp-case-text { grid-column: 1 / -1; } }

.platforms { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.platform-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.platform-main { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.platform-main > div { flex-basis: 100%; }
.err-text { color: var(--err-ink); }

.view { min-width: 0; }


/* ---------- install the app ---------- */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--gold-deep); }
.install-banner img { flex: none; }
.install-text { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.install { display: flex; flex-direction: column; gap: 14px; }
.install-os { display: flex; flex-direction: column; gap: 10px; }
.install-os h3 { color: var(--text); }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: var(--gold-ink); font-weight: 700; font-size: 13px; }
.inline-icon { vertical-align: middle; color: var(--gold-2); }
.install-more summary { cursor: pointer; color: var(--gold-2); }
.install-more[open] { display: flex; flex-direction: column; gap: 14px; }

/* ---------- one hand on phones: thumb-size targets, actions at the bottom ---------- */
.drawer-foot, .fab { display: none; }
.quick-contact { display: contents; }
@media (max-width: 860px) {
  /* 16px stops iPhone Safari from zooming into fields on focus. */
  input, select, textarea { font-size: 16px; }
  .b-actions .btn, .call-row .btn, .status-btns .btn, .drawer .btn, .booking-row .btn, .modal footer .btn, .pager .btn { min-height: 44px; }
  .btn.icon-only { width: 44px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .call-row .b-actions, .booking-row .b-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  .call-row .b-actions .btn, .booking-row .b-actions .btn { width: 100%; }
  .sidebar { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .page { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* Lead window: contact + next step in a bottom bar */
  .drawer .quick-contact { display: none; }
  .drawer-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-strong); background: var(--surface-2); }
  .drawer-foot .btn { min-height: 48px; }
  .drawer-foot .btn.icon-only { width: 48px; height: 48px; padding: 0; }
  .drawer-foot .grow { flex: 1; min-width: 0; }
  /* Round, icon only (label for screen readers): covers as little of the list as possible. */
  .fab { position: fixed; inset-inline-end: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 25; display: grid; place-items: center;
    width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 0; background: var(--gold-grad); color: var(--gold-ink);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55); cursor: pointer; }
  .fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .view-today .today-list { margin-bottom: 84px; }
  .view-today .today-list, .view-leads .pager { margin-bottom: 70px; }
}

/* ---------- sign-in (shared Primoura look, after Primoura Center) ---------- */
.auth { --a-bg: #08090a; --a-surface: #0f1012; --a-ink: #f3f1ec; --a-ink2: #c4c1b9; --a-muted: #7d7a73; --a-faint: #4d4b47;
  --a-line: #1f2023; --a-line2: #2e2f33; --a-accent: #cfb27e; --a-accent-soft: #221d14; --a-glow: rgba(207, 178, 126, .26);
  --a-err: #e07a6c; color-scheme: dark;
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  background: var(--a-bg); color: var(--a-ink); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.auth.light { --a-bg: #f6f4ef; --a-surface: #fdfcf9; --a-ink: #141414; --a-ink2: #4a4945; --a-muted: #8a877f; --a-faint: #b5b1a7;
  --a-line: #e4e0d6; --a-line2: #cfc9bb; --a-accent: #9a7b4f; --a-accent-soft: #efe6d6; --a-glow: rgba(154, 123, 79, .26);
  --a-err: #b4483c; color-scheme: light; }
.auth.light .on-dark, .auth:not(.light) .on-light { display: none !important; }
.auth-side { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 32px 64px; }
.auth-side > .aura { display: none; opacity: .55; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-tools { display: flex; gap: 8px; }
.auth-mark { display: inline-flex; align-items: center; gap: 12px; }
.auth-mark > img { width: 48px; height: 48px; filter: drop-shadow(0 2px 8px rgba(180, 140, 60, .25)); }
.auth-word { display: block; height: 22px; width: auto; }
.auth-tag { display: block; margin-top: 6px; font-size: 11px; line-height: 1.2; color: var(--a-muted); }
.auth-icon-btn, .auth-pill { display: inline-grid; place-items: center; height: 40px; border-radius: 12px; border: 1px solid var(--a-line); background: transparent; color: var(--a-ink2); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; }
.auth-icon-btn { width: 40px; }
.auth-pill { padding: 0 14px; }
.auth-icon-btn:hover, .auth-pill:hover { border-color: var(--a-line2); color: var(--a-ink); }
.auth-ico { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.auth:not(.light) .auth-ico:last-child, .auth.light .auth-ico:first-child { display: none; }
.auth-body { width: 100%; max-width: 384px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; animation: auth-in .5s cubic-bezier(.2, .7, .2, 1) both; }
.auth-eyebrow { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--a-muted); }
html[dir=rtl] .auth-eyebrow { letter-spacing: 0; }
.auth-title { margin: 12px 0 0; font: 300 32px/1.25 'IBM Plex Sans Arabic', system-ui, sans-serif; color: var(--a-ink); }
.auth-title span { display: block; color: var(--a-accent); }
.auth-form { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-form .field { gap: 8px; }
.auth-form .field-label { font-size: 13px; font-weight: 400; color: var(--a-ink2); }
.auth-form p, .auth-form .muted { color: var(--a-muted); }
.auth-form input:not([type=checkbox]) { min-height: 48px; padding: 12px 16px; border-radius: 12px; border-color: var(--a-line); background: var(--a-surface); color: var(--a-ink); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.auth-form input::placeholder { color: var(--a-faint); }
.auth-form input:focus { border-color: var(--a-accent); box-shadow: 0 0 0 4px var(--a-accent-soft); }
.auth-form .code-input { min-height: 64px; font: 300 30px/1 'IBM Plex Sans Arabic', system-ui, sans-serif; letter-spacing: .5em; }
.auth-form .btn.primary { height: 48px; margin-top: 8px; border-radius: 12px; border: 0; background: var(--a-ink); color: var(--a-bg); font-size: 15px; font-weight: 500; gap: 8px; transition: opacity .15s; }
.auth-form .btn.primary:hover { filter: none; opacity: .9; }
.auth-form .btn .icon { fill: none; stroke: currentColor; stroke-width: 1.5; }
html[dir=ltr] .auth-form .btn .icon { transform: scaleX(-1); }
.auth-form .form-error:not(:empty) { padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--a-err) 10%, transparent); color: var(--a-err); }
.auth-form .form-error:empty { display: none; }
.auth-form .link-btn { color: var(--a-muted); }
.auth-form .link-btn:hover { color: var(--a-ink); }
.auth-form .auth-links .link-btn:first-child { color: var(--a-accent); }
.auth-legal { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--a-muted); }
.auth-legal a { color: var(--a-muted); }
.auth-legal a:hover { color: var(--a-accent); text-decoration: none; }
.auth-show { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 56px; border-inline-start: 1px solid var(--a-line); background: var(--a-surface); }
.auth-pitch { max-width: 28rem; }
.auth-pitch p:last-child { margin: 16px 0 0; font-size: 22px; line-height: 1.7; font-weight: 300; color: var(--a-ink2); }
.auth-figure { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.auth-facts { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 32px; border-top: 1px solid var(--a-line); font-size: 13px; }
.auth-facts dt { font-weight: 500; color: var(--a-ink); }
.auth-facts dd { margin: 4px 0 0; color: var(--a-muted); }
/* aura: three slow gold lights under a fine grain */
.aura { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aura-blob { position: absolute; border-radius: 9999px; filter: blur(70px); will-change: transform; }
.aura-a { inset-inline-start: -15%; top: -20%; width: 70%; aspect-ratio: 1; background: radial-gradient(circle, var(--a-glow), transparent 70%); animation: aura-a 26s ease-in-out infinite alternate; }
.aura-b { inset-inline-end: -20%; bottom: -25%; width: 80%; aspect-ratio: 1; background: radial-gradient(circle, var(--a-glow), transparent 70%); opacity: .85; animation: aura-b 32s ease-in-out infinite alternate; }
.aura-c { left: 30%; top: 35%; width: 45%; aspect-ratio: 1; background: radial-gradient(circle, color-mix(in srgb, var(--a-surface) 80%, transparent), transparent 70%); animation: aura-c 22s ease-in-out infinite alternate; }
.aura-grain { position: absolute; inset: 0; opacity: .1; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.auth.light .aura-grain { opacity: .07; mix-blend-mode: multiply; }
@keyframes aura-a { to { transform: translate(12%, 10%) scale(1.12); } }
@keyframes aura-b { to { transform: translate(-10%, -12%) scale(.92); } }
@keyframes aura-c { to { transform: translate(-18%, 8%) scale(1.2); } }
@keyframes auth-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .aura-blob, .auth-body { animation: none; } }
@media (max-width: 1023px) {
  .auth { grid-template-columns: 1fr; }
  .auth-show { display: none; }
  .auth-side > .aura { display: block; }
  .auth-side { padding: 24px; padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .auth-form input:not([type=checkbox]) { font-size: 16px; }
}

/* ---------- Primoura Flow: live journey map (js/flow.js) ---------- */
.flow-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.flow-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ok-ink);
  background: var(--ok-bg); padding: 3px 10px; border-radius: 99px; }
.flow-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: flow-blink 1.6s infinite; }
.flow-live.off { color: var(--muted); background: var(--surface-2); }
.flow-live.off i { animation: none; }
@keyframes flow-blink { 50% { opacity: .25; } }
.flow-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.flow-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.flow-stage { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background-color: var(--bg);
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.flow-sizer { position: relative; }
.flow-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; inset: 0; overflow: visible; }
.flow-edge { fill: none; stroke: var(--line-strong); stroke-width: 1.6; transition: stroke-width .3s; }
.flow-edge.tint { stroke-opacity: .45; }
.flow-edge.back { stroke-dasharray: 5 6; stroke-opacity: .55; }
.flow-edge.soon { stroke-dasharray: 3 5; }
.flow-edge.hot { stroke-width: 3; stroke-opacity: 1; }
.flow-tag rect { fill: var(--surface); stroke: var(--line-strong); }
.flow-tag text { fill: var(--text-2); font: 500 11.5px var(--font); }
.flow-node { position: absolute; width: 176px; height: 96px; display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; text-align: start;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); font: inherit; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .35s, box-shadow .35s, transform .25s; }
.flow-node:hover { transform: translateY(-1px); border-color: var(--gold-deep); }
.flow-node:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.flow-node.brand { background: linear-gradient(180deg, var(--gold-soft), transparent 70%), var(--surface); border-color: var(--gold-deep); }
.flow-node.soon { border-style: dashed; opacity: .82; }
.flow-node.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent), var(--shadow-sm); }
.flow-node.sel { border-color: var(--gold-2); }
.flow-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.flow-mark { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; font: 700 11px/1 var(--font); }
.flow-mark.dark { color: #1A1206; }
.flow-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.flow-count { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--gold-2); font-weight: 600; }
.flow-soon { position: absolute; top: -9px; inset-inline-end: 10px; font-size: 10.5px; line-height: 16px; color: var(--gold-2); background: var(--surface); border: 1px solid var(--gold-deep); border-radius: 99px; padding: 0 7px; }
.flow-rows { display: grid; gap: 2px; }
.flow-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.flow-row b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-side { display: grid; gap: 12px; min-width: 0; }
.flow-side .panel { margin: 0; }
.flow-feed { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; }
.flow-feed li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.flow-feed li:last-child { border-bottom: 0; }
.flow-feed li.in { animation: flow-in .45s ease; }
.flow-feed li > i { width: 8px; height: 8px; border-radius: 50%; }
.flow-feed time, .flow-log time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.flow-ev { display: grid; min-width: 0; }
@keyframes flow-in { from { opacity: 0; transform: translateY(-4px); } }
.flow-detail .flow-rows { margin: 8px 0; }
.flow-detail .flow-row { font-size: 13px; }
.flow-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.flow-log li { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
@media (max-width: 1700px) { .flow-main { grid-template-columns: minmax(0, 1fr); } .flow-side { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; } }
@media (max-width: 860px) { .flow-stage { height: 420px; } .flow-tools { margin-inline-start: 0; } }
@media (prefers-reduced-motion: reduce) { .flow-live i, .flow-feed li.in { animation: none; } .flow-node { transition: none; } }
.flow-mark .icon { stroke: currentColor; fill: none; stroke-width: 2.2; }

/* ---------- Primoura look (same components as Primoura Center) ---------- */
/* Lists marked .nav / .tabs get one marker that glides to the open item and a soft hover shape that
   follows the pointer (js/motion.js, after 21st.dev "Animated Sidebar" sidebar-001 by unlumen). */
body { font-size: 14px; line-height: 1.6; font-feature-settings: 'ss01'; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); }
a { color: var(--accent-ink); }

/* Titles take the display face (El Messiri / Cormorant Garamond). Cormorant's old-style figures would read
   1,430 as 1,43o, so lining figures are forced. */
.topbar h1, .modal header h2, .drawer-head h2, .display { font-family: var(--font-display); font-weight: 500; letter-spacing: 0;
  font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1, 'onum' 0; }
.topbar h1 { font-size: 26px; line-height: 1.2; color: var(--text); }
html[dir=ltr] .topbar h1 { font-size: 30px; }
h2 { font-weight: 500; }
h3 { font-weight: 500; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* Sidebar */
.layout { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { padding: 28px 12px 12px; gap: 28px; background: var(--surface); }
.sidebar .brand { padding: 0 12px; }
.brand { gap: 12px; }
.brand-mark { width: 44px; height: 44px; }
.brand-word { display: block; height: 22px; width: auto; }
.brand-word.on-dark { display: none; }
:root[data-theme="dark"] .brand-word.on-light { display: none; }
:root[data-theme="dark"] .brand-word.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-word.on-light { display: none; }
  :root:not([data-theme="light"]) .brand-word.on-dark { display: block; }
}
.brand-sub { margin-top: 6px; font-size: 11px; letter-spacing: .18em; color: var(--muted); }
.nav { gap: 2px; }
.nav a { position: relative; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 400; color: var(--text-2);
  transition: color .2s, opacity .2s; }
.nav a .icon { width: 18px; height: 18px; stroke-width: 1.4; transition: transform .3s var(--ease-out); }
.nav a:hover .icon { transform: scale(1.05); }
/* a hairline dash at the start edge that reaches in under the pointer */
.nav a:not(.active)::before { content: ''; position: absolute; top: 50%; inset-inline-start: 0; width: 6px; height: 1px; background: var(--line-strong);
  transition: width .3s, background-color .3s; }
.nav a:not(.active):hover::before { width: 10px; background: var(--accent); }
/* while the pointer is on one item, the others step back */
.nav:has(a:hover) a:not(:hover):not(.active) { opacity: .55; }
.nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active .icon { color: var(--accent); }
html[dir=ltr] .nav a.active { box-shadow: inset 0 0 0 1px var(--line); }

.glide { position: relative; isolation: isolate; }
.glide > a { position: relative; z-index: 1; }
.glide-pill, .glide-hover { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; border-radius: var(--radius-sm);
  transition: transform .4s cubic-bezier(.3, 1.15, .5, 1), width .3s var(--ease-out), height .3s var(--ease-out), opacity .2s; }
.glide-still .glide-pill, .glide-still .glide-hover { transition: none; }
.glide-pill { background: var(--pill-bg); box-shadow: var(--pill-shadow), inset 0 0 0 1px var(--line); }
.nav .glide-pill::after { content: ''; position: absolute; top: 10px; bottom: 10px; inset-inline-start: -1px; width: 2px; border-radius: 2px; background: var(--accent); }
.glide-hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); opacity: 0; }
.glide-hover.on { opacity: 1; }
.glide > a:hover, .nav.glide a.active, .tabs.glide a.active { background: transparent; box-shadow: none; }
.nav a, .tabs a { text-decoration: none !important; }

/* Account card at the foot of the sidebar */
.me { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.me-link:hover { background: transparent; }
.me-link:hover .ellipsis { color: var(--accent-ink); }
.avatar { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.lang-btn:hover, .theme-btn:hover { color: var(--accent-ink); }

/* Top bar: a quiet glass band */
.topbar { position: sticky; top: 0; z-index: 25; min-height: 64px; padding: 10px 32px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.toolbar { padding: 14px 32px; }
.content { padding: 28px 32px 48px; }
.view-board { padding: 20px 32px; }
.content > .view { animation: view-in .3s var(--ease-out) backwards; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* Controls */
.btn { height: 40px; padding: 0 18px; gap: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--text);
  font-weight: 500; transition: background-color .15s, border-color .15s, opacity .15s, transform .12s var(--ease-out); }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; }
.btn.primary:hover { background: var(--text); opacity: .9; filter: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 48px; font-weight: 500; }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: var(--err-bg); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--surface-2); }
.topbar .bell { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.bell .badge { background: var(--accent); color: var(--surface); font-weight: 600; }

input, select, textarea { min-height: 40px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A877F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center / 14px; padding-inline-end: 34px; }
html[dir=ltr] select { background-position: right 12px center; }
.toolbar select, .toolbar input:not([type=checkbox]) { min-height: 38px; padding: 6px 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--text); }
@supports (appearance: base-select) {
  select { padding-inline-end: 34px; }
  select:not([multiple]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A877F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
  select::picker-icon { display: none; }
  select:open { border-color: var(--accent); }
  ::picker(select) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; box-shadow: var(--shadow); }
  select option { padding: 8px 12px; border-radius: 8px; }
  select option:hover, select option:focus-visible { background: var(--surface-2); color: var(--text); }
  select option:checked { background: var(--surface-2); color: var(--text); font-weight: 500; }
  select option::checkmark { color: var(--accent); }
}
.field-label { font-size: 12px; color: var(--muted); font-weight: 400; }

/* Segmented tabs: a thin frame and one raised pill that slides */
.tabs { display: inline-flex; width: fit-content; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 16px; border-radius: 8px; font-size: 13px; color: var(--muted); transition: color .2s; }
.tabs a:hover { color: var(--text); background: transparent; }
.tabs a.active { color: var(--text); background: var(--surface-2); font-weight: 400; }
.tabs .glide-pill { border-radius: 8px; box-shadow: var(--pill-shadow); }

/* Cards: one hairline, generous corners, no shadow */
.panel, .tile, .table-wrap, .col, .booking-row, .status-box { border-radius: var(--radius); border-color: var(--line); box-shadow: none; }
.panel { padding: 24px; }
.panel-head h2, .panel > h2 { font-size: 16px; }
.tile { padding: 20px 24px; background: var(--surface); }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-family: var(--font); font-size: 32px; font-weight: 300; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.tile-sub { color: var(--muted); }
.card { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; }
.card:hover { border-color: var(--line-strong); }
.col { background: color-mix(in srgb, var(--surface-2) 45%, var(--bg)); }
.col header { border-bottom: 0; padding: 14px 14px 8px; font-weight: 500; }
.col-title { font-family: var(--font); }
.b-time { font-family: var(--font); font-weight: 400; color: var(--text); }

/* Tables */
.table th { font-size: 11px; font-weight: 400; color: var(--muted); padding: 12px 14px; }
.table td { padding: 14px; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.table-wrap::-webkit-scrollbar-thumb, .board::-webkit-scrollbar-thumb { background: var(--line-strong); }
@supports not selector(::-webkit-scrollbar) { .table-wrap, .import-preview, .board { scrollbar-color: var(--line-strong) transparent; } }

/* Chips: a dot and a label inside a hairline pill */
.chip { height: 24px; line-height: 22px; padding: 0 10px; font-size: 11.5px; font-weight: 400; background: transparent; color: var(--text-2); border-color: var(--line); }
.chip[class*="st-"] { background: transparent; color: var(--text-2); border-color: var(--line); }
.chip[class*="st-"]::before { width: 6px; height: 6px; }

/* Menus and dialogs */
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); animation: pop-in .2s var(--ease-out) both; }
.menu-item { border-radius: 8px; }
.overlay { background: var(--overlay); animation: fade-in .2s ease both; }
.modal { border-radius: var(--radius); border-color: var(--line); animation: pop-in .24s var(--ease-out) both; }
.modal header, .modal footer { padding: 18px 24px; }
.modal-body { padding: 24px; }
.drawer { border-inline-start-color: var(--line); }
.toast { background: var(--text); color: var(--bg); border: 0; border-radius: var(--radius-sm); }
.toast.err { background: var(--danger); color: #FFFFFF; }
.tooltip { border: 0; border-radius: 8px; }
@keyframes pop-in { from { opacity: 0; transform: scale(.97) translateY(4px); } }
@keyframes fade-in { from { opacity: 0; } }

/* Phones: a light bottom bar with a raised pill on the open page */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { padding: 6px; gap: 4px; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .nav a { padding: 6px 2px; gap: 2px; font-size: 10.5px; }
  .nav a::before, .nav .glide-pill::after { content: none !important; }
  .nav:has(a:hover) a:not(:hover):not(.active) { opacity: 1; }
  .me { margin: 0; padding: 0; border: 0; }
  .topbar, .toolbar, .content, .view-board { padding-inline: 16px; }
  .topbar h1, html[dir=ltr] .topbar h1 { font-size: 22px; }
  .content { padding-top: 20px; }
  .tile-value { font-size: 26px; }
  .panel { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .glide-pill, .glide-hover, .glide > a, .btn, .nav a, .nav a .icon, .nav a::before { transition: none; }
  .content > .view, .menu, .modal, .overlay { animation: none; }
}
