:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f1f3f5;
  --line: #e4e7eb;
  --line-strong: #d0d5dc;
  --ink: #16191d;
  --ink-2: #3d4450;
  --muted: #6b7280;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-text: #1a56b0;
  --accent-soft: #edf3fc;
  --accent-line: #9dbbe8;
  --bar: #6b93cf;
  --hot: #cf3b32;
  --hot-ink: #ffffff;
  --hot-text: #b42318;
  --hot-soft: #fdeeed;
  --hot-line: #f0b4ae;
  --warm: #c27c0e;
  --warm-text: #8a5208;
  --warm-soft: #fdf5e6;
  --warm-line: #ebcf9c;
  --cold: #5c7fa8;
  --cold-text: #34587f;
  --cold-soft: #f0f4f9;
  --cold-line: #c3d2e4;
  --good: #1f8a4c;
  --good-text: #17703d;
  --good-soft: #eaf6ef;
  --danger: #c0392b;
  --danger-line: #e9b1aa;
  --top-bg: #ffffff;
  --card-bg: #ffffff;
  --hover: #f7f8fa;
  --track: #eceff3;
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.12);
  --backdrop: rgba(16, 24, 40, 0.35);
  --glow: transparent;
  color-scheme: light;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --surface: #16191d;
    --surface-2: #16191d;
    --surface-3: #1f2328;
    --line: #262a30;
    --line-strong: #353a42;
    --ink: #e5e7ea;
    --ink-2: #b6bcc5;
    --muted: #868d98;
    --accent: #3b78d8;
    --accent-ink: #ffffff;
    --accent-text: #86aef0;
    --accent-soft: rgba(59, 120, 216, 0.15);
    --accent-line: rgba(134, 174, 240, 0.45);
    --bar: #4f7fc4;
    --hot: #e0574e;
    --hot-ink: #ffffff;
    --hot-text: #f0a29b;
    --hot-soft: rgba(224, 87, 78, 0.14);
    --hot-line: rgba(224, 87, 78, 0.45);
    --warm: #d19a2e;
    --warm-text: #e6c27a;
    --warm-soft: rgba(209, 154, 46, 0.13);
    --warm-line: rgba(209, 154, 46, 0.45);
    --cold: #7c9cc4;
    --cold-text: #a9c0de;
    --cold-soft: rgba(124, 156, 196, 0.13);
    --cold-line: rgba(124, 156, 196, 0.4);
    --good: #3aa56b;
    --good-text: #7fcfa2;
    --good-soft: rgba(58, 165, 107, 0.14);
    --danger: #e0574e;
    --danger-line: rgba(224, 87, 78, 0.45);
    --top-bg: #16191d;
    --card-bg: #16191d;
    --hover: #1b1f24;
    --track: #23282e;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --backdrop: rgba(0, 0, 0, 0.55);
    --glow: transparent;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1114;
  --surface: #16191d;
  --surface-2: #16191d;
  --surface-3: #1f2328;
  --line: #262a30;
  --line-strong: #353a42;
  --ink: #e5e7ea;
  --ink-2: #b6bcc5;
  --muted: #868d98;
  --accent: #3b78d8;
  --accent-ink: #ffffff;
  --accent-text: #86aef0;
  --accent-soft: rgba(59, 120, 216, 0.15);
  --accent-line: rgba(134, 174, 240, 0.45);
  --bar: #4f7fc4;
  --hot: #e0574e;
  --hot-ink: #ffffff;
  --hot-text: #f0a29b;
  --hot-soft: rgba(224, 87, 78, 0.14);
  --hot-line: rgba(224, 87, 78, 0.45);
  --warm: #d19a2e;
  --warm-text: #e6c27a;
  --warm-soft: rgba(209, 154, 46, 0.13);
  --warm-line: rgba(209, 154, 46, 0.45);
  --cold: #7c9cc4;
  --cold-text: #a9c0de;
  --cold-soft: rgba(124, 156, 196, 0.13);
  --cold-line: rgba(124, 156, 196, 0.4);
  --good: #3aa56b;
  --good-text: #7fcfa2;
  --good-soft: rgba(58, 165, 107, 0.14);
  --danger: #e0574e;
  --danger-line: rgba(224, 87, 78, 0.45);
  --top-bg: #16191d;
  --card-bg: #16191d;
  --hover: #1b1f24;
  --track: #23282e;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --backdrop: rgba(0, 0, 0, 0.55);
  --glow: transparent;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  margin: 0;
}

button, input, textarea { font: inherit; color: inherit; }

.app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100dvh;
}

/* ---------- sidebar ---------- */
.side {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.side-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.side-brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.side-brand strong span { color: var(--accent-text); }

.side-brand small { color: var(--muted); font-size: 12px; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  align-items: center;
  border-radius: 6px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 10px;
  text-decoration: none;
  font-weight: 600;
}

.nav a:hover { background: var(--surface-2); color: var(--ink); }

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.nav .count {
  background: var(--surface-3);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
}

.nav .count.alert {
  background: var(--hot);
  color: var(--hot-ink);
}

.side-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  margin-top: auto;
  padding: 12px 8px 0;
}

.side-foot a { color: var(--ink-2); }

/* ---------- top ---------- */
.main { min-width: 0; }

.top {
  align-items: center;
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.top h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.top-right {
  align-items: center;
  display: flex;
  gap: 10px;
}

.demo-badge {
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  text-transform: uppercase;
}

.view { padding: 22px 24px 48px; }

/* ---------- controls ---------- */
.btn {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 8px 12px;
  white-space: nowrap;
}

a.btn { color: var(--ink); text-decoration: none; }

a.btn.primary { color: var(--accent-ink); }

.btn:hover, .btn:focus-visible { border-color: var(--accent-line); outline: none; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.danger { border-color: var(--danger-line); color: var(--danger); }

.btn:disabled { cursor: not-allowed; opacity: 0.45; }

.icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  height: 20px;
  justify-content: center;
  padding: 0;
  width: 20px;
}

.icon-btn:hover { border-color: var(--accent-line); color: var(--accent-text); }

.input, textarea.input {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 11px;
  width: 100%;
}

.input:focus { border-color: var(--accent-line); outline: none; }

/* custom dropdown menu (no native select) */
.menu { position: relative; display: inline-block; }

.menu-trigger {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  padding: 7px 11px;
}

.menu-trigger .menu-label { color: var(--muted); font-weight: 600; }

.menu-trigger.is-set { border-color: var(--accent-line); }

.menu-trigger::after { content: "▾"; color: var(--muted); font-size: 11px; }

.menu-list {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  left: 0;
  max-height: 320px;
  min-width: 200px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 40;
}

.menu-list.align-right { left: auto; right: 0; }

.menu-list button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-2); outline: none; }

.menu-list button[aria-selected="true"] { color: var(--accent-text); font-weight: 700; }

.menu-sep { border-top: 1px solid var(--line); margin: 4px 0; }

.menu-head { color: var(--muted); font-size: 11px; font-weight: 700; padding: 6px 10px 2px; text-transform: uppercase; }

/* popover */
.popover {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  max-width: 360px;
  padding: 12px 14px;
  position: fixed;
  z-index: 60;
}

.popover strong { color: var(--ink); }

.popover ul { margin: 6px 0 0; padding-left: 18px; }

/* chips */
.chip {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 700;
  gap: 5px;
  padding: 3px 9px;
  white-space: nowrap;
}

.prio::before {
  border-radius: 50%;
  content: "";
  height: 7px;
  width: 7px;
}

.prio-hot { border-color: var(--hot-line); color: var(--hot-text); }
.prio-hot::before { background: var(--hot); }
.prio-warm { border-color: var(--warm-line); color: var(--warm-text); }
.prio-warm::before { background: var(--warm); }
.prio-cold { border-color: var(--cold-line); color: var(--cold-text); }
.prio-cold::before { background: var(--cold); }
.prio-none { color: var(--muted); }
.prio-none::before { background: var(--muted); }

