/* Tajawal, served with the dashboard. Its own metrics put the letters about a quarter of an em above the
   middle of the line; the overrides below centre text (Arabic and Latin) in buttons, badges and fields. */
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/dashboard/tajawal-400-arabic.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/dashboard/tajawal-400-latin.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/dashboard/tajawal-500-arabic.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/dashboard/tajawal-500-latin.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/dashboard/tajawal-700-arabic.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/dashboard/tajawal-700-latin.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/dashboard/tajawal-800-arabic.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/dashboard/tajawal-800-latin.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;
  ascent-override: 85%; descent-override: 25%; line-gap-override: 0%; }

:root {
  --bg: #f6f5fa;
  --surface: #ffffff;
  --surface-2: #f1eff8;
  --ink: #14112a;
  --ink-2: #3a3654;
  --muted: #625e7a;
  --line: #e1ddee;
  --accent: #5f33e4;
  --accent-ink: #ffffff;
  --accent-soft: #ece6ff;
  --chart: #5f33e4;
  --grid: #ecebf2;
  --ok: #0d7346;
  --ok-soft: #e4f5ec;
  --warn: #925600;
  --warn-soft: #fdf1dc;
  --bad: #b42a3e;
  --bad-soft: #fde8eb;
  --shadow: 0 1px 2px rgba(23, 20, 42, .04), 0 4px 16px rgba(23, 20, 42, .05);
  --radius: 14px;
  color-scheme: light;
}
/* dark: chosen in the top bar, or following the system when nothing was chosen */
:root[data-theme="dark"] {
  --bg: #0f0e15;
  --surface: #18161f;
  --surface-2: #211e2b;
  --ink: #f1eff8;
  --ink-2: #c9c5da;
  --muted: #8f8aa6;
  --line: #2b2837;
  --accent: #8a6cf5;
  --accent-soft: #2a2340;
  --chart: #8a6cf5;
  --grid: #26232f;
  --ok: #4cc58a;
  --ok-soft: #15291f;
  --warn: #e7a53c;
  --warn-soft: #2c2312;
  --bad: #f0707f;
  --bad-soft: #2f171c;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e15;
    --surface: #18161f;
    --surface-2: #211e2b;
    --ink: #f1eff8;
    --ink-2: #c9c5da;
    --muted: #8f8aa6;
    --line: #2b2837;
    --accent: #8a6cf5;
    --accent-soft: #2a2340;
    --chart: #8a6cf5;
    --grid: #26232f;
    --ok: #4cc58a;
    --ok-soft: #15291f;
    --warn: #e7a53c;
    --warn-soft: #2c2312;
    --bad: #f0707f;
    --bad-soft: #2f171c;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-weight: 700; font-size: 19px; padding: 0 8px; letter-spacing: -.2px; }
.brand span { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav-count { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.nav-label { font-size: 12px; color: var(--muted); padding: 8px 10px 2px; }
.sidebar-foot { margin-top: auto; font-size: 13px; color: var(--muted); padding: 0 8px; }
.sidebar-foot button { margin-top: 6px; }

.main { min-width: 0; overflow-x: clip; } /* a wide child never pushes the page sideways */
.topbar {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; margin: 0; }
.theme-btn { flex: none; }

html, body { overflow-x: hidden; }

/* ---------- language ---------- */
.lang-wrap { position: relative; flex: none; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.lang-btn svg { width: 16px; height: 16px; color: var(--muted); }
.lang-btn:hover, .lang-wrap.open .lang-btn { border-color: var(--accent); background: var(--accent-soft); }
.lang-wrap.open .lang-btn svg { color: var(--accent); }
.lang-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 45; width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(20, 17, 42, .18);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top; pointer-events: none; visibility: hidden;
  transition: opacity .16s ease, transform .16s ease, visibility 0s .16s; }
.lang-wrap.open .lang-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .16s ease, transform .16s ease; }
.lang-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; text-align: start; }
.lang-option:hover, .lang-option:focus-visible { background: var(--surface-2); outline: none; }
.lang-option.on { background: var(--accent-soft); color: var(--accent); }
.lang-code { flex: none; width: 30px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; }
.lang-option.on .lang-code { background: var(--accent); color: #fff; }
.lang-name { flex: 1; }
.lang-check { font-size: 15px; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .lang-panel { transition: none; } }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
[dir="ltr"] .tabbar .tab:first-child svg { transform: scaleX(-1); } /* back points left in LTR */

/* ---------- inside the Android/iOS app ---------- */
.tabbar { display: none; }
.in-app .tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  position: fixed; inset-inline: 0; bottom: 0; z-index: 25;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px;
  background: none; border: 0; color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--accent); }