.st { background: var(--surface-3); border-color: transparent; color: var(--ink-2); }
.st-live_waiting { background: var(--hot-soft); color: var(--hot-text); }
.st-live { background: var(--accent-soft); color: var(--accent-text); }
.st-bot { background: var(--cold-soft); color: var(--cold-text); }
.st-booked { background: var(--good-soft); color: var(--good-text); }
.st-lost, .st-abandoned, .st-no_consent { color: var(--muted); }

.flag-chip { border-color: transparent; background: var(--surface-3); color: var(--ink-2); }

.suspect { border-color: var(--danger-line); color: var(--danger); }

/* ---------- cards & grids ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.card h2 {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  margin: 0 0 12px;
}

.card h2 .sub { color: var(--muted); font-size: 12px; font-weight: 600; }

.grid { display: grid; gap: 14px; }

.kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.kpi { display: flex; flex-direction: column; gap: 6px; }

.kpi .k-label { color: var(--muted); font-size: 12px; font-weight: 700; }

.kpi .k-value { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }

.kpi .k-note { color: var(--ink-2); font-size: 12px; }

.kpi.alert .k-value { color: var(--hot-text); }

.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* charts */
.hbars { display: flex; flex-direction: column; gap: 8px; }

.hbar { display: grid; gap: 10px; grid-template-columns: 190px minmax(0, 1fr) 76px; align-items: center; }

.hbar .h-label { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hbar .h-track { background: var(--track); border-radius: 4px; height: 14px; position: relative; }

.hbar .h-fill { background: var(--bar); border-radius: 0 4px 4px 0; height: 100%; min-width: 2px; }

.hbar .h-value { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }

.hbar .h-value small { color: var(--muted); font-weight: 600; }

.vbars { align-items: flex-end; display: flex; gap: 6px; height: 150px; padding-top: 10px; }

.vbar { align-items: center; display: flex; flex: 1; flex-direction: column; gap: 6px; height: 100%; justify-content: flex-end; }

.vbar .v-fill { background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; width: 100%; max-width: 34px; }

.vbar .v-label { color: var(--muted); font-size: 10.5px; }

.tooltip {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  padding: 6px 9px;
  pointer-events: none;
  position: fixed;
  z-index: 70;
}

/* ---------- table ---------- */
.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.tab {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
}

.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.tab .tc { opacity: 0.7; margin-left: 4px; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }

table { border-collapse: collapse; width: 100%; }

th {
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td { border-top: 1px solid var(--line); padding: 10px 12px; vertical-align: middle; }

tr.row { cursor: pointer; }

tr.row:hover td { background: var(--hover); }

.cell-main { display: flex; flex-direction: column; gap: 2px; }

.cell-main strong { font-size: 13.5px; }

.cell-main small { color: var(--muted); font-size: 12px; }

.score-pill {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.score-pill b { font-size: 16px; font-variant-numeric: tabular-nums; min-width: 26px; }

.sla-ok { color: var(--ink-2); }
.sla-soon { color: var(--warm); font-weight: 700; }
.sla-late { color: var(--hot); font-weight: 600; }

.empty { color: var(--muted); padding: 30px; text-align: center; }

/* ---------- detail ---------- */
.detail-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-title { display: flex; flex-direction: column; gap: 8px; }

.detail-title h2 { font-size: 22px; margin: 0; }

.detail-title .chips { display: flex; flex-wrap: wrap; gap: 6px; }

.back { color: var(--ink-2); font-size: 13px; text-decoration: none; }

.back:hover { color: var(--accent-text); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.detail-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }

.side-stack { display: flex; flex-direction: column; gap: 14px; }

.convo {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 220px);
  min-height: 460px;
  padding: 0;
}

.convo-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}

.convo-head strong { font-size: 14px; }

.convo-body { display: flex; flex: 1; flex-direction: column; gap: 8px; overflow-y: auto; padding: 14px 16px; }

.m { display: flex; flex-direction: column; max-width: 78%; }

.m.patient { align-self: flex-start; }

.m.bot, .m.agent { align-self: flex-end; }

.m.system { align-self: center; max-width: 92%; }

.m .b {
  background: var(--surface-3);
  border-radius: 6px;
  line-height: 1.45;
  padding: 8px 11px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.m.bot .b { background: var(--cold-soft); }

.m.agent .b { background: var(--accent-soft); }

.m.system .b { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12px; }

.m .who { color: var(--muted); font-size: 11px; font-weight: 700; margin: 0 4px 3px; }

.m.bot .who, .m.agent .who { text-align: right; }

.m .when { color: var(--muted); font-size: 10.5px; margin: 2px 4px 0; }

.m.bot .when, .m.agent .when { text-align: right; }

.m .replies { color: var(--muted); font-size: 11.5px; margin: 4px 4px 0; text-align: right; }

.composer { border-top: 1px solid var(--line); display: flex; gap: 8px; padding: 12px 14px; }

.composer textarea { min-height: 42px; resize: vertical; }

.composer-note { color: var(--muted); font-size: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }

.fields { display: grid; gap: 10px 16px; grid-template-columns: 120px minmax(0, 1fr); margin: 0; }

.fields dt { color: var(--muted); font-size: 12.5px; font-weight: 700; }

.fields dd { margin: 0; overflow-wrap: anywhere; }

.summary-box { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); font-size: 13px; line-height: 1.55; padding: 10px 12px; white-space: pre-wrap; }

.score-head { align-items: baseline; display: flex; gap: 12px; margin-bottom: 12px; }

.score-big { font-size: 40px; font-weight: 600; line-height: 1; }

.meters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.meter { display: grid; gap: 8px; grid-template-columns: 96px minmax(0, 1fr) 34px; align-items: center; }

.meter span { color: var(--ink-2); font-size: 12.5px; }

.meter .track { background: var(--track); border-radius: 4px; height: 10px; }

.meter .fill { background: var(--bar); border-radius: 0 4px 4px 0; height: 100%; }

.meter b { font-size: 13px; text-align: right; }

.reasons { display: flex; flex-direction: column; gap: 4px; list-style: none; margin: 0; padding: 0; }

.reasons li { color: var(--ink-2); display: flex; font-size: 12.5px; gap: 8px; }

.reasons li b { color: var(--accent-text); min-width: 32px; text-align: right; }

.reasons li b.neg { color: var(--danger); }

.timeline { display: flex; flex-direction: column; gap: 0; list-style: none; margin: 0; padding: 0; }

.timeline li { border-left: 2px solid var(--line-strong); display: flex; flex-direction: column; gap: 2px; margin-left: 6px; padding: 0 0 12px 14px; position: relative; }

.timeline li::before { background: var(--surface-3); border: 2px solid var(--line-strong); border-radius: 50%; content: ""; height: 8px; left: -7px; position: absolute; top: 3px; width: 8px; }

.timeline li.tl-escalated::before, .timeline li.tl-handoff_timeout::before { background: var(--hot); border-color: var(--hot); }

.timeline li.tl-qualified::before, .timeline li.tl-taken_over::before { background: var(--accent); border-color: var(--accent); }

.timeline .tl-title { font-size: 13px; font-weight: 700; }

.timeline .tl-sub { color: var(--muted); font-size: 12px; }

.attach-list { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }

.attach-list a { color: var(--ink); text-decoration: none; }

.attach-list a:hover { color: var(--accent-text); }

/* live */
.live-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.live-card { display: flex; flex-direction: column; gap: 10px; }

.live-card.waiting { border-color: var(--hot-line); }

.live-card .lc-top { align-items: center; display: flex; justify-content: space-between; gap: 8px; }

.live-card .lc-last { background: var(--surface); border-radius: 6px; color: var(--ink-2); font-size: 13px; padding: 8px 10px; }

/* teams */
.team-card { display: flex; flex-direction: column; gap: 10px; }

.team-card .tc-row { color: var(--ink-2); font-size: 13px; }

.team-card .tc-row b { color: var(--muted); display: inline-block; font-size: 12px; min-width: 92px; }

.toggle-row { align-items: center; display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }

.toggle-row:first-of-type { border-top: 0; }

.toggle-row .tr-text { display: flex; flex-direction: column; gap: 2px; }

.toggle-row .tr-text small { color: var(--muted); font-size: 12px; }

.switch { appearance: none; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; flex: none; height: 24px; position: relative; transition: background 0.15s ease; width: 44px; }

.switch::after { background: var(--ink-2); border-radius: 50%; content: ""; height: 18px; left: 2px; position: absolute; top: 2px; transition: transform 0.15s ease; width: 18px; }

.switch:checked { background: var(--accent); border-color: var(--accent); }

.switch:checked::after { background: var(--accent-ink); transform: translateX(20px); }

.num-input { width: 90px; }

.price-grid { display: grid; gap: 8px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.price-grid label { color: var(--muted); display: flex; flex-direction: column; font-size: 12px; font-weight: 700; gap: 4px; }

.chip-toggle-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-toggle { background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 5px 10px; }

.chip-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

code.snippet { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); display: block; font-size: 12px; overflow-x: auto; padding: 10px 12px; white-space: pre; }

.channel-row { align-items: center; display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }

.channel-row:first-of-type { border-top: 0; }

.channel-row small { color: var(--muted); display: block; font-size: 12px; }

/* modal */
.modal-backdrop { align-items: center; background: var(--backdrop); display: flex; inset: 0; justify-content: center; padding: 16px; position: fixed; z-index: 80; }

.modal { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; display: flex; flex-direction: column; gap: 14px; max-height: 90dvh; max-width: 560px; overflow-y: auto; padding: 20px; width: 100%; }

.modal h3 { font-size: 16px; margin: 0; }

.modal label.fl { color: var(--muted); display: flex; flex-direction: column; font-size: 12px; font-weight: 700; gap: 6px; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.toast { background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 6px; bottom: 20px; box-shadow: var(--shadow); padding: 10px 14px; position: fixed; right: 20px; z-index: 90; }

.muted { color: var(--muted); }

.mt { margin-top: 14px; }

.flex-between { align-items: center; display: flex; gap: 10px; justify-content: space-between; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .two, .three, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .convo { height: 560px; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding: 12px 16px; }
  .view { padding: 16px 16px 40px; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 56px; }
}

/* ---------- theme toggle tokens ---------- */
:root {
  --tt-bg: var(--surface-2);
  --tt-line: var(--line-strong);
  --tt-active: var(--accent-soft);
  --tt-ink: var(--ink-2);
  --tt-focus: var(--accent-line);
}

[data-theme-toggle] button[aria-pressed="true"] { color: var(--accent-text); }

/* ---------- user card & menus ---------- */
.side-user {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.side-user:hover { background: var(--surface-2); }

.avatar {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent-text);
  display: inline-flex;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.avatar.sm { font-size: 10px; height: 22px; width: 22px; }

.side-user .su-text { display: flex; flex-direction: column; min-width: 0; }

.side-user .su-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-user .su-text small { color: var(--muted); font-size: 11.5px; }

.side-foot { display: flex; flex-direction: column; gap: 10px; }

.top-icon {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  height: 34px;
  justify-content: center;
  padding: 0 12px;
}

.top-icon:hover { border-color: var(--accent-line); color: var(--ink); }

.user-pop { min-width: 240px; padding: 6px; }

.user-pop .up-head { border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; padding: 8px 10px 10px; }

.user-pop .up-head small { color: var(--muted); }

.user-pop button { background: transparent; border: 0; border-radius: 8px; cursor: pointer; display: block; padding: 8px 10px; text-align: left; width: 100%; }

.user-pop button:hover { background: var(--surface-2); }

.user-pop .danger-link { color: var(--danger); }

/* ---------- monitor ---------- */
.mon-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

.mon-stat {
  align-items: baseline;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
}

.mon-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }

.mon-stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.mon-stat.alert { border-color: var(--hot-line); }

.mon-stat.alert b { color: var(--hot-text); }

.mon-layout { align-items: start; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr); }

.mon-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.tile {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
  width: 100%;
}

.tile:hover { border-color: var(--line-strong); }

.tile[aria-selected="true"] { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }

.tile.waiting { border-color: var(--hot-line); }

.tile.flash { animation: tile-flash 1.2s ease; }

@keyframes tile-flash { 0% { background: var(--accent-soft); } 100% { background: var(--card-bg); } }

.tile-top { align-items: center; display: flex; gap: 8px; justify-content: space-between; }

.tile-top strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tile-meta { color: var(--muted); font-size: 12px; }

.presence { border-radius: 50%; display: inline-block; flex: none; height: 8px; width: 8px; background: var(--muted); opacity: 0.5; }

.presence.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); opacity: 1; }

.progress { background: var(--track); border-radius: 4px; height: 6px; overflow: hidden; }

.progress span { background: var(--bar); border-radius: 0 4px 4px 0; display: block; height: 100%; }

.progress-label { color: var(--muted); display: flex; font-size: 11.5px; justify-content: space-between; }

.mini-convo { display: flex; flex-direction: column; gap: 4px; }

.mini-convo .mm { border-radius: 9px; font-size: 12px; line-height: 1.4; max-width: 92%; overflow: hidden; padding: 5px 8px; text-overflow: ellipsis; white-space: nowrap; }

.mini-convo .mm.patient { align-self: flex-start; background: var(--surface-3); }

.mini-convo .mm.bot { align-self: flex-end; background: var(--cold-soft); }

.mini-convo .mm.agent { align-self: flex-end; background: var(--accent-soft); }

.mini-convo .mm.internal { align-self: flex-end; background: var(--warm-soft); border: 1px dashed var(--warm-line); }

.mini-convo .mm.system { align-self: center; color: var(--muted); }

.typing-line { align-items: center; color: var(--accent-text); display: inline-flex; font-size: 12px; font-weight: 700; gap: 6px; }

.typing-dots { display: inline-flex; gap: 3px; }

.typing-dots i { animation: dot 1.1s infinite ease-in-out; background: currentColor; border-radius: 50%; display: block; height: 5px; width: 5px; }

.typing-dots i:nth-child(2) { animation-delay: 0.15s; }

.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.watchers { align-items: center; color: var(--muted); display: inline-flex; font-size: 11.5px; gap: 4px; }

.focus-panel { position: sticky; top: 74px; }

.focus-panel .convo { height: calc(100dvh - 190px); min-height: 480px; }

.focus-empty { align-items: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; justify-content: center; min-height: 320px; text-align: center; }

.live-dot { animation: pulse 1.6s infinite; background: var(--hot); border-radius: 50%; display: inline-block; height: 8px; width: 8px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--hot-soft); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.signals { align-items: center; display: inline-flex; flex-wrap: wrap; gap: 10px; }

/* conversation extras */
.m.internal { align-self: flex-end; }

.m.internal .b { background: var(--warm-soft); border: 1px dashed var(--warm-line); }

.m.internal .who { color: var(--warm-text); text-align: right; }

.m.typing .b { align-items: center; display: inline-flex; gap: 8px; }

.composer-tabs { border-top: 1px solid var(--line); display: flex; gap: 6px; padding: 10px 14px 0; }

.composer-tabs button { background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; padding: 5px 10px; }

.composer-tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.composer-tabs button.internal[aria-selected="true"] { background: var(--warm-soft); border-color: var(--warm-line); color: var(--warm-text); }

.composer-tabs + .composer { border-top: 0; }

.composer.internal textarea { border-color: var(--warm-line); }

/* ---------- help drawer ---------- */
.drawer-backdrop { background: var(--backdrop); inset: 0; position: fixed; z-index: 85; }

.drawer {
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 100%;
  overflow-y: auto;
  position: fixed;
  right: 0;
  top: 0;
  width: 420px;
  z-index: 86;
}

.drawer-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 16px 18px; position: sticky; top: 0; background: var(--surface); }

.drawer-head h3 { font-size: 16px; margin: 0; }

.drawer-sec { border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }

.drawer-sec h4 { color: var(--muted); font-size: 11.5px; letter-spacing: 0.05em; margin: 0; text-transform: uppercase; }