.tabbar .tab:active { background: var(--surface-2); }
.in-app .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.in-app .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
.in-app .menu-btn { display: none; }           /* the menu is in the bottom bar */
.in-app .sidebar { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ---------- notifications (bell) ---------- */
.bell-wrap { position: relative; flex: none; }
.bell-btn { position: relative; display: inline-flex; padding: 7px; }
.bell-btn svg { width: 21px; height: 21px; }
.bell-btn.has-new { color: var(--ink); }
.bell-count {
  position: absolute; top: -3px; inset-inline-start: 19px; direction: ltr; unicode-bidi: bidi-override;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; border: 2px solid var(--surface);
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 14px; text-align: center;
}
.bell-btn.ring svg { animation: bell-ring .9s ease 2; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .bell-btn.ring svg { animation: none; } }
.bell-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40;
  width: 370px; max-width: calc(100vw - 24px); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(20, 17, 42, .18);
}
.bell-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bell-head span { font-size: 12px; color: var(--muted); }
.bell-list { list-style: none; margin: 0; padding: 6px; }
.bell-item { display: flex; gap: 11px; align-items: flex-start; padding: 10px; border-radius: 10px; color: var(--ink); position: relative; }
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item.unread { background: var(--accent-soft); }
.bell-item.unread::after { content: ""; position: absolute; top: 16px; inset-inline-end: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.bell-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.bell-ic svg { width: 18px; height: 18px; }
.k-booking .bell-ic { color: var(--ok); background: var(--ok-soft); }
.k-callback .bell-ic, .k-alert .bell-ic { color: var(--warn); background: var(--warn-soft); }
.k-alert .bell-ic { color: var(--bad); background: var(--bad-soft); }
.bell-text { display: flex; flex-direction: column; min-width: 0; padding-inline-end: 14px; }
.bell-title { font-weight: 600; font-size: 14px; line-height: 1.5; }
.bell-body { font-size: 13px; color: var(--ink-2); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bell-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bell-foot { display: block; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; position: sticky; bottom: 0; background: var(--surface); }
.alert-table td:not(:first-child), .alert-table th:not(:first-child) { text-align: center; width: 90px; }
.alert-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.steps { margin: 0; padding-inline-start: 22px; line-height: 1.9; }
.astra-item.open { border-color: var(--warn); }
.astra-transcript { margin-top: 10px; }
.astra-transcript summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.bell-empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .bell-panel { position: fixed; top: 58px; inset-inline: 12px; width: auto; max-width: none; }
}
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1240px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 20;
    transform: translateX(100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  [dir="ltr"] .sidebar:not(.open) { transform: translateX(-100%); } /* French / English: the menu hides to the left */
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
}

/* ---------- primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) { .grid.two { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600;
  cursor: pointer; background: var(--accent); color: var(--accent-ink); white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: var(--bad); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; display: block; flex: none; }

label.field { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.field > span { display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2); font-weight: 600; font-size: 13px;
}
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.plain::before { display: none; }
.lang-status { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tpl-lang { background: var(--surface-2); color: var(--muted); font-weight: 700; direction: ltr; }
.tpl-lang.ok { background: var(--ok-soft); color: var(--ok); }
.tpl-lang.warn { background: var(--warn-soft); color: var(--warn); }
.tpl-lang.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- stats ---------- */
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.hero .value { font-size: 48px; }

.meter { margin-top: 12px; }
.meter .track { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 999px; background: var(--accent); }
.meter.warn .track { background: var(--warn-soft); } .meter.warn .fill { background: var(--warn); }
.meter.bad .track { background: var(--bad-soft); } .meter.bad .fill { background: var(--bad); }
.meter .legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
.cell-main { font-weight: 600; }
td.num { white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 36px; height: 36px; opacity: .5; display: block; margin: 0 auto 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; color: var(--muted); font-size: 13px; }

/* ---------- chart ---------- */
.chart { position: relative; direction: ltr; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--chart); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.lift { filter: brightness(1.15); }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -115%);
}
.tooltip strong { font-size: 14px; display: block; }
.chart-table { margin-top: 12px; max-height: 240px; overflow-y: auto; }

/* ---------- transcript ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(10, 8, 20, .45); z-index: 30; }
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; width: min(560px, 100vw); background: var(--surface);
  z-index: 31; display: flex; flex-direction: column; box-shadow: var(--shadow); border-inline-start: 1px solid var(--line);
}
.drawer header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer header h3 { margin: 0; font-size: 16px; flex: 1; }
.drawer .body { padding: 20px; overflow-y: auto; flex: 1; }
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.bubble.user { background: var(--surface-2); align-self: flex-start; border-start-start-radius: 4px; }
.bubble.assistant { background: var(--accent-soft); align-self: flex-end; border-start-end-radius: 4px; }
.bubble.tool { align-self: center; background: none; color: var(--muted); font-size: 12px; padding: 2px 8px; border: 1px dashed var(--line); border-radius: 999px; }
.booking-box { border-inline-start: 3px solid var(--ok); background: var(--ok-soft); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { font-size: 22px; margin: 6px 0 4px; }
.auth p { color: var(--muted); margin: 0 0 20px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.error { color: var(--bad); font-size: 14px; min-height: 1.4em; }
.notice { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; }

/* ---------- misc ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 50; font-size: 14px;
}
.hours-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours-row:last-child { border-bottom: 0; }
.ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); padding: 4px 6px; border-radius: 10px; }
.range input { width: 132px; padding: 5px 8px; }
.service-row { display: grid; grid-template-columns: 2fr 110px 1fr 36px; gap: 8px; margin-bottom: 8px; }
.hours-row > * { min-width: 0; }
@media (max-width: 600px) {
  /* business hours on a phone: day name above its time ranges, each range full width */
  .hours-row { grid-template-columns: 1fr; gap: 6px; }
  .range { display: flex; width: 100%; box-sizing: border-box; }
  .range input { flex: 1; min-width: 0; width: auto; }
}
@media (max-width: 600px) { .service-row { grid-template-columns: 1fr 90px; } }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card .price { font-size: 24px; font-weight: 700; }
.plan-card ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.skeleton { opacity: .55; transition: opacity .2s; }