.drawer-sec p { color: var(--ink-2); font-size: 13px; line-height: 1.55; margin: 0; }

.drawer-sec ul { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 0; padding-left: 18px; }

.faq details { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }

.faq details + details { margin-top: 6px; }

.faq summary { cursor: pointer; font-size: 13px; font-weight: 700; }

.faq details p { margin-top: 8px; }

.kbd { background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 6px; font-size: 11.5px; font-weight: 700; padding: 1px 6px; }

.support-list { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }

.support-list li { border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; padding: 8px 10px; }

.support-list small { color: var(--muted); display: block; }

/* ---------- onboarding tour ---------- */
.tour-hole { border-radius: 6px; box-shadow: 0 0 0 9999px var(--backdrop); pointer-events: none; position: fixed; transition: all 0.25s ease; z-index: 95; }

.tour-bubble { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; max-width: 320px; padding: 14px 16px; position: fixed; z-index: 96; }

.tour-bubble strong { font-size: 14px; }

.tour-bubble p { color: var(--ink-2); font-size: 13px; line-height: 1.5; margin: 0; }

.tour-bubble .tour-foot { align-items: center; display: flex; justify-content: space-between; }

.tour-bubble .tour-count { color: var(--muted); font-size: 12px; }

.welcome-steps { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }

.welcome-steps li { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 10px; padding: 10px 12px; }

.welcome-steps li b { align-items: center; background: var(--accent); border-radius: 50%; color: var(--accent-ink); display: inline-flex; flex: none; font-size: 12px; height: 22px; justify-content: center; width: 22px; }

.welcome-steps li span { color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.welcome-steps li strong { color: var(--ink); display: block; }

/* ---------- state views ---------- */
.state-view { align-items: center; display: flex; flex-direction: column; gap: 12px; justify-content: center; min-height: 50vh; text-align: center; }

.state-view .code { color: var(--accent-text); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; }

.state-view h2 { font-size: 22px; margin: 0; }

.state-view p { color: var(--muted); margin: 0; max-width: 460px; }

@media (max-width: 1180px) {
  .mon-layout { grid-template-columns: minmax(0, 1fr); }
  .focus-panel { position: static; }
}

/* ---------- translation ---------- */
.tr-toggle { align-self: flex-start; background: transparent; border: 0; color: var(--cold-text); cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; margin: 3px 4px 0; padding: 0; }

.m.bot .tr-toggle, .m.agent .tr-toggle, .m.internal .tr-toggle { align-self: flex-end; }

.tr-toggle:hover { text-decoration: underline; }

.tr-toggle.inline { margin: 0 0 0 6px; }

.tr-note { align-self: flex-start; color: var(--muted); font-size: 11px; font-style: italic; margin: 3px 4px 0; }

.m.bot .tr-note, .m.agent .tr-note { align-self: flex-end; }

.lang-switch { background: var(--cold-soft); border: 1px solid var(--cold-line); border-radius: 999px; color: var(--cold-text); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 10px; }

.ad-ref { background: var(--accent-soft); border-radius: 8px; color: var(--accent-text); font-size: 11.5px; font-weight: 700; margin: 0 0 4px; padding: 4px 8px; }

/* ---------- warning work items ---------- */
.warn-chip { background: var(--warm-soft); border-color: var(--warm-line); color: var(--warm-text); }

.task-banner { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.task-row { align-items: center; background: var(--warm-soft); border: 1px solid var(--warm-line); border-radius: 6px; display: flex; gap: 12px; padding: 10px 14px; }

.task-row > div { display: flex; flex: 1; flex-direction: column; gap: 2px; }

.task-row small { color: var(--ink-2); font-size: 12px; }

.task-icon { color: var(--warm-text); font-size: 18px; font-weight: 600; }

.warn-card { border-color: var(--warm-line); }

/* ---------- workflow strip ---------- */
.wf-strip { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }

.wf-step { align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; display: flex; gap: 10px; padding: 10px 12px; text-align: left; }

.wf-step[aria-selected="true"] { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }

.wf-step .wf-text { display: flex; flex-direction: column; min-width: 0; }

.wf-step small { color: var(--muted); font-size: 11px; font-weight: 700; }

.wf-step strong { font-size: 13px; }

.wf-dot { align-items: center; background: var(--surface-3); border-radius: 50%; color: var(--muted); display: inline-flex; flex: none; font-size: 12px; font-weight: 600; height: 26px; justify-content: center; width: 26px; }

.wf-dot.sm { font-size: 10px; height: 20px; width: 20px; }

.wf-done .wf-dot { background: var(--accent); color: var(--accent-ink); }

.wf-warn .wf-dot { background: var(--warm); color: #1a1003; }

.wf-fail .wf-dot { background: var(--hot); color: var(--hot-ink); }

.wf-pending .wf-dot { background: var(--cold-soft); color: var(--cold-text); }

.wf-items { border-top: 1px solid var(--line); display: grid; gap: 10px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; padding-top: 12px; }

.wf-item { align-items: flex-start; display: flex; gap: 10px; }

.wf-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.wf-item strong { font-size: 12.5px; }

.wf-item span { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }

.wf-item small { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

/* ---------- attribution ---------- */
.attr-source { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

.attr-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }

.attr-list li { display: flex; flex-wrap: wrap; font-size: 12.5px; gap: 4px 8px; }

.attr-list code { background: var(--surface-3); border-radius: 6px; color: var(--ink-2); font-size: 11.5px; padding: 1px 6px; }

.attr-list b { overflow-wrap: anywhere; }

.attr-list small { color: var(--muted); flex-basis: 100%; }

.attr-url { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; margin-top: 10px; overflow: hidden; padding: 6px 8px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1080px) {
  .wf-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-items { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   Sober layer: plain enterprise look (fewer fills, weights and ornaments)
   ========================================================= */
.side { background: var(--surface); }

.side-brand strong { font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; }

.side-brand strong span { color: inherit; }

.side-brand small { font-size: 12px; }

.nav a { border-radius: 6px; font-weight: 500; padding: 8px 10px; position: relative; }

.nav a:hover { background: var(--surface-3); }

.nav a.active { background: var(--surface-3); color: var(--ink); font-weight: 600; }

.nav a.active::before { background: var(--accent); border-radius: 2px; bottom: 7px; content: ""; left: -6px; position: absolute; top: 7px; width: 3px; }

.nav .count { background: transparent; color: var(--muted); font-weight: 600; padding: 0; }

.nav .count.alert { background: var(--hot); border-radius: 999px; color: var(--hot-ink); padding: 1px 7px; }

.top { padding: 12px 24px; }

.top h1 { font-size: 16px; font-weight: 600; }

.top-icon { background: transparent; border-color: var(--line-strong); border-radius: 6px; font-weight: 500; height: 32px; }

.btn { border-radius: 6px; font-weight: 500; padding: 7px 12px; }

.btn.primary { font-weight: 600; }

.menu-trigger { border-radius: 6px; font-weight: 500; }

.menu-list, .popover, .modal, .tooltip, .toast { border-radius: 8px; }

.card { border-radius: 8px; padding: 16px; }

.card h2 { font-size: 14px; font-weight: 600; }

.kpi .k-label { font-size: 12px; font-weight: 500; }

.kpi .k-value { font-size: 24px; font-weight: 600; letter-spacing: 0; }

.kpi .k-note { color: var(--muted); }

.tabs { border-bottom: 1px solid var(--line); gap: 2px; }

.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ink-2); font-weight: 500; margin-bottom: -1px; padding: 8px 12px; }

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] { background: transparent; border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }

.tab .tc { color: var(--muted); opacity: 1; }

th { background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }

.table-wrap { background: var(--surface); border-radius: 8px; }

.chip { font-size: 11.5px; font-weight: 500; padding: 2px 8px; }

.chip-toggle { border-radius: 6px; font-weight: 500; }

.demo-badge { border-style: solid; border-radius: 6px; font-weight: 500; text-transform: none; }

.score-big { font-size: 34px; font-weight: 600; }

.m .b { border-radius: 8px; }

.m.bot .b { background: var(--surface-3); }

.m.agent .b { background: var(--accent-soft); }

.convo-body { background: var(--surface); }

.mon-stat { background: var(--surface); border-radius: 8px; padding: 8px 12px; }

.mon-stat b { font-size: 18px; font-weight: 600; }

.tile { border-radius: 8px; box-shadow: none; padding: 12px; }

.tile[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.tile-top strong { font-weight: 600; }

.avatar { background: var(--surface-3); color: var(--ink-2); font-weight: 600; }

.side-user { border-radius: 6px; }

/* compact five-step workflow: a row of labelled steps, not cards */
.wf-strip { border: 1px solid var(--line); border-radius: 6px; gap: 0; overflow: hidden; }

.wf-step { background: var(--surface); border: 0; border-left: 1px solid var(--line); border-radius: 0; gap: 8px; padding: 8px 10px; }

.wf-step:first-child { border-left: 0; }

.wf-step[aria-selected="true"] { background: var(--accent-soft); box-shadow: none; }

.wf-step small { font-weight: 500; }

.wf-step strong { font-size: 12.5px; font-weight: 600; }

.wf-dot { font-size: 11px; height: 20px; width: 20px; }

.wf-done .wf-dot { background: var(--good-soft); color: var(--good-text); }

.wf-warn .wf-dot { background: var(--warm-soft); color: var(--warm-text); }

.wf-fail .wf-dot { background: var(--hot-soft); color: var(--hot-text); }

.task-row { border-radius: 6px; }

.state-view .code { color: var(--muted); }

.switch:checked::after { background: #ffffff; }

.welcome-steps li { border-radius: 6px; }

.welcome-steps li b { background: var(--surface-3); color: var(--ink-2); }

.lang-switch { border-radius: 6px; font-weight: 600; }

.tile { gap: 6px; }

.tile-state { color: var(--ink-2); font-size: 12.5px; }

.tile-last { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tile-last b { color: var(--ink-2); font-weight: 600; }

.tile-foot { align-items: center; display: flex; gap: 8px; justify-content: space-between; }

.warn-text { color: var(--warm-text); font-weight: 600; }

.typing-line { color: var(--accent-text); }

.card.convo { padding: 0; }

/* =========================================================
   Looks: two visual identities on the same layout (html[data-look])
   ========================================================= */
:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --font-head: var(--font-body);
  --font-num: var(--font-body);
  --side-bg: var(--surface);
  --side-ink: var(--ink-2);
  --side-muted: var(--muted);
  --side-line: var(--line);
  --side-hover: var(--surface-3);
  --side-active-bg: var(--surface-3);
  --side-active-ink: var(--ink);
  --side-brand: var(--ink);
  --side-accent: var(--accent);
}

body { font-family: var(--font-body); }

h1, h2, h3, .side-brand strong, .detail-title h2, .state-view h2, .pt-logo, .lb-logo, .sim-brand strong { font-family: var(--font-head); }

.kpi .k-value, .score-big, .mon-stat b, .score-pill b, .hbar .h-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.side { background: var(--side-bg); border-right-color: var(--side-line); }

.side-brand strong { color: var(--side-brand); font-size: 16px; }

.side-brand small { color: var(--side-muted); }

.nav a { color: var(--side-ink); }

.nav a:hover { background: var(--side-hover); color: var(--side-active-ink); }

.nav a.active { background: var(--side-active-bg); color: var(--side-active-ink); }

.nav a.active::before { background: var(--side-accent); }

.nav .count { color: var(--side-muted); }

.side-foot { border-top-color: var(--side-line); color: var(--side-muted); }

.side-foot a { color: var(--side-ink); }

.side-user { border-color: var(--side-line); }

.side-user:hover { background: var(--side-hover); }

.side-user .su-text strong { color: var(--side-active-ink); }

.side-user .su-text small { color: var(--side-muted); }

.side .avatar { background: var(--side-hover); color: var(--side-active-ink); }

/* a little character: KPI accent rule, page title weight, card titles */
.kpi { border-top: 3px solid var(--accent); }

.kpi.alert { border-top-color: var(--hot); }

.top h1 { font-size: 18px; font-weight: 600; }







/* =========================================================
   Look "Acıbadem": Acıbadem navy/blue/turquoise/coral structure,
   AISTUDIO signature (Plus Jakarta headings, grid texture, lime live signal)
   ========================================================= */
:root {
  --live: #22a861;
  --brand-band: var(--top-bg);
  --brand-band-ink: var(--ink);
  --brand-band-muted: var(--muted);
}
:root[data-look="acibadem"] {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #edf2f9;
  --line: #dce4ef;
  --line-strong: #c3cfe0;
  --ink: #0a1830;
  --ink-2: #33445f;
  --muted: #64748e;
  --accent: #0a66c2;
  --accent-ink: #ffffff;
  --accent-text: #0a5cb0;
  --accent-soft: #e7f0fb;
  --accent-line: #9bc0e9;
  --bar: #25aae1;
  --card-bg: #ffffff;
  --top-bg: #072562;
  --hover: #f5f8fc;
  --track: #e6edf6;
  --hot: #e8573b;
  --hot-ink: #ffffff;
  --hot-text: #c2412a;
  --hot-soft: #fdeeea;
  --hot-line: #f3b4a6;
  --cold: #25aae1;
  --cold-text: #0d6f99;
  --cold-soft: #e8f6fc;
  --cold-line: #a6dcf2;
  --side-bg: #072562;
  --side-ink: #c5d3ec;
  --side-muted: #8ba0c7;
  --side-line: #14367a;
  --side-hover: #0c2f73;
  --side-active-bg: #0f3a86;
  --side-active-ink: #ffffff;
  --side-brand: #ffffff;
  --side-accent: #b1e635;
  --live: #b1e635;
  --brand-band: #072562;
  --brand-band-ink: #ffffff;
  --brand-band-muted: #a9bce0;
  --font-body: Inter, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --font-head: "Plus Jakarta Sans", Inter, sans-serif;
  --font-num: "Plus Jakarta Sans", Inter, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root[data-look="acibadem"]:not([data-theme="light"]) {
    --bg: #020a1a;
    --surface: #06142e;
    --surface-2: #06142e;
    --surface-3: #0b1d40;
    --line: #12285a;
    --line-strong: #1c3a78;
    --ink: #e8eefa;
    --ink-2: #b5c4e0;
    --muted: #7c8fb3;
    --accent: #25aae1;
    --accent-ink: #021022;
    --accent-text: #7dd0f3;
    --accent-soft: rgba(37, 170, 225, 0.14);
    --accent-line: rgba(125, 208, 243, 0.4);
    --bar: #25aae1;
    --card-bg: #06142e;
    --top-bg: #010a1d;
    --hover: #0a1a39;
    --track: #0e2149;
    --hot: #f26b50;
    --hot-ink: #ffffff;
    --hot-text: #f8a592;
    --hot-soft: rgba(242, 107, 80, 0.15);
    --hot-line: rgba(242, 107, 80, 0.45);
    --cold: #25aae1;
    --cold-text: #8fd6f4;
    --cold-soft: rgba(37, 170, 225, 0.13);
    --cold-line: rgba(37, 170, 225, 0.4);
    --side-bg: #010818;
    --side-ink: #aebfe0;
    --side-muted: #6f84ad;
    --side-line: #0d1f45;
    --side-hover: #081a3c;
    --side-active-bg: #0b2453;
    --side-active-ink: #ffffff;
    --side-brand: #ffffff;
    --side-accent: #b1e635;
    --brand-band: #010a1d;
    --brand-band-ink: #ffffff;
    --brand-band-muted: #8ea3cb;
  }
}
:root[data-look="acibadem"][data-theme="dark"] {
  --bg: #020a1a;
  --surface: #06142e;
  --surface-2: #06142e;
  --surface-3: #0b1d40;
  --line: #12285a;
  --line-strong: #1c3a78;
  --ink: #e8eefa;
  --ink-2: #b5c4e0;
  --muted: #7c8fb3;
  --accent: #25aae1;
  --accent-ink: #021022;
  --accent-text: #7dd0f3;
  --accent-soft: rgba(37, 170, 225, 0.14);
  --accent-line: rgba(125, 208, 243, 0.4);
  --bar: #25aae1;
  --card-bg: #06142e;
  --top-bg: #010a1d;
  --hover: #0a1a39;
  --track: #0e2149;
  --hot: #f26b50;
  --hot-ink: #ffffff;
  --hot-text: #f8a592;
  --hot-soft: rgba(242, 107, 80, 0.15);
  --hot-line: rgba(242, 107, 80, 0.45);
  --cold: #25aae1;
  --cold-text: #8fd6f4;
  --cold-soft: rgba(37, 170, 225, 0.13);
  --cold-line: rgba(37, 170, 225, 0.4);
  --side-bg: #010818;
  --side-ink: #aebfe0;
  --side-muted: #6f84ad;
  --side-line: #0d1f45;
  --side-hover: #081a3c;
  --side-active-bg: #0b2453;
  --side-active-ink: #ffffff;
  --side-brand: #ffffff;
  --side-accent: #b1e635;
  --brand-band: #010a1d;
  --brand-band-ink: #ffffff;
  --brand-band-muted: #8ea3cb;
}

/* grid texture: our signature, only on navy surfaces */
:root[data-look="acibadem"] .side,
:root[data-look="acibadem"] .top {
  background-color: var(--side-bg);
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}

:root[data-look="acibadem"] .top { background-color: var(--brand-band); border-bottom-color: transparent; color: var(--brand-band-ink); }

:root[data-look="acibadem"] .top h1 { color: var(--brand-band-ink); font-size: 19px; font-weight: 700; }

:root[data-look="acibadem"] .top .top-icon { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.22); color: #ffffff; }

:root[data-look="acibadem"] .top [data-theme-toggle] { --tt-bg: rgba(255, 255, 255, 0.06); --tt-line: rgba(255, 255, 255, 0.22); --tt-ink: #dbe6f7; --tt-active: rgba(177, 230, 53, 0.22); }

:root[data-look="acibadem"] .top [data-theme-toggle] button[aria-pressed="true"] { color: #d6ff7a; }

:root[data-look="acibadem"] .side-brand strong { font-family: var(--font-head); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

:root[data-look="acibadem"] .side-brand small { letter-spacing: 0.14em; text-transform: uppercase; font-size: 10.5px; }

:root[data-look="acibadem"] .nav a.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }

:root[data-look="acibadem"] .kpi { border-top: 0; border-left: 3px solid var(--bar); }

:root[data-look="acibadem"] .kpi.alert { border-left-color: var(--hot); }

:root[data-look="acibadem"] .kpi .k-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

:root[data-look="acibadem"] .card { border-radius: 12px; }

:root[data-look="acibadem"] .card h2 { font-family: var(--font-head); font-size: 15px; font-weight: 700; }

:root[data-look="acibadem"] .btn, :root[data-look="acibadem"] .menu-trigger, :root[data-look="acibadem"] .input { border-radius: 8px; }

:root[data-look="acibadem"] .btn.primary { border-radius: 999px; padding-left: 16px; padding-right: 16px; }

:root[data-look="acibadem"] .presence.on { background: var(--live); box-shadow: 0 0 0 3px rgba(177, 230, 53, 0.25); }

:root[data-look="acibadem"] .detail-title h2 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; }

/* ---------- live status strip in the header (all looks) ---------- */
.top { gap: 18px; }

.top-live { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }

.live-pill { align-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); display: inline-flex; font-size: 12.5px; gap: 6px; padding: 4px 10px; text-decoration: none; white-space: nowrap; }

.live-pill b { color: var(--ink); font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.live-pill i { background: var(--line-strong); border-radius: 50%; height: 7px; width: 7px; }

.live-pill.on.live-waiting i { animation: pulse 1.6s infinite; background: var(--hot); }

.live-pill.on.live-live i { background: var(--accent); }

.live-pill.on.live-bot i { background: var(--live); }

.live-pill.on.live-task i { background: var(--warm); }

.live-pill:hover { border-color: var(--line-strong); color: var(--ink); }

:root[data-look="acibadem"] .live-pill { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.16); color: var(--brand-band-muted); }

:root[data-look="acibadem"] .live-pill b { color: #ffffff; }

:root[data-look="acibadem"] .live-pill:hover { border-color: rgba(255, 255, 255, 0.4); color: #ffffff; }

:root[data-look="acibadem"] .live-pill.on.live-waiting { background: rgba(242, 107, 80, 0.16); border-color: rgba(242, 107, 80, 0.55); color: #ffd3c8; }

/* ---------- monitor board: lanes in the direction a conversation moves ---------- */
.mon-layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 0.8fr); }

.board { align-items: start; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }

.lane { background: var(--surface-3); border-radius: 10px; display: flex; flex-direction: column; min-width: 0; padding: 10px; }

.lane-head { align-items: center; display: grid; gap: 2px 8px; grid-template-columns: auto 1fr auto; margin: 2px 2px 10px; }

.lane-head strong { font-family: var(--font-head); font-size: 13.5px; font-weight: 700; }

.lane-head small { color: var(--muted); font-size: 11.5px; grid-column: 1 / -1; }

.lane-dot { border-radius: 50%; height: 9px; width: 9px; }

.lane-bot .lane-dot { background: var(--live); }

.lane-live_waiting .lane-dot { animation: pulse 1.6s infinite; background: var(--hot); }

.lane-live .lane-dot { background: var(--accent); }

.lane-count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-num); font-size: 12px; font-weight: 700; padding: 0 8px; }

.lane-body { display: flex; flex-direction: column; gap: 8px; }

.lane-empty { border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 12.5px; padding: 14px; text-align: center; }

.board-empty { color: var(--muted); font-size: 13px; grid-column: 1 / -1; padding: 6px 2px; }

.board-empty a { color: var(--accent-text); }

.lane .tile { background: var(--surface); border-left: 3px solid transparent; }

.lane .tile-bot { border-left-color: var(--live); }

.lane .tile-live_waiting { border-left-color: var(--hot); }

.lane .tile-live { border-left-color: var(--accent); }

.tile-state { align-items: center; display: flex; gap: 8px; }

.step-progress { background: var(--track); border-radius: 3px; flex: 0 0 56px; height: 5px; overflow: hidden; }

.step-progress span { background: var(--live); display: block; height: 100%; }

:root[data-look="acibadem"] .lane { background: #e9eff8; }

@media (prefers-color-scheme: dark) { :root[data-look="acibadem"]:not([data-theme="light"]) .lane { background: #041029; } }

:root[data-look="acibadem"][data-theme="dark"] .lane { background: #041029; }

@media (max-width: 1380px) {
  .mon-layout { grid-template-columns: minmax(0, 1fr); }
  .focus-panel { position: static; }
}

@media (max-width: 860px) {
  .board { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- five steps as a connected journey line (all looks) ---------- */
.wf-strip { background: transparent; border: 0; border-radius: 0; display: flex; gap: 0; margin-top: 14px; overflow: visible; }

.wf-step { align-items: center; background: transparent; border: 0; border-radius: 0; display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 0 4px 4px; position: relative; text-align: center; }

.wf-step::before { background: var(--line-strong); content: ""; height: 2px; left: -50%; position: absolute; top: 13px; width: 100%; z-index: 0; }

.wf-step:first-child::before { display: none; }

.wf-step.wf-done::before { background: var(--good); }

.wf-step .wf-dot { border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); height: 28px; position: relative; width: 28px; z-index: 1; }

.wf-step .wf-text { align-items: center; }

.wf-step[aria-selected="true"] { background: transparent; }

.wf-step[aria-selected="true"] .wf-dot { box-shadow: 0 0 0 3px var(--accent); }

.wf-step[aria-selected="true"] strong { color: var(--accent-text); }

.wf-done .wf-dot { background: var(--good); color: #ffffff; }

.wf-warn .wf-dot { background: var(--warm); color: #1a1003; }

.wf-fail .wf-dot { background: var(--hot); color: #ffffff; }

.wf-pending .wf-dot { background: var(--surface); color: var(--muted); }


.tile-top { flex-wrap: nowrap; }

.tile-top .signals { flex-wrap: nowrap; min-width: 0; }

.tile-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tile-top .chip { flex: none; }
.tile-prio { margin-left: auto; }

.side-foot a { display: block; margin-top: 5px; }

/* ---------- Acıbadem mark, top left of every page (as in Acıbadem GPT) ---------- */
.brand-row { align-items: center; display: flex; gap: 12px; min-width: 0; }

.brand-row .brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.gpd-logo { border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6), 0 0 14px rgba(255, 255, 255, 0.18); display: block; flex: none; height: 36px; width: 36px; }

.gpd-logo.lg { border-radius: 14px; height: 52px; margin-bottom: 8px; width: 52px; }

.side-brand.brand-row { flex-direction: row; gap: 10px; }

.side-brand .gpd-logo { height: 38px; width: 38px; }

:root[data-look="acibadem"] .side-brand.brand-row strong { font-size: 15px; white-space: nowrap; }

:root[data-look="acibadem"] .side-brand.brand-row small { font-size: 9.5px; letter-spacing: 0.12em; }

/* ---------- İş Süreci: six stages, who does each, the rules in force ---------- */
.pr-flow { display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; margin: 0 0 18px; padding: 0; }

.pr-step { position: relative; }

.pr-step:not(:last-child)::after { color: var(--muted); content: "→"; font-size: 14px; position: absolute; right: -10px; top: 50%; transform: translate(50%, -50%); z-index: 1; }

.pr-step a { background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 12px 10px; text-decoration: none; }

.pr-step a:hover { border-color: var(--accent-line); }

.pr-step strong { font-family: var(--font-head, inherit); font-size: 14px; }

.pr-step small { color: var(--muted); font-size: 12px; }

.pr-num { align-items: center; background: var(--accent-soft); border-radius: 50%; color: var(--accent-text); display: inline-flex; flex: none; font-size: 12px; font-weight: 700; height: 24px; justify-content: center; width: 24px; }

.pr-step .pr-num { margin-bottom: 4px; }

.pr-actor { align-self: flex-start; border-radius: 999px; font-size: 11px; font-weight: 700; margin-top: 6px; padding: 2px 9px; }

.pr-aida .pr-actor { background: #072562; color: #ffffff; }

.pr-system .pr-actor { background: var(--warm-soft); color: var(--warm-text); }

.pr-agent .pr-actor { background: var(--cold-soft); color: var(--cold-text); }

.pr-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.pr-card { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }

.pr-card header { align-items: center; display: flex; gap: 10px; }

.pr-card header h2 { flex: 1; margin: 0; }

.pr-card header .pr-actor { margin-top: 0; }

.pr-card ul { color: var(--ink-2); display: flex; flex-direction: column; font-size: 13px; gap: 7px; line-height: 1.5; margin: 0; padding-left: 18px; }

.pr-card ul b { color: var(--ink); }

.pr-card footer { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; font-size: 12.5px; gap: 6px 14px; margin-top: auto; padding-top: 10px; }

.pr-card footer a { color: var(--accent-text); font-weight: 600; text-decoration: none; }

.pr-card footer a:hover { text-decoration: underline; }

.pr-note { font-size: 12px; margin: 14px 0 0; }

@media (prefers-color-scheme: dark) {
  :root[data-look="acibadem"]:not([data-theme="light"]) .pr-aida .pr-actor { background: #0a4fa3; }
}

:root[data-look="acibadem"][data-theme="dark"] .pr-aida .pr-actor { background: #0a4fa3; }

@media (max-width: 1280px) {
  .pr-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pr-step:nth-child(3)::after { display: none; }
  .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .pr-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-step::after { display: none; }
  .pr-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Ayarlar → Atama kuralları ---------- */
.rt-intro { font-size: 12.5px; line-height: 1.5; margin: 0 0 10px; }

.rt-points { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 4px; }

.rt-points label { background: var(--surface-3); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }

.rt-points label span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.rt-points label span::after { content: " · puan"; font-weight: 500; letter-spacing: 0; text-transform: none; }

.rt-points .num-input { width: 100%; }

#routing-card .toggle-row:first-of-type { border-top: 1px solid var(--line); }

.rt-link { color: var(--accent-text); font-size: 12.5px; font-weight: 600; text-decoration: none; }

#routing-card .menu-trigger { white-space: nowrap; }

/* =========================================================
   No badges: counts, statuses, priorities and labels read as plain text
   (coloured where the colour means something), never as pills with dots.
   ========================================================= */
.chip, .chip.flag-chip, .chip.st, .chip.prio {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0;
}

.chip::before { content: none !important; display: none !important; }

.chips { column-gap: 0; }

.chips .chip + .chip::before, .tile-state .chip::before { content: none; }

.chips > .chip:not(:first-child) { border-left: 1px solid var(--line-strong) !important; margin-left: 10px; padding-left: 10px; }

.chip.prio-hot { color: var(--hot-text); }

.chip.prio-warm { color: var(--warm-text); }

.chip.prio-cold { color: var(--cold-text); }

.chip.prio-none, .chip.st-lost, .chip.st-abandoned, .chip.st-no_consent { color: var(--muted); }

.chip.st-live_waiting { color: var(--hot-text); }

.chip.st-live { color: var(--accent-text); }

.chip.st-bot { color: var(--cold-text); }

.chip.st-booked { color: var(--good-text); }

.demo-badge { background: transparent !important; border: 0 !important; font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 0; text-transform: none; }

/* sidebar counts: a number, red only when something waits */
.nav .count, .nav .count.alert, :root[data-look="acibadem"] .nav .count.alert { background: transparent !important; border-radius: 0; font-variant-numeric: tabular-nums; padding: 0; }

.nav .count.alert, :root[data-look="acibadem"] .nav .count.alert { color: #ff9a85; font-weight: 700; }

/* header status line: plain figures separated by thin rules */
.top-live { align-items: center; column-gap: 0; }

.live-pill, :root[data-look="acibadem"] .live-pill, :root[data-look="acibadem"] .live-pill.on.live-waiting {
  background: transparent !important; border: 0 !important; border-radius: 0; padding: 2px 12px;
}

.live-pill + .live-pill { border-left: 1px solid var(--line) !important; }

:root[data-look="acibadem"] .live-pill + .live-pill { border-left-color: rgba(255, 255, 255, 0.18) !important; }

.live-pill:first-child { padding-left: 0; }

.live-pill i { display: none; }

:root[data-look="acibadem"] .live-pill.on.live-waiting b { color: #ff9a85; }

:root[data-look="acibadem"] .live-pill.on.live-waiting { color: #ffd3c8; }

.lane-count { background: transparent !important; border: 0 !important; color: var(--muted); font-size: 13px; padding: 0; }

.tile-prio .chip { font-size: 12px; }

/* İş Süreci: who does a stage is a coloured word, not a pill */
.pr-actor, .pr-aida .pr-actor, .pr-system .pr-actor, .pr-agent .pr-actor,
:root[data-look="acibadem"] .pr-aida .pr-actor { background: transparent !important; border-radius: 0; font-size: 12px; letter-spacing: 0.02em; padding: 0; }

.pr-aida .pr-actor { color: var(--accent-text); }

.pr-system .pr-actor { color: var(--warm-text); }

.pr-agent .pr-actor { color: var(--cold-text); }

/* ---------- monitor focus + lead conversation, same language as the Aida screen ---------- */
.focus-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }

.focus-card .cv-head { padding: 14px 16px 6px; }

.focus-card .focus-actions { padding: 4px 16px 6px; }

.focus-card .cv-journey { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }

.convo { border-radius: 16px; overflow: hidden; padding: 0; }

.convo .convo-head { border-bottom: 1px solid var(--line); padding: 12px 16px; }

.convo .convo-body.cv-thread { padding: 0; }

.convo .convo-body .dm-list { padding: 16px 18px 12px; }

.convo .composer-note, .convo .composer-tabs, .convo .composer { margin-left: 16px; margin-right: 16px; }

.convo .composer { margin-bottom: 14px; }

/* ---------- help drawer ---------- */
.help-drawer { padding: 0; }

.hd-head { align-items: center; background: var(--brand-band, var(--surface)); color: var(--brand-band-ink, var(--ink)); display: flex; justify-content: space-between; padding: 18px 20px; position: sticky; top: 0; z-index: 1; }

.hd-head h3 { font-family: var(--font-head, inherit); font-size: 18px; margin: 0; }

.hd-head small { color: var(--brand-band-muted, var(--muted)); font-size: 12.5px; }

.hd-close { align-items: center; background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; color: inherit; cursor: pointer; display: inline-flex; height: 34px; justify-content: center; width: 34px; }

.hd-close:hover { background: rgba(255, 255, 255, 0.1); }

.hd-sec { border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; }

.hd-sec h4 { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; margin: 0; text-transform: uppercase; }

.hd-tips { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }

.hd-tips li { color: var(--ink-2); font-size: 13px; line-height: 1.5; padding-left: 16px; position: relative; }

.hd-tips li::before { background: var(--bar); border-radius: 50%; content: ""; height: 6px; left: 2px; position: absolute; top: 7px; width: 6px; }

.hd-tour { align-items: center; flex-direction: row; justify-content: space-between; }

.hd-tour > div { display: flex; flex-direction: column; gap: 2px; }

.hd-tour strong { font-size: 13.5px; }

.hd-tour span { color: var(--muted); font-size: 12.5px; }

.hd-faq { border-top: 1px solid var(--line); }

.hd-faq details { border-bottom: 1px solid var(--line); }

.hd-faq summary { align-items: center; color: var(--ink); cursor: pointer; display: flex; font-size: 13.5px; font-weight: 600; gap: 10px; justify-content: space-between; list-style: none; padding: 11px 2px; }

.hd-faq summary::-webkit-details-marker { display: none; }

.hd-faq summary::after { color: var(--muted); content: "+"; font-size: 16px; font-weight: 400; }

.hd-faq details[open] summary::after { content: "–"; }

.hd-faq details p { color: var(--ink-2); font-size: 13px; line-height: 1.55; margin: 0 2px 12px; }

.hd-keys { display: grid; gap: 8px 14px; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }

.hd-keys dt { align-items: center; display: flex; gap: 6px; }

.hd-keys dd { color: var(--ink-2); font-size: 13px; margin: 0; }

.hd-keys kbd { background: var(--surface-3); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 700; min-width: 24px; padding: 1px 7px; text-align: center; }

.hd-then { color: var(--muted); font-size: 11.5px; }

.hd-form { display: flex; flex-direction: column; gap: 10px; }

.hd-seg { background: var(--surface-3); border-radius: 10px; display: grid; gap: 2px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; }

.hd-seg button { background: transparent; border: 0; border-radius: 8px; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 4px; }

.hd-seg button[aria-pressed="true"] { background: var(--card-bg); box-shadow: 0 1px 3px rgba(7, 37, 98, 0.14); color: var(--ink); }

/* ---------- team editor ---------- */
.modal.team-modal { border-radius: 16px; gap: 0; max-width: 720px; padding: 0; }

.team-modal > h3 { background: var(--brand-band, var(--surface)); color: var(--brand-band-ink, var(--ink)); font-family: var(--font-head, inherit); font-size: 18px; padding: 18px 22px; }

.team-modal .modal-actions { background: var(--surface-2); border-top: 1px solid var(--line); bottom: 0; padding: 14px 22px; position: sticky; }

.tm-body { display: flex; flex-direction: column; }

.tm-name { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 6px; }

.tm-name span, .tm-label { color: var(--muted); font-size: 12px; font-weight: 700; }

.tm-sec { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 16px 22px 4px; }

.tm-sec h4 { color: var(--ink); font-family: var(--font-head, inherit); font-size: 14px; margin: 0; }

.tm-sec h4 small { color: var(--muted); font-family: var(--font-body, inherit); font-size: 12px; font-weight: 500; margin-left: 6px; }

.tm-scope { display: flex; flex-direction: column; gap: 12px; }

.tm-row { align-items: center; display: grid; gap: 12px; grid-template-columns: 120px minmax(0, 1fr); }

.tm-row-top { align-items: start; }

.tm-row .tm-label { display: flex; flex-direction: column; gap: 2px; padding-top: 5px; }

.tm-label small { color: var(--muted); font-size: 11px; font-weight: 500; }

.tm-label-top { margin-top: 2px; }

.tm-label-top small { margin-left: 6px; }

.team-modal .chip-toggle-row { gap: 5px; }

.team-modal .chip-toggle { border-radius: 8px; font-size: 12.5px; padding: 4px 9px; }

.tm-people { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tm-person { align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); cursor: pointer; display: flex; font: inherit; font-size: 13px; gap: 8px; padding: 6px 8px; text-align: left; }

.tm-person .avatar { align-items: center; background: var(--surface-3); border-radius: 50%; color: var(--muted); display: inline-flex; flex: none; font-size: 10.5px; font-weight: 700; height: 24px; justify-content: center; width: 24px; }

.tm-person[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }

.tm-person[aria-pressed="true"] .avatar { background: var(--accent); color: #ffffff; }

.tm-add { display: flex; gap: 8px; }

.tm-add .input { flex: 1; }

.tm-sla { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 14px; }

.tm-sla label { display: flex; flex-direction: column; gap: 6px; }

.tm-sla label span { font-size: 12px; font-weight: 700; }

.tm-sla .prio-hot { color: var(--hot-text); }

.tm-sla .prio-warm { color: var(--warm-text); }

.tm-sla .prio-cold { color: var(--cold-text); }

@media (max-width: 640px) {
  .tm-row { grid-template-columns: minmax(0, 1fr); }
  .tm-people, .tm-sla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- settings ---------- */
.settings-grid .card h2 { margin-bottom: 4px; }

.st-sub { background: var(--surface-3); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; margin: 2px 0 10px; padding: 12px; }

.price-head, .price-row { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) 28px; }

.price-head span { color: var(--muted); font-size: 11.5px; font-weight: 700; }

.price-head small { font-weight: 500; }

.price-row .menu, .price-row .menu-trigger { width: 100%; }

.price-row .menu-trigger { justify-content: space-between; }

.price-row .input { min-width: 0; width: 100%; }

#price-rows { display: flex; flex-direction: column; gap: 6px; }

.row-remove { background: transparent; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 18px; height: 28px; line-height: 1; width: 28px; }

.row-remove:hover { background: var(--hot-soft); color: var(--hot-text); }

.add-row { align-self: flex-start; }

.ins-source { color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }

.ins-source a { color: var(--accent-text); font-weight: 600; }

.ins-pick-head { align-items: baseline; display: flex; justify-content: space-between; margin-top: 4px; }

.ins-pick-head strong { font-size: 13px; }

.ins-pick-head small { color: var(--muted); font-size: 12px; }

.ins-list { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 260px; overflow-y: auto; padding-right: 2px; }

.ins-item { align-items: center; background: var(--card-bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; display: flex; font: inherit; font-size: 12.5px; gap: 8px; justify-content: space-between; padding: 7px 10px; text-align: left; }

.ins-item span { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ins-item small { color: var(--muted); flex: none; font-size: 11.5px; }

.ins-item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }

.ins-item[aria-pressed="true"] span { color: var(--accent-text); }

.ch-status { color: var(--muted); flex: none; font-size: 12.5px; font-weight: 600; }

.ch-status.on { color: var(--good-text); }

.st-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 8px; }

.st-foot { font-size: 12px; }

.channel-row strong .icon-btn { margin-left: 4px; vertical-align: -3px; }

.st-sub.is-off { opacity: 0.5; }