.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.check-dot.done { background: var(--ok); border-color: var(--ok); color: #fff; }

details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "◂"; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(-90deg); }

/* ---------- app intro + first-launch tour (intro.js) ---------- */
.wa-intro {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 35%, #3b2a8f 0%, #252f4b 55%, #161a2e 100%); color: #fff;
  transition: opacity .5s ease;
}
.wa-intro.out, .wa-tour.out { opacity: 0; pointer-events: none; }
.wa-glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; top: calc(50% - 230px);
  background: radial-gradient(circle, rgba(122, 82, 240, .55), transparent 65%); animation: wa-pulse 2.3s ease-out both; }
.wa-logo { width: 116px; position: relative; animation: wa-logo 1.1s cubic-bezier(.2, 1.3, .4, 1) .1s both;
  filter: drop-shadow(0 12px 30px rgba(95, 51, 228, .6)); }
.wa-word { margin-top: 26px; font: 800 30px/1 Inter, "Tajawal", sans-serif; letter-spacing: 7px; direction: ltr; position: relative;
  animation: wa-rise .7s ease .55s both; }
.wa-word b { color: #a78bfa; }
.wa-tag { margin-top: 14px; font-size: 16px; color: rgba(255, 255, 255, .72); position: relative; animation: wa-rise .7s ease .8s both; }
@keyframes wa-logo { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes wa-rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes wa-pulse { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; } 100% { opacity: .7; transform: scale(1.15); } }

.wa-tour { position: fixed; inset: 0; z-index: 99; background: var(--surface); color: var(--ink); overflow: hidden;
  display: flex; flex-direction: column; transition: opacity .35s ease; padding-bottom: env(safe-area-inset-bottom); }
.wa-skip { position: absolute; top: max(16px, env(safe-area-inset-top)); inset-inline-end: 16px; z-index: 2; background: none; border: 0;
  color: var(--muted); font: 600 15px "Tajawal", sans-serif; padding: 8px 10px; }
.wa-track { flex: 1; display: flex; transition: transform .45s cubic-bezier(.3, .8, .2, 1); }
.wa-slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px 32px 0; box-sizing: border-box; }
.wa-art { position: relative; width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 36px;
  background: linear-gradient(140deg, #7a52f0, #5f33e4 55%, #3cb8f3); box-shadow: 0 24px 60px rgba(95, 51, 228, .35); }
.wa-art svg { width: 76px; height: 76px; fill: #fff; position: relative; }
.wa-ring { position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(122, 82, 240, .25); }
.wa-slide.on .wa-art { animation: wa-art .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.wa-slide.on .wa-ring { animation: wa-ring 2.4s ease-out .3s infinite; }
.wa-slide h2 { font-size: 25px; margin: 0 0 12px; }
.wa-slide p { color: var(--ink-2); font-size: 16px; line-height: 1.8; margin: 0; max-width: 330px; }
.wa-slide.on h2, .wa-slide.on p { animation: wa-rise .6s ease .12s both; }
@keyframes wa-art { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wa-ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.wa-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 24px 28px; }
.wa-dots { display: flex; gap: 7px; }
.wa-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .3s, background .3s; }
.wa-dots i.on { width: 24px; background: var(--accent); }
.wa-next { border: 0; border-radius: 14px; padding: 14px 30px; min-width: 130px; color: #fff; font: 700 16px "Tajawal", sans-serif;
  background: linear-gradient(135deg, #7a52f0, #5f33e4); box-shadow: 0 10px 24px rgba(95, 51, 228, .35); }
.wa-lang { justify-content: center; align-items: center; padding: 32px 28px; gap: 34px; text-align: center; }
.wa-lang-logo { width: 84px; margin-bottom: 18px; }
.wa-lang-head h2 { font-size: 26px; margin: 0 0 6px; }
.wa-lang-head p { margin: 0; color: var(--muted); font-size: 15px; }
.wa-lang-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }
.wa-lang-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px 20px;
  font: 700 18px "Tajawal", Inter, sans-serif; cursor: pointer; transition: border-color .2s, background .2s; }
.wa-lang-btn:active, .wa-lang-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .wa-intro *, .wa-tour * { animation: none !important; transition: none !important; } }
