/* EduCRM design system, Raisoni brand edition · one stylesheet, no build step (works on cPanel as-is).
   Brand palette from the Raisoni visual identity guidelines: purple 5C0F8B (Pantone 2597 C), orange FF5100
   (Orange 021 C), grey 6D6F70. Merriweather for headings and figures, Open Sans for text, as in the guidelines.
   Orange marks "you are here" and small accents only (it is too light for body text). */

@font-face { font-family: "Open Sans"; src: url("fonts/open-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/open-sans-latin-600-normal.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/open-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("fonts/merriweather-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("fonts/merriweather-latin-700-normal.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  /* chrome */
  --chalk: #2a0a40;          /* sidebar / deepest ink */
  --chalk-2: #40135e;        /* sidebar hover */
  --chalk-ink: #dccbe9;      /* sidebar text */
  --marigold: #ff5100;       /* "you are here" accent */
  /* surfaces & ink */
  --bg: #f6f4f8;
  --panel: #ffffff;
  --panel-2: #faf8fb;
  --ink: #1f1626;
  --ink-2: #423948;
  --muted: #6d6f70;
  --line: #e7e1ec;
  --line-2: #d6cddd;
  /* actions & state */
  --brand: #5c0f8b;
  --brand-hover: #4a0b72;
  --brand-ink: #ffffff;
  --brand-soft: #f1e8f8;
  --ok: #157a3d;
  --ok-soft: #e3f4e9;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  /* chart roles (validated reference palette, light mode) */
  --series-1: #7a2fb5; --series-2: #ff5100; --series-3: #2a78d6; --series-4: #1baf7a;
  --series-5: #eda100; --series-6: #e87ba4; --series-7: #008300; --series-8: #1595b0;
  --funnel: #5c0f8b;
  --grid: #ece8ef;
  --axis: #cbc2d2;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(42, 10, 64, .06);
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --font-head: "Merriweather", Georgia, "Noto Serif Devanagari", serif;
  font-size: 13px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
h1 { font-family: var(--font-head); font-size: 19.5px; line-height: 1.3; margin: 0; font-weight: 700; color: var(--chalk); }
h2 { font-family: var(--font-head); font-size: 13.5px; margin: 0 0 12px; font-weight: 700; color: var(--chalk); }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--ink-2); }
small, .muted { color: var(--muted); }
.mono, td.num, th.num, .kpi b { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--chalk) 236px, transparent 236px); }
.side { background: var(--chalk); color: var(--chalk-ink); padding: 16px 12px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #55247a transparent; }
.brand { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 14.5px; line-height: 1.25; padding: 4px 10px 18px; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--marigold); color: var(--chalk); display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.brand-logo { max-height: 30px; max-width: 120px; border-radius: 6px; background: #fff; padding: 2px; }
.brand.has-logo { background: #fff; border-radius: 10px; padding: 12px 14px; margin: 0 0 18px; justify-content: center; }
.brand.has-logo .brand-logo { max-height: 54px; max-width: 100%; padding: 0; border-radius: 0; }
.nav { display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--chalk-ink); padding: 6px 10px; border-radius: 8px; margin-bottom: 1px; font-weight: 500; position: relative; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav a:hover { background: var(--chalk-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--chalk-2); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--marigold); }
.nav a.on svg { opacity: 1; stroke: var(--marigold); }
.nav .group { font-size: 11px; color: #b49ac8; margin: 18px 10px 6px; font-weight: 600; }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--marigold); color: var(--chalk); font-size: 10.5px; font-weight: 700; text-align: center; line-height: 18px; }
.nav .count[hidden] { display: none; }
.side .me { border-top: 1px solid #4a1b6a; margin-top: 18px; padding: 14px 10px 0; font-size: 12px; }
.side .me a { color: #fff; }
.side .me button { background: none; border: 0; color: #c7b3d6; padding: 0; cursor: pointer; font: inherit; }
.main { padding: 0 32px 48px; min-width: 0; }

/* app bar: search, quick add, bell, person */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 0; margin-bottom: 14px; background: var(--bg); border-bottom: 1px solid transparent; }
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar form { flex: 1; max-width: 460px; position: relative; }
.appbar input[type=search] { padding-left: 36px; background: var(--panel); border-color: var(--line); height: 38px; }
.appbar form svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; }
.appbar .spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--panel-2); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.icon-btn .count[hidden] { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid #dcc7ec; }
.avatar:hover { text-decoration: none; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar small { display: block; margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.side-main { grid-template-columns: minmax(0, 1fr) 340px; }

/* key numbers: a single strip divided by hairlines, not separate cards */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: block; color: inherit; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-family: var(--font-head); font-size: 24px; line-height: 1.2; margin-top: 4px; font-weight: 700; color: var(--ink); }
.kpi.alert b { color: var(--bad); }
.grid:has(> .kpi) { gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.grid:has(> .kpi) > .kpi { border: 0; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); }
.grid:has(> .kpi) > .kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--panel-2); text-decoration: none; }
.kpi .delta { font-size: 11px; font-weight: 600; margin-left: 6px; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--bad); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf7fc; }
tfoot th { background: var(--panel-2); color: var(--ink); border-top: 1px solid var(--line-2); }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
td strong a, td a strong { color: var(--ink); }
td a:hover strong { color: var(--brand); }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input:not([type]), input[type=text], input[type=url], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=tel], input[type=file], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input[type=file] { padding: 6px 8px; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(92, 15, 139, .15); }
input:disabled, select:disabled { background: var(--panel-2); color: var(--muted); }
textarea { min-height: 76px; resize: vertical; }
select[multiple] { min-height: 110px; }
::placeholder { color: #9a9a9c; }
.field { margin-bottom: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 12.5px; margin-bottom: 8px; color: var(--ink); }
.check input { margin: 0; accent-color: var(--brand); width: 16px; height: 16px; }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); }
.filters { display: grid; gap: 10px; grid-template-columns: 2fr repeat(5, 1fr) auto; align-items: end; }
.filters .field { margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); border-color: #c3b6cd; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f2c3be; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 11.5px; border-radius: 6px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
button:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- small parts */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #efebf2; color: var(--ink-2); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.score { display: inline-block; min-width: 32px; text-align: center; padding: 1px 7px; border-radius: 6px; font-weight: 700; font-size: 11px; }
.score.hi { background: var(--ok-soft); color: var(--ok); }
.score.mid { background: var(--warn-soft); color: var(--warn); }
.score.lo { background: #efebf2; color: var(--muted); }
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--ok-soft); color: #0f5a2e; border: 1px solid #bfe3cc; }
.flash.err { background: var(--bad-soft); color: #8f1c13; border-color: #f4c8c3; }
.flash.key { background: var(--warn-soft); color: #5c3600; border-color: #f1d4a0; word-break: break-all; }
.overdue { color: var(--bad); font-weight: 600; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; background: #f1edf4; padding: 2px 6px; border-radius: 5px; }
pre.code { padding: 12px; overflow-x: auto; white-space: pre-wrap; border: 1px solid var(--line); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--tag, #475569);
  background: color-mix(in srgb, var(--tag, #64748b) 12%, #fff); border: 1px solid color-mix(in srgb, var(--tag, #64748b) 30%, #fff); margin: 2px 4px 0 0; white-space: nowrap; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker label { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; margin: 0; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.chance { font-weight: 700; }
.chance.hi { color: var(--ok); } .chance.mid { color: var(--warn); } .chance.lo { color: var(--muted); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* old CSS bar lists (still used on a few pages) */
.bars .bar { display: grid; grid-template-columns: 160px 1fr 72px; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 12px; }
.bars .track { background: #efebf2; border-radius: 4px; height: 12px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 4px; background: var(--brand); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.spark div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.spark-labels { display: flex; gap: 4px; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.spark-labels span { flex: 1; text-align: center; }

/* ---------------------------------------------------------------- lead page */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 12px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #cbc2d2; box-shadow: 0 0 0 3px var(--panel); }
.timeline li.t-call::before { background: var(--series-3); }
.timeline li.t-stage_change::before { background: var(--series-7); }
.timeline li.t-assignment::before { background: var(--series-4); }
.timeline li.t-re_enquiry::before, .timeline li.t-created::before { background: var(--series-1); }
.timeline li.t-whatsapp::before { background: #25a35a; }
.timeline .body { white-space: pre-line; margin-top: 2px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
dl.facts { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: 12.5px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
details.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--panel); box-shadow: var(--shadow); }
details.box summary { cursor: pointer; font-weight: 600; }
details.box[open] summary { margin-bottom: 12px; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #f8f3fb; }
.notif .dot { margin-top: 6px; background: var(--brand); }
.notif.read .dot { background: transparent; }
.dupe { border: 1px solid #f1d4a0; background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.danger-zone { border-color: #f4c8c3; }
.doc-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- sign-in & public pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px rgba(42, 10, 64, .07); }
.card.wide { max-width: 540px; }
body.auth { background: var(--chalk) radial-gradient(circle at 20% 10%, #3a1157 0, transparent 50%); }
body.portal { background: var(--bg); }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.portal-top nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.portal-brand { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.portal-brand img { max-height: 46px; padding: 3px 0; }
.portal-brand .portal-sub { font-family: var(--font-head); color: var(--brand); font-size: 14px; padding-left: 14px; margin-left: 6px; border-left: 2px solid var(--marigold); }
.portal-brand:hover { text-decoration: none; }
.portal-main { max-width: 920px; margin: 28px auto; padding: 0 16px; }
.portal-foot { text-align: center; padding: 24px; font-size: 11.5px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps span { padding: 6px 12px; border-radius: 999px; background: #efebf2; font-size: 11px; font-weight: 600; color: var(--muted); }
.steps span.done { background: var(--ok-soft); color: var(--ok); }
.steps span.now { background: var(--brand); color: #fff; }
.letter { background: #fff; padding: 40px; border: 1px solid var(--line); max-width: 760px; margin: 0 auto; line-height: 1.6; }
@media print { .no-print, .portal-top, .portal-foot, .side, .appbar { display: none !important; } body { background: #fff; } .letter { border: 0; padding: 0; } .main { padding: 0; } .shell { display: block; } }

/* ---------------------------------------------------------------- inbox, booking, AI */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.inbox-list { max-height: 72vh; overflow-y: auto; }
.inbox-row { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.inbox-row:hover { background: var(--panel-2); text-decoration: none; }
.inbox-row.on { background: var(--brand-soft); }
.inbox-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .count { background: var(--ok); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 10.5px; }
.inbox-back { display: none; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow-y: auto; padding: 12px; background: #ece7df; border-radius: var(--radius); }
.bubble { max-width: 75%; padding: 7px 11px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: normal; word-wrap: break-word; }
.bubble.out { align-self: flex-end; background: #d9fdd3; }
.bubble.in { align-self: flex-start; }
.bubble small { display: block; text-align: right; font-size: 10.5px; margin-top: 2px; }
.chat-reply { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-reply textarea { flex: 1; min-height: 44px; }
.day-pick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.day-pick a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 11px; text-align: center; color: var(--ink); background: var(--panel); font-size: 12px; }
.day-pick a b { display: block; font-size: 10.5px; color: var(--muted); }
.day-pick a.on { border-color: var(--brand); background: var(--brand-soft); }
.slot-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.slot-pick label { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 11px; cursor: pointer; background: var(--panel); margin: 0; }
.slot-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ai-box .score { font-size: 16.5px; padding: 4px 10px; }
.reasons { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12px; }
.reasons li { padding: 2px 0; }
.reasons li.up { color: var(--ok); }
.reasons li.down { color: var(--bad); }
.nba { border-left: 3px solid var(--brand); padding: 4px 0 4px 10px; margin-bottom: 8px; }
.ai-summary { white-space: pre-wrap; background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; font-size: 12px; }
.lang-switch { font-size: 12px; margin-left: 8px; white-space: nowrap; }
.lang-switch a { text-decoration: none; }
.form-lang { text-align: right; margin: 0 0 6px; }
.consent a { white-space: nowrap; }
.lead-total { font-size: 14px; font-weight: 400; }

/* ---------------------------------------------------------------- charts (assets/charts.js) */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart .tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .label { fill: var(--ink-2); font-size: 11.5px; }
.chart .value { fill: var(--ink); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .mark { transition: opacity .12s; }
.chart .dim .mark { opacity: .35; }
.chart .dim .mark.hot { opacity: 1; }
.chart-tip { position: absolute; pointer-events: none; z-index: 30; background: var(--chalk); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.4; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translate(-50%, calc(-100% - 10px)); }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--ink-2); margin: 0 0 10px; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.funnel-step-rate { fill: var(--muted); font-size: 10.5px; }

/* ---------------------------------------------------------------- report builder */
.rb { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rb-fields { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.rb-fields h3 { margin: 14px 0 6px; }
.rb-chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 5px; cursor: grab; font-size: 12px; user-select: none; }
.rb-chip:hover { border-color: var(--brand); }
.rb-chip .kind { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; }
.rb-chip.dim .kind { background: #e6effb; color: #1c5cab; }
.rb-chip.measure .kind { background: #f1e8f8; color: var(--brand); }
.rb-chip .x { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14.5px; line-height: 1; padding: 0 2px; }
.rb-chip.dragging { opacity: .4; }
.rb-zones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rb-zone { min-height: 92px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 10px; background: var(--panel-2); transition: border-color .12s, background .12s; }
.rb-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.rb-zone > b { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; }
.rb-zone .hint { font-size: 11px; color: var(--muted); }
.rb-zone .rb-chip { cursor: grab; }
.rb-filter-vals { width: 100%; margin-top: 4px; }
.rb-viz { display: flex; gap: 6px; flex-wrap: wrap; }
.rb-viz button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.rb-viz button.on { background: var(--chalk); color: #fff; border-color: var(--chalk); }

/* ---------------------------------------------------------------- extensions */
.ext-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.ext-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 70px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.ext-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.ext-nav a:hover { background: var(--panel-2); }
.ext-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.ext-ico { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2); font-size: 13px; color: var(--ink-2); flex: none; }
.ext-nav a.on .ext-ico { background: #fff; }
.ext-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ext-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; position: relative; min-height: 210px; box-shadow: var(--shadow); }
.ext-card .ext-logo { height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17.5px; font-weight: 700; letter-spacing: -.01em; }
.ext-card .ext-logo .mark { width: 42px; height: 42px; border-radius: 11px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18.5px; }
.ext-card p { text-align: center; margin: 0; color: var(--muted); font-size: 12.5px; flex: 1; }
.ext-card .ext-actions { display: flex; gap: 10px; justify-content: center; }
.ext-card .ext-actions .btn { flex: 1; max-width: 170px; }
.ext-status { position: absolute; top: 12px; right: 12px; font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.ext-status.off { background: #efebf2; color: var(--muted); }
.ext-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 0 16px; flex-wrap: wrap; }
.ext-tabs a { padding: 10px 2px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; margin-bottom: -1px; }
.ext-tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.kv { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px 20px; align-items: center; margin: 0; }
.kv dt { color: var(--ink-2); font-weight: 600; }
.kv dd { margin: 0; word-break: break-all; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d2c8da; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span:before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--marigold); outline-offset: 2px; }
.switch input:disabled + span { opacity: .55; cursor: not-allowed; }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
.info-box { border-left: 3px solid var(--brand); background: var(--panel-2); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 12px 0; }

.rb-chip.used { opacity: .55; }
.rb-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-zone.can { border-color: #c39be0; }
.rb-zone.filled .hint { display: none; }
.rb-zone .rb-chip { background: #fff; }
.rb-filter { margin: -2px 0 8px 26px; font-size: 11.5px; }
.rb-filter summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.rb-filter-list { max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.rb-filter-list .check { font-size: 11.5px; margin-bottom: 4px; }
.rb-filter-find { margin-bottom: 6px; height: 32px; }
.rb-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.rb-head label { margin-bottom: 4px; }
.rb-head .rb-name { flex: 1 1 260px; }
.rb-custom { display: flex; gap: 10px; }
.rb-custom[hidden] { display: none; }
.rb-save { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.rb-save .check { margin: 0; }
.rb-opts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rb-opts label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.rb-opts select { width: auto; height: 32px; padding-top: 2px; padding-bottom: 2px; }
.rb-opts .spacer { flex: 1; }
.rb-chart { margin-bottom: 16px; }
.rb-result { transition: opacity .15s; }
.rb-result.loading { opacity: .55; }
.rb-result th.grp { text-align: center; border-left: 1px solid var(--line); }
.rb-toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; box-shadow: 0 8px 24px rgba(42,10,64,.18); margin: 0; }

/* ---------------------------------------------------------------- admission form (7 steps) */
.af-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0 16px; counter-reset: none; }
.af-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 12px; }
.af-steps a:hover { text-decoration: none; border-color: var(--brand); }
.af-steps .n { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: #efebf2; color: var(--muted); font-size: 11px; font-weight: 700; }
.af-steps a.done .n { background: var(--brand-soft); color: var(--brand); }
.af-steps a.now { background: var(--brand); border-color: var(--brand); color: #fff; }
.af-steps a.now .n { background: var(--marigold); color: #2a0a40; }
.af-section { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.af-section legend { font-family: var(--font-head); font-weight: 700; color: var(--brand); font-size: 13px; padding: 0 0 8px; width: 100%; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.af-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; }
.af-grid .field { margin-bottom: 12px; min-width: 0; }
.af-grid .af-wide { grid-column: 1 / -1; }
.af-grid .field[hidden] { display: none; }
.af-grid .af-other { margin-top: 6px; }
.af-grid .af-other[hidden] { display: none; }
.af-grid small { display: block; margin-top: 3px; }
.req { color: var(--bad); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); background: #fff8f7; }
.field-error { color: var(--bad); font-weight: 600; }
.af-actions { display: flex; gap: 10px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.af-actions .spacer { flex: 1; }
.af-declaration { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--marigold); border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 0 0 14px; font-size: 12px; line-height: 1.6; }
.af-photo { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.af-view { border-top: 1px solid var(--line); padding: 8px 0; }
.af-view summary { cursor: pointer; font-weight: 700; color: var(--brand); padding: 4px 0; }
.af-view .facts { margin-top: 8px; }
@media (max-width: 900px) { .af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .af-grid { grid-template-columns: 1fr; } .af-steps a { font-size: 11px; } }

/* ---------------------------------------------------------------- Lead Manager */
.lm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lm-head h1 { font-size: 22px; margin-right: 6px; }
.lm-head .spacer { flex: 1; }
.lm-qv { position: relative; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.lm-qv-btn { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 2px; border-bottom: 2px solid var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.lm-qv-btn svg, .lm-select svg, .lm-sort svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.lm-qv-pop { position: absolute; top: calc(100% + 8px); left: 70px; z-index: 50; width: 360px; max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(42, 10, 64, .18); padding: 6px 0; }
.lm-qv-group { font-size: 11px; font-weight: 700; color: var(--muted); padding: 10px 16px 4px; }
.lm-qv-row { display: flex; align-items: center; gap: 2px; padding: 2px 8px 2px 16px; }
.lm-qv-row:hover { background: var(--panel-2); }
.lm-qv-row > a { flex: 1; color: var(--ink); padding: 7px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-qv-row.on > a { color: var(--brand); font-weight: 700; }
.lm-qv-row form { margin: 0; }
.lm-qv-empty { padding: 4px 16px 10px; margin: 0; font-size: 12px; }
.lm-ico { border: 0; background: none; padding: 5px; border-radius: 6px; cursor: pointer; color: #a49aac; display: grid; place-items: center; }
.lm-ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.lm-ico:hover { background: #efebf2; color: var(--ink-2); }
.lm-ico.starred { color: var(--marigold); } .lm-ico.starred svg { fill: var(--marigold); }
.lm-ico.shared { color: var(--brand); }
.lm-ico.danger { color: #d0495b; }
.lm-round { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #efebf2; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.lm-round svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.lm-round:hover { background: var(--brand-soft); color: var(--brand); }
.lm-sync { display: flex; align-items: center; gap: 8px; background: #efebf2; border-radius: 10px; padding: 6px 6px 6px 12px; font-size: 11.5px; }
.lm-sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb36b; }
.lm-sync small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.lm-refresh { width: 30px; height: 30px; display: grid; place-items: center; border-left: 1px solid var(--line-2); color: var(--brand); }
.lm-refresh svg, .lm-more-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
.lm-tools { display: flex; align-items: center; gap: 4px; }
.lm-tool { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.lm-tool svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lm-tool svg .fill, .lm-tool svg circle.fill { fill: currentColor; stroke: none; }
.lm-tool:hover, .lm-tool.on { background: #efebf2; color: var(--brand); text-decoration: none; }
.lm-more { position: relative; }
.lm-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(42, 10, 64, .18); padding: 6px 0; }
.lm-menu button, .lm-menu a { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--ink); padding: 8px 18px; cursor: pointer; }
.lm-menu button:hover, .lm-menu a:hover { background: var(--panel-2); color: var(--brand); text-decoration: none; }
.lm-menu .danger { color: var(--bad); }

.lm-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.lm-filters[hidden] { display: none; }
.lm-filters .spacer { flex: 1; }
.lm-fset { width: 44px; height: 44px; border: 0; background: none; color: var(--brand); cursor: pointer; border-right: 1px solid var(--line); padding-right: 10px; display: grid; place-items: center; }
.lm-fset svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.lm-multi, .lm-date, .lm-search { position: relative; }
.lm-search[hidden] { display: none; }
.lm-float { position: absolute; top: -8px; left: 9px; background: #fff; padding: 0 4px; font-size: 10.5px; color: var(--muted); z-index: 1; line-height: 1.2; }
.lm-select { min-width: 180px; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line-2); background: #fff; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; max-width: 240px; }
.lm-select:hover { border-color: var(--brand); }
.lm-search input { height: 40px; width: 240px; }
.lm-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(42, 10, 64, .18); padding: 10px; }
.lm-date .lm-pop { width: 340px; }
.lm-pop-list { max-height: 260px; overflow-y: auto; }
.lm-pop-list .check { margin: 0; padding: 6px 4px; border-radius: 6px; }
.lm-pop-list .check:hover { background: var(--panel-2); }
.lm-pop-find { margin-bottom: 8px; height: 34px; }
.lm-pop-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lm-adv-link { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lm-adv-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.lm-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; font-size: 12px; }
.lm-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; }
.lm-chip a { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); font-size: 14px; }
.lm-chip a:hover { background: #fff; text-decoration: none; }
.lm-clear-all { font-weight: 600; }

.lm-table table { font-size: 13.5px; }
.lm-table th { background: #e7e3eb; color: var(--ink); font-size: 12.5px; font-weight: 700; padding: 11px 12px; position: static; }
.lm-table td { padding: 10px 12px; vertical-align: middle; }
.lm-table tbody tr { position: relative; }
.lm-table tbody tr.untouched td:first-child { box-shadow: inset 4px 0 0 #e5383b; }
.lm-check { width: 46px; text-align: center; }
.lm-check input { width: 17px; height: 17px; accent-color: var(--brand); }
.lm-name { color: var(--brand); font-weight: 600; }
.lm-sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.lm-sort:hover { text-decoration: none; color: var(--brand); }
.lm-sort svg path { stroke: #b4aabb; }
.lm-sort.asc svg .up, .lm-sort.desc svg .down { stroke: var(--brand); }
.lm-wa { display: inline-grid; place-items: center; vertical-align: -3px; margin-right: 4px; color: #25a35a; }
.lm-wa svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lm-wa svg .fill { fill: currentColor; stroke: none; }
.lm-table td.col-created_at, .lm-table td.col-phone { white-space: nowrap; }
.lm-table td .empty { padding: 30px; }
.lm-foot { display: flex; align-items: center; gap: 12px; margin: 14px 0 24px; flex-wrap: wrap; }
.lm-foot .spacer { flex: 1; }
.lm-more-btn.loading { opacity: .6; pointer-events: none; }
.lm-total { border: 0; background: #e3dbf0; color: var(--brand); font: inherit; font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.lm-total.done { background: var(--brand-soft); }
.lm-rows { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--muted); }
.lm-rows select { width: auto; height: 34px; padding: 2px 30px 2px 10px; }
.lm-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--warn-soft); border: 1px solid #f1d4a0; border-radius: 8px; padding: 9px 14px; margin-bottom: 10px; }
.lm-banner[hidden], .lm-banner [hidden] { display: none; }
.lm-selbar { display: flex; gap: 12px; align-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 9px 14px; margin-bottom: 10px; }
.lm-selbar[hidden] { display: none; }

/* drawers (slide in from the right) and modals */
body.lm-locked { overflow: hidden; }
.lm-drawer, .lm-modal { position: fixed; inset: 0; z-index: 90; background: rgba(30, 20, 40, .45); display: flex; justify-content: flex-end; }
.lm-drawer[hidden], .lm-modal[hidden] { display: none; }
.lm-drawer-panel { min-width: 0; max-width: 100vw; width: min(1200px, 92vw); height: 100%; background: #fff; display: flex; flex-direction: column; animation: lm-in .18s ease-out; }
.lm-drawer-panel.narrow { width: min(880px, 94vw); }
@keyframes lm-in { from { transform: translateX(40px); } to { transform: none; } }
.lm-drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.lm-drawer header h2 { margin: 0; font-size: 17.5px; }
.lm-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.lm-drawer footer { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.lm-drawer footer .spacer { flex: 1; }
.lm-adv { flex: 1; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); min-height: 0; }
.lm-adv-left { background: #f6f3fa; padding: 22px; overflow-y: auto; }
.lm-adv-left .field { margin-bottom: 16px; }
.lm-adv-left select, .lm-adv-left input { background: #fff; height: 46px; }
.lm-adv-btns { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 8px; }
.lm-adv-btns .btn { height: 46px; }
.lm-dark { background: #333; color: #fff; border-color: #333; }
.lm-dark:hover { background: #111; }
.lm-dark svg { stroke: #fff; }
.adv-opts { max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.adv-opts .check { margin: 4px 0; }
.adv-find { margin-bottom: 6px; height: 36px !important; }
.lm-adv-right { position: relative; padding: 22px; overflow-y: auto; display: flex; flex-direction: column; }
#adv-list { flex: 1; }
.adv-cond { margin-bottom: 8px; }
.adv-join { display: block; font-size: 10.5px; font-weight: 700; color: var(--marigold); margin: 2px 0 8px 14px; }
.adv-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 12px 14px; background: #fff; }
.adv-card b { color: var(--brand); }
.adv-card button { border: 0; background: none; font-size: 18.5px; cursor: pointer; color: var(--muted); }
.lm-adv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.lm-adv-empty[hidden] { display: none; }
.lm-adv-empty svg { width: 60px; height: 60px; stroke: #b4aabb; fill: #efebf2; stroke-width: 1.4; margin-bottom: 8px; }
.lm-adv-foot { padding: 14px 0 0 !important; border-top: 1px solid var(--line); }
.lm-adv-foot[hidden] { display: none !important; }
.lm-match { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.lm-match select { width: auto; }
.lm-cols { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.lm-cols-left { border-right: 1px solid var(--line); padding: 18px 0 18px 18px; overflow-y: auto; }
.lm-cols-find { position: relative; margin: 0 18px 12px 0; }
.lm-cols-find svg { position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; stroke: var(--brand); fill: none; stroke-width: 2; }
.lm-cols-find input { border-radius: 999px; padding-left: 42px; height: 44px; }
.lm-cols-left h3 { font-size: 14px; color: var(--ink); margin: 14px 0 4px; }
.cols-opt { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 10px 6px; margin: 0; font-weight: 500; border-bottom: 1px solid #f1edf4; cursor: pointer; }
.cols-opt:hover { background: var(--panel-2); }
.cols-opt[hidden] { display: none; }
.cols-opt input { width: 17px; height: 17px; accent-color: var(--brand); }
.lm-cols-right { padding: 18px; overflow-y: auto; }
.lm-cols-head { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14.5px; }
#cols-sel { list-style: none; margin: 0; padding: 0; }
#cols-sel li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 6px; padding: 11px 12px; margin-bottom: 8px; cursor: grab; }
#cols-sel li.locked { background: #fff; cursor: default; }
#cols-sel li.locked .grip { opacity: .3; }
#cols-sel li span:nth-child(2) { flex: 1; }
#cols-sel li.over { border-color: var(--brand); box-shadow: 0 -2px 0 var(--brand); }
#cols-sel li.dragging { opacity: .4; }
#cols-sel .grip { color: var(--brand); letter-spacing: -3px; font-weight: 700; }
#cols-sel button { border: 0; background: none; font-size: 16.5px; cursor: pointer; color: var(--ink); }
.lm-modal { justify-content: center; align-items: flex-start; padding-top: 12vh; }
.lm-modal-box { background: #fff; border-radius: 12px; padding: 22px 24px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(30, 20, 40, .3); }
.lm-modal-box h2 { font-size: 16.5px; margin-bottom: 4px; }
.act-pane[hidden], .act-val[hidden] { display: none; }
@media (max-width: 900px) {
  .lm-adv, .lm-cols { grid-template-columns: 1fr; }
  .lm-adv-right { min-height: 260px; }
  .lm-select { min-width: 150px; }
  .lm-qv-pop { left: 0; width: 300px; }
}

/* ---------------------------------------------------------------- Lead Details */
.ld-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ld-head .spacer { flex: 1; }
.ld-head .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ld-arrows { display: flex; gap: 6px; }
.ld-arrows .lm-round { width: 32px; height: 32px; }
.ld-arrows svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.ld { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.ld-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-bottom: 6px; }
.ld-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ld-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.ld-who { display: flex; gap: 12px; align-items: center; }
.ld-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 15.5px; flex: none; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.ld-name { margin: 0; font-size: 14.5px; line-height: 1.3; }
.ld-stage { font-size: 12px; color: var(--muted); }
.ld-link { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ld-link svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.ld-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.ld-contact { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 8px; font-size: 12px; }
.ld-contact li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ld-contact li > svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; flex: none; }
.ld-contact .ld-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.ld-contact form.inline, form.inline { display: inline; margin: 0; }
.ld-ver { font-weight: 700; font-size: 11px; }
.ld-ver.ok { color: var(--ok); } .ld-ver.no { color: #e5383b; }
.ld-quick { display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.ld-q { width: 41px; height: 38px; border-radius: 8px; border: 0; background: #efebf2; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; position: relative; }
.ld-q svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ld-q svg .fill { fill: currentColor; stroke: none; }
.ld-q span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ld-q:hover { background: var(--brand-soft); color: var(--brand); }
.ld-more { position: relative; }
.ld-more .lm-menu { left: 0; right: auto; z-index: 80; }
.ld-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ld-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 10px; position: relative; text-align: center; }
.ld-tile small { color: var(--muted); font-size: 11px; }
.ld-big { font-family: var(--font-head); font-size: 20px; }
.ld-ring { width: 54px; height: 54px; transform: rotate(-90deg); position: absolute; top: 10px; }
.ld-ring circle { fill: none; stroke-width: 3.2; }
.ld-ring .bg { stroke: #efebf2; } .ld-ring .fg { stroke: var(--brand); stroke-linecap: round; }
.ld-ring .fg.hi { stroke: var(--ok); } .ld-ring .fg.lo { stroke: #c9a227; }
.ld-tile .score { margin: 17px 0 13px; background: none !important; font-size: 12px; }
.ld-sec { padding: 0; }
.ld-sec summary { padding: 13px 16px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; list-style: none; }
.ld-sec summary::-webkit-details-marker { display: none; }
.ld-sec summary::after { content: "›"; transform: rotate(90deg); color: var(--muted); font-size: 16.5px; line-height: 1; transition: transform .15s; }
.ld-sec[open] summary::after { transform: rotate(-90deg); }
.ld-kv { margin: 0; padding: 0 16px 14px; display: grid; gap: 2px; font-size: 12px; }
.ld-kv dt { color: var(--muted); font-size: 11px; margin-top: 6px; }
.ld-kv dd { margin: 0; }
.ld-age { display: inline-block; background: #dde6fb; color: #2a4fa0; border-radius: 4px; padding: 0 6px; font-size: 10.5px; font-weight: 700; }
.ld-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 16px; }
.ld-stats div { background: var(--panel-2); border-radius: 8px; padding: 8px; text-align: center; }
.ld-stats b { display: block; font-size: 14.5px; }
.ld-stats small { color: var(--muted); font-size: 10.5px; }
.ld-coach { display: flex; align-items: center; gap: 12px; background: #ece6f6; border: 1px solid #dccff0; border-radius: var(--radius); padding: 10px 14px; flex-wrap: wrap; }
.ld-coach-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: none; }
.ld-coach-icon svg { width: 18px; height: 18px; fill: #fff; }
.ld-coach > b { color: var(--brand); font-size: 14px; padding-right: 12px; border-right: 1px solid #cdbfe3; }
.ld-coach-text { flex: 1; min-width: 200px; font-size: 12px; }
.ld-coach .ai-summary { background: none; padding: 0; border: 0; margin: 0; white-space: pre-line; }
.ld-why h3 { display: flex; align-items: center; gap: 8px; }
.ld-journey-card { padding: 8px; }
.ld-journey { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; overflow: hidden; }
.ld-journey li { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; padding: 8px 12px 8px 20px; background: #f3f1f7; color: var(--ink-2); font-size: 12px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; white-space: nowrap; }
.ld-journey li:last-child { margin-right: 0; }
.ld-journey li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 999px 0 0 999px; }
.ld-journey li.past { background: #e1f3e8; color: #1d7a45; }
.ld-journey li.now { background: #c9ebd6; color: #12613a; font-weight: 700; }
.ld-tabs-card { padding: 0; }
.ld-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; }
.ld-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 12px 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 12.5px; }
.ld-tabs a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ld-tabs a:hover { text-decoration: none; color: var(--brand); }
.ld-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.ld-pane { padding: 16px 18px 20px; }
.ld-pane[hidden], .ld-sub[hidden] { display: none; }
.ld-pane h3 { font-size: 13px; color: var(--ink); margin: 6px 0 10px; }
.ld-pane table { font-size: 12px; }
.ld-pane th { position: static; }
.ld-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ld-subtabs button { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 6px; padding: 7px 14px; font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ld-subtabs button.on { color: var(--brand); border-color: var(--brand); border-bottom-width: 2px; font-weight: 600; }
.ld-subtabs button svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; display: none; padding: 2px; box-sizing: content-box; border-radius: 4px; }
.ld-subtabs button.on svg, .ld-subtabs button:hover svg { display: block; }
.ld-subtabs button svg:hover { background: var(--panel-2); }
.ld-sub-cfg { margin-left: auto; align-self: center; font-size: 12px; color: var(--muted); }
.ld-sub-extra { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.ld-sub-extra h3 { font-size: 13px; margin: 0 0 10px; }
.ld-facts { display: grid; grid-template-columns: 220px 1fr; gap: 9px 10px; margin: 0; font-size: 12.5px; }
.ld-facts dt { color: var(--ink); font-weight: 500; min-height: 26px; display: flex; align-items: center; }
.ld-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.na { color: var(--muted); }
.ld-facts .colon { color: var(--muted); margin-right: 4px; }
.ld-facts dd { display: flex; align-items: center; min-height: 26px; }
.ld-facts dd .v { flex: 1; min-width: 0; }
.ld-facts-form .e, .ld-facts-form .ld-edit-bar, .ld-facts-form .ld-edit-only { display: none; }
.ld-facts-form.editing .e { display: block; flex: 1; min-width: 0; max-width: 420px; }
.ld-facts-form.editing dd:has(.e) .v { display: none; }
.ld-facts-form.editing .ld-edit-only { display: block; }
.ld-facts-form.editing .ld-edit-bar { display: flex; gap: 8px; margin-top: 14px; position: sticky; bottom: 0; background: #fff; padding: 10px 0; border-top: 1px solid var(--line); }
.ld-facts-form.editing dd:has(.e) { background: #faf7fd; border-radius: 6px; }
.ld-facts .e input:not([type=checkbox]), .ld-facts .e select, .ld-facts .e textarea { width: 100%; height: 30px; min-height: 0; padding: 3px 8px; font-size: 12.5px; margin: 0; }
.ld-facts .e textarea { height: auto; min-height: 30px; }
.ld-facts .e .field { margin: 0; }
.ld-facts .e .field > label, .ld-facts .e label:not(.check) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ld-facts .e .hint, .ld-facts .e small { display: none; }
.ld-facts-form:not(.editing) dd:has(.e):hover { background: var(--panel-2); border-radius: 6px; cursor: text; }
#privacy { margin-top: 18px; }
.ld-pane-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.ld-pane-head h3 { margin: 0; }
.ld-pane-head .spacer { flex: 1; }
.ld-pane-head select, .ld-pane-head input { width: auto; min-width: 180px; height: 34px; }
.ld-timeline { list-style: none; margin: 0; padding: 0; }
.ld-timeline li { display: grid; grid-template-columns: 90px 34px 1fr; gap: 10px; align-items: start; margin-bottom: 10px; position: relative; }
.ld-timeline li::before { content: ""; position: absolute; left: 116px; top: 30px; bottom: -12px; width: 1px; background: var(--line); }
.ld-timeline li:last-child::before { display: none; }
.ld-when b { display: block; font-size: 11.5px; }
.ld-when small { color: var(--muted); font-size: 10.5px; }
.ld-dot { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--brand); position: relative; z-index: 1; }
.ld-dot svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ld-entry { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12px; }
.ld-entry .body { margin-top: 3px; color: var(--ink-2); white-space: normal; }
.ld-note-form { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: var(--panel-2); }
.ld-note { border-left: 3px solid var(--marigold); background: #fff; border-radius: 0 8px 8px 0; padding: 9px 12px; margin-bottom: 8px; font-size: 12px; box-shadow: var(--shadow); }
.ld-note-meta { margin-bottom: 3px; }
.ld-call-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
@media (max-width: 1100px) {
  .ld { grid-template-columns: 1fr; }
  .ld-facts { grid-template-columns: 1fr; gap: 2px; }
  .ld-facts dd { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------- dashboard extras */
.kpi-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi-strip.mini { margin-bottom: 14px; box-shadow: none; background: var(--panel-2); }
.kpi-strip.mini .kpi { background: transparent; padding: 12px 14px; }
.kpi-strip.mini .kpi b { font-size: 19.5px; }
.panel-sub { margin: -6px 0 14px; color: var(--muted); font-size: 12px; }
.panel-head.pad { padding: 16px 18px 4px; margin: 0; }
.panel-head a { font-size: 12px; font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: #efebf2; overflow: hidden; margin: 0 0 10px; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.funnel-lost { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12px; }
.funnel-lost a, .funnel-lost span:not(.muted) { color: var(--ink-2); }
.funnel-lost b { color: var(--bad); font-variant-numeric: tabular-nums; margin-left: 3px; }
.report-charts { margin-bottom: 0; }
.report-charts .panel { margin-bottom: 16px; }
.dash > .panel { margin-bottom: 0; }
.dash { margin-bottom: 16px; }
.side .me .me-name { color: #fff; font-weight: 600; display: block; }
.side .me .me-role { margin: 2px 0 10px; color: #b9a3ca; }
.side .me .me-role a { color: #dccbe9; }
.appbar-add svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .appbar .spacer { display: none; } .appbar-add span { display: none; } .appbar-add { padding: 8px 10px; } .appbar form { max-width: none; } }

/* ---------------------------------------------------------------- responsive */
.menu-toggle { display: none; }
@media (max-width: 1200px) {
  .ext-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-zones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .side-main { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid:has(> .kpi) > .kpi:nth-child(3) { border-left: 0; }
  .grid:has(> .kpi) > .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rb { grid-template-columns: 1fr; }
  .rb-fields { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: sticky; z-index: 40; height: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 14px; }
  .side .brand { padding: 0; }
  .side .brand.has-logo { padding: 6px 10px; margin: 0; }
  .side .brand.has-logo .brand-logo { max-height: 34px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--chalk-2); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; }
  .side .nav, .side .me { flex-basis: 100%; }
  .side:not(.open) .nav, .side:not(.open) .me { display: none; }
  .nav a.on::before { display: none; }
  .main { padding: 0 14px 32px; }
  .appbar { position: static; }
  .g2, .g3, .g4, .filters, .rb-zones { grid-template-columns: 1fr; }
  .grid:has(> .kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid:has(> .kpi) > .kpi:nth-child(odd) { border-left: 0; }
  .grid:has(> .kpi) > .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .bars .bar { grid-template-columns: 110px 1fr 60px; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list.has-open { display: none; }
  .inbox-back { display: inline; }
  .ext-layout { grid-template-columns: 1fr; }
  .ext-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .ext-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  h1 { font-size: 18.5px; }
}
/* custom fields quick-edit grid */
.cf-grid td > small, .cf-grid td > input[type=checkbox] { display: inline-block; margin-top: 10px; }
.cf-grid tr.muted input[type=text] { color: var(--muted); }
.cf-save-bar { position: sticky; bottom: 0; background: var(--bg, #f6f4f9); padding: 10px 0; z-index: 5; }
/* registrations (primary / secondary / tertiary) */
.ld-regs > summary { cursor: pointer; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; list-style: none; }
.ld-regs > summary::-webkit-details-marker { display: none; }
.ld-regs > summary h3 { margin: 0; }
.ld-regs > summary::before { content: '▸'; color: var(--muted); }
.ld-regs[open] > summary::before { content: '▾'; }
.ld-reg-table { margin-top: 10px; font-size: 12px; }
.ld-reg-table td { vertical-align: top; }
.ld-reg-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #f1edf6; color: var(--ink-2); }
.ld-reg-badge.s1 { background: #efe5f6; color: var(--brand); }
.ld-reg-badge.s2 { background: #fff0e8; color: #b23a00; }
.ld-reg-badge.s3 { background: #e7f3ec; color: #1d7a45; }
.ld-utm { display: inline-block; margin: 0 10px 2px 0; }
.ld-utm b { font-weight: 600; color: var(--muted); }
.ld-reg-sum { font-weight: 500; }
.ld-link { font-size: 12px; margin-left: 6px; }
.utm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 14px; margin-top: 10px; }
.nowrap { white-space: nowrap; }
/* lead page side drawers: Change Stage, Re-assign Lead */
.lm-modal.ld-drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.ld-drawer-panel { width: min(540px, 100vw); height: 100%; background: #fff; display: flex; flex-direction: column; animation: lm-in .18s ease-out; box-shadow: -12px 0 40px rgba(30, 20, 40, .18); }
.ld-drawer-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 2px solid var(--brand); }
.ld-drawer-panel > header h2 { margin: 0; font-size: 17px; }
.ld-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; }
form.ld-drawer-body { padding-bottom: 0; }
.ld-float .field.fl { position: relative; margin-bottom: 16px; }
.ld-float .field.fl > label { position: absolute; top: -8px; left: 10px; padding: 0 4px; background: #fff; font-size: 11px; color: var(--brand); font-weight: 600; z-index: 1; line-height: 1.3; }
.ld-float .field.fl select, .ld-float .field.fl input, .ld-float .field.fl textarea { height: 42px; width: 100%; }
.ld-float .field.fl textarea { height: auto; min-height: 96px; padding-top: 12px; }
.ld-float .field.fl small { display: block; margin-top: 4px; }
.ld-fu[hidden], .ld-float .field[hidden] { display: none; }
.ld-drawer-save { display: flex; justify-content: flex-end; margin: 2px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ld-drawer-save .btn, .ld-drawer-foot .btn { min-width: 96px; justify-content: center; }
.ld-drawer-foot { margin: auto -20px 0; padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.ld-prev-h { font-size: 15px; margin: 0 0 12px; }
.ld-prev { list-style: none; margin: 0; padding: 0; }
.ld-prev li { display: grid; grid-template-columns: 86px 30px minmax(0, 1fr); gap: 10px; align-items: start; position: relative; padding-bottom: 14px; }
.ld-prev li::before { content: ''; position: absolute; left: 110px; top: 30px; bottom: 0; width: 1px; background: var(--line); }
.ld-prev li:last-child::before { display: none; }
.ld-prev-when { display: flex; flex-direction: column; font-size: 12px; }
.ld-prev-when small { color: var(--muted); }
.ld-prev-dot { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; }
.ld-prev-dot svg { width: 15px; height: 15px; stroke: var(--brand); fill: none; stroke-width: 1.8; }
.ld-prev-body { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; overflow-wrap: anywhere; }
.ld-prev-text { color: var(--brand); }
.ld-rule { font-size: 14px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.ld-rule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.ld-seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ld-seg label { flex: 1 1 auto; margin: 0; }
.ld-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ld-seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 1px solid var(--brand); color: var(--brand); border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12.5px; text-align: center; padding: 0 12px; white-space: nowrap; }
.ld-seg span svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.ld-seg input:checked + span { background: var(--brand); color: #fff; }
.ld-seg input:focus-visible + span { outline: 2px solid var(--marigold); outline-offset: 2px; }
.ld-seg-help { font-size: 12px; margin: 0 0 12px; }
.ld-owners { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; font-size: 12px; }
.ld-owner-chip { background: #efe5f6; color: var(--brand); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.ld-owner-chip small { font-weight: 400; color: var(--muted); }
.ld-substage { font-size: 12px; color: var(--ink-2); }
/* ---------- Campaign Dashboard */
.cd-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-icon { width: 40px; height: 40px; border-radius: 10px; background: #efe5f6; display: grid; place-items: center; flex: none; }
.cd-icon svg { width: 22px; height: 22px; stroke: var(--brand); fill: none; stroke-width: 1.8; }
.cd-icon.sm { width: 34px; height: 34px; border-radius: 8px; }
.cd-icon.sm svg { width: 18px; height: 18px; }
.cd-title { display: flex; flex-direction: column; position: relative; }
.cd-title h1 { margin: 0; font-size: 20px; }
.cd-title small { color: var(--muted); font-size: 12px; }
.cd-back { text-decoration: none; color: var(--brand); }
.cd-back svg { width: 20px; height: 20px; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cd-back:hover { background: #e3d4ef; text-decoration: none; }
.cd-sync { display: flex; align-items: center; gap: 6px; background: #e7f6ee; color: #12613a; border: 1px solid #bfe6cf; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 12px; }
.cd-sync button { border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; line-height: 1; padding: 0 4px; }
.cd-tabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.cd-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 7px; color: var(--ink-2); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.cd-tabs a svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cd-tabs a.on { background: #efe5f6; color: var(--brand); font-weight: 600; }
.cd-filter { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.cd-f { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); margin: 0; }
.cd-f select, .cd-f input { height: 34px; min-width: 140px; }
label.check.cd-f { flex-direction: row; align-items: center; height: 34px; color: var(--ink); font-size: 12.5px; }
#cd-custom { display: inline-flex; gap: 10px; }
#cd-custom[hidden] { display: none; }
.cd-pick { position: relative; }
.cd-pick > summary { list-style: none; cursor: pointer; height: 34px; display: flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 12px; font-size: 12.5px; color: var(--brand); background: #faf7fd; }
.cd-pick > summary::-webkit-details-marker { display: none; }
.cd-pick > div { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(42, 10, 64, .16); padding: 10px 14px; min-width: 230px; max-height: 320px; overflow-y: auto; }
.cd-pick > div label { display: flex; margin: 4px 0; white-space: nowrap; }
.cd-badge { background: #fff; color: var(--brand); border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.cd-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.cd-kpis-9 { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.cd-kpi { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--k, var(--brand)); border-radius: 10px; padding: 14px; min-width: 0; }
.cd-kpi small { display: block; color: var(--muted); font-size: 11.5px; }
.cd-kpi b { font-size: 20px; font-weight: 700; color: var(--ink); }
.cd-kpi-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--kt, #efe5f6); flex: none; }
.cd-kpi-ic svg { width: 18px; height: 18px; stroke: var(--k, var(--brand)); fill: none; stroke-width: 1.8; }
.cd-kpi.k1 { --k: #5c0f8b; --kt: #efe5f6; } .cd-kpi.k2 { --k: #ff5100; --kt: #fff0e8; } .cd-kpi.k3 { --k: #1d7a45; --kt: #e7f6ee; }
.cd-kpi.k4 { --k: #b42318; --kt: #fdecea; } .cd-kpi.k5 { --k: #8a3fb5; --kt: #f5ecfb; }
.cd-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.cd-card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cd-card-h h2 { margin: 0; font-size: 14.5px; }
.cd-card-h small { color: var(--muted); font-size: 11.5px; }
.cd-card-h select { height: 34px; }
.cd-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cd-chips span { background: #faf7fd; border: 1px solid #e3d4ef; color: var(--brand); border-radius: 999px; padding: 1px 9px; font-size: 11px; }
.cd-np { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.cd-np button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font-weight: 700; color: var(--muted); }
.cd-np button.on { background: #efe5f6; color: var(--brand); }
.cd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cd-table th, .cd-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.cd-table thead th { font-size: 11px; font-weight: 700; color: var(--ink-2); background: #fbfafd; }
.cd-table .cd-bands th { text-transform: uppercase; letter-spacing: .02em; }
.cd-table th.cd-first, .cd-table td.cd-first { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; border-right: 1px solid var(--line); min-width: 170px; }
.cd-table thead th.cd-first { background: #fbfafd; }
.cd-table tbody th.cd-first { font-weight: 500; }
.cd-table .b-lead { background: #f3edf9; color: var(--brand); }
.cd-table .b-paid { background: #fff5ec; color: #b23a00; }
.cd-table .b-sub { background: #eef2f7; color: #3b4f66; }
.cd-table .b-enr { background: #eaf6ef; color: #1d7a45; }
#cd-channels tbody td:nth-child(2), #cd-channels tbody td:nth-child(5), #cd-channels tbody td:nth-child(8), #cd-channels tbody td:nth-child(11) { border-left: 1px solid var(--line); }
#cd-disp tbody td, #cd-course tbody td, #cd-track tbody td { border-left: 0; }
.cd-table th[data-sort] { cursor: pointer; user-select: none; }
.cd-table th[data-sort]:hover, .cd-table th[data-sort]:focus-visible { color: var(--brand); outline: none; }
.cd-sort { color: #98a2b3; display: inline-flex; vertical-align: -2px; }
.cd-sort svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cd-table th[aria-sort] .cd-sort { color: var(--brand); }
.cd-table th[aria-sort="ascending"] .cd-sort svg path:last-child, .cd-table th[aria-sort="descending"] .cd-sort svg path:first-child { opacity: .25; }
.cd-table a { font-weight: 500; }
.cd-zero { color: var(--muted); }
.cd-conv { color: var(--ink-2); }
.cd-table .cd-p { display: none; }
.cd-table.show-pct .cd-p { display: inline; }
.cd-table.show-pct .cd-n { display: none; }
.cd-table tbody tr:hover > * { background: #faf7fd; }
.cd-main .cd-first { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cd-tog { width: 24px; height: 24px; border: 1px solid var(--line-2); background: #fff; border-radius: 6px; cursor: pointer; color: var(--muted); padding: 0; display: inline-grid; place-items: center; vertical-align: middle; }
.cd-tog svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.cd-tog:hover { border-color: var(--brand); color: var(--brand); }
.cd-main.open .cd-tog { background: #efe5f6; border-color: #d9c3ea; color: var(--brand); }
.cd-main.open .cd-tog svg { transform: rotate(180deg); }
.cd-child > * { background: #fcfbfe; }
.cd-child .cd-first { padding-left: 28px; color: var(--ink-2); }
.cd-table tfoot th, .cd-table tfoot td { font-weight: 700; background: #fbfafd; border-top: 2px solid var(--line); }
.cd-totrow th, .cd-totrow td { font-weight: 700; background: #faf7fd !important; }
.cd-table .cd-tot { background: #faf7fd; font-weight: 600; border-right: 1px solid var(--line); }
.cd-chart { padding: 10px 16px 16px; }
.cd-note { margin-top: -4px; }
@media (max-width: 1100px) { .cd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cd-tabs { width: 100%; } }
.cd-f input[type=checkbox] { min-width: 0; height: auto; }
.cd-crumbs { color: var(--muted); font-size: 12px; }
.cd-crumbs a { color: var(--brand); }
.cd-main .cd-first a { font-weight: 600; }

/* ================================================================ UI system v2: one sidebar rhythm, one page rhythm
   Sidebar: Workspace · Engage · Admissions · Marketing · Reports · Settings (folds). Pages: header → filters → cards.
   Spacing steps: 4 · 8 · 12 · 16 · 24. Radius: 8 (controls) · 12 (cards). */
:root { --radius: 12px; --radius-sm: 8px; --side-w: 244px; --space: 16px; }
.shell { grid-template-columns: var(--side-w) minmax(0, 1fr); background: linear-gradient(to right, var(--chalk) var(--side-w), transparent var(--side-w)); }
.side { display: flex; flex-direction: column; padding: 14px 10px 12px; }
.side .nav { flex: 1; gap: 2px; }
.nav-group { padding: 6px 0 8px; border-top: 1px solid rgba(255, 255, 255, .07); }
.nav-group:first-child { border-top: 0; padding-top: 0; }
.nav .group, .nav-fold > summary.group { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; letter-spacing: .02em; color: #a98dbf; margin: 6px 10px 4px; font-weight: 600; }
.nav-fold > summary { list-style: none; cursor: pointer; border-radius: 6px; padding: 2px 0; }
.nav-fold > summary::-webkit-details-marker { display: none; }
.nav-fold > summary:hover { color: #fff; }
.fold-ic { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 4px 0 0; transition: transform .15s; }
.nav-fold[open] .fold-ic { transform: rotate(-135deg); margin-top: 3px; }
.nav a { padding: 7px 10px; border-radius: 8px; font-size: 12.5px; margin: 0; }
.nav a svg { width: 16px; height: 16px; }
.nav a.on { background: rgba(255, 255, 255, .1); }
.nav a.on::before { left: -10px; }
.brand.has-logo { margin-bottom: 12px; padding: 10px 12px; }
.side .me { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 8px; padding: 12px 6px 0; }
.me-av { width: 32px; height: 32px; border-radius: 50%; background: var(--marigold); color: var(--chalk) !important; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; text-decoration: none !important; }
.me-who { flex: 1; min-width: 0; }
.side .me .me-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.side .me .me-role { margin: 0; font-size: 11px; }
.side .me form { margin: 0; }
.side .me button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #c7b3d6; }
.side .me button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side .me button svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side .me button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* collapsed rail (☰ in the top bar; remembered per browser) */
.side-collapse { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.side-collapse svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
@media (min-width: 901px) {
  html.side-mini { --side-w: 68px; }
  html.side-mini .side { padding: 14px 8px 12px; }
  html.side-mini .brand { justify-content: center; padding: 6px 0 14px; }
  html.side-mini .brand span:not(.brand-mark), html.side-mini .brand.has-logo { display: none; }
  html.side-mini .nav a { justify-content: center; padding: 9px 0; font-size: 0; gap: 0; }
  html.side-mini .nav a svg { width: 18px; height: 18px; }
  html.side-mini .nav a .count { position: absolute; top: 2px; right: 4px; font-size: 9px; min-width: 16px; line-height: 16px; padding: 0 4px; }
  html.side-mini .nav .group, html.side-mini .nav-fold > summary.group { font-size: 0; margin: 4px 0; justify-content: center; }
  html.side-mini .nav-fold > summary.group .fold-ic { margin: 0; }
  html.side-mini .me-who, html.side-mini .side .me form { display: none; }
  html.side-mini .side .me { justify-content: center; padding: 12px 0 0; }
  html.side-mini .nav a.on::before { left: -8px; }
}

/* page rhythm: every page starts with the same header block */
.main { padding: 0 28px 40px; }
.appbar { gap: 10px; padding: 12px 0; margin-bottom: 18px; }
.topbar { align-items: center; margin-bottom: var(--space); padding-bottom: 0; }
.topbar h1, .cd-title h1 { font-size: 20px; }
.topbar > div > small, .topbar > small { font-size: 12px; max-width: 760px; }
.panel { border-radius: var(--radius); padding: 18px 20px; margin-bottom: var(--space); }
.panel.flush { padding: 0; }
.panel.flush > h2:first-child { padding: 16px 20px 0; }
.panel h2 { font-size: 14px; }
.tabs { margin-bottom: var(--space); gap: 4px; }
.tabs a { padding: 9px 12px; font-size: 12.5px; }
.tabs a.on { color: var(--brand); }
th { font-size: 11.5px; color: var(--ink-2); background: #fbfafd; }
th, td { padding: 10px 14px; }
.btn { min-height: 36px; padding: 7px 14px; border-radius: var(--radius-sm); }
.btn.sm { min-height: 30px; }
input:not([type]), input[type=text], input[type=url], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=tel], select, textarea { border-radius: var(--radius-sm); }
.flash { border-radius: var(--radius-sm); }
.grid:has(> .kpi) { border-radius: var(--radius); }
.mod-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; cursor: pointer; font-weight: 400; }
.mod-row:last-of-type { border-bottom: 0; margin-bottom: 14px; }
.mod-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.mod-row b { display: block; font-size: 13px; color: var(--ink); }
.mod-row small { font-size: 12px; }
@media (max-width: 900px) { .side-collapse { display: none; } }

/* ---------- User Access Control */
.ua-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ua-head h1 { font-size: 20px; }
.ua-head .cd-back { width: 36px; height: 36px; }
.ua-tabs { display: flex; gap: 4px; }
.ua-tabs a { padding: 6px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; }
.ua-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); border-radius: 8px 8px 0 0; }
.ua-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ua-status { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 2px; }
.ua-status a { padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: 12.5px; }
.ua-status a.on { background: #efe5f6; color: var(--brand); }
.ua-search { display: flex; gap: 8px; flex-wrap: wrap; }
.ua-search input[type=search] { width: 260px; }
.ua-search select { width: auto; min-width: 150px; }
.ua-table th { white-space: nowrap; }
.ua-table td { vertical-align: middle; }
.ua-cb { width: 36px; }
.ua-name { font-weight: 600; }
.ua-role { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.ua-role::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ua-role.r-admin::before { background: var(--marigold); } .ua-role.r-manager::before { background: var(--brand); } .ua-role.r-counsellor::before { background: #1d7a45; }
.ua-more { display: inline-block; background: #efe5f6; color: var(--brand); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin-left: 4px; cursor: help; }
.ua-bulk { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #faf7fd; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ua-bulk select { width: auto; min-height: 30px; padding: 3px 8px; }
.ua-bulk[hidden] { display: none; }
.ua-default td { background: #fcfbfe; }
.pager .spacer { flex: 1; }
.ua-team > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.ua-team > summary::-webkit-details-marker { display: none; }
.ua-team-mgr { margin-left: auto; font-size: 12px; }
.ua-team form { margin-top: 14px; }
.ua-members, .uf-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; margin-bottom: 14px; }
.pg-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-mods { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; position: sticky; top: 76px; }
.pg-mods button { text-align: left; border: 0; border-left: 3px solid transparent; background: none; padding: 12px 16px; font: inherit; color: var(--ink-2); cursor: pointer; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.pg-mods button:last-child { border-bottom: 0; }
.pg-mods button small { color: var(--muted); }
.pg-mods button.on { background: #faf7fd; color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.pg-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.pg-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pg-sec-h { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
.pg-sec-h h2 { margin: 0; flex: 1; }
.pg-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; font-weight: 400; font-size: 13px; color: var(--ink); cursor: pointer; }
.pg-row small { display: block; color: var(--muted); font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.pg-switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #cfc7d6; position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.pg-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.pg-switch:checked { background: var(--brand); }
.pg-switch:checked::after { transform: translateX(16px); }
.pg-switch:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.pg-save { display: flex; gap: 8px; margin-top: 16px; }
.pg-save .danger { margin-left: auto; }
.dl-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.dl-st.s-pending { background: #fff5ec; color: #b23a00; } .dl-st.s-approved { background: #e7f6ee; color: #1d7a45; }
.dl-st.s-rejected { background: var(--bad-soft); color: var(--bad); } .dl-st.s-expired { background: #efebf2; color: var(--muted); }
.dl-act form { flex-wrap: nowrap; }
.cd-custom-inline { display: inline-flex; gap: 10px; }
.cd-custom-inline[hidden] { display: none; }
@media (max-width: 900px) { .pg-grid { grid-template-columns: 1fr; } .pg-mods { position: static; } .pg-meta { grid-template-columns: 1fr; } }
.spacer { flex: 1; }
.ua-role.r-super_admin::before { background: var(--accent, #FF5100); } .ua-role.r-telecaller::before { background: #2f6fb3; }

/* Roles & Permissions: the hierarchy ladder */
.rh-title { font-size: 16px; margin: 4px 0 2px; }
.rh-sub { margin: 0 0 12px; font-size: 13px; }
.rh-tree { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: 980px; }
.rh-node { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-left: calc(var(--d, 0) * 28px); }
.rh-node + .rh-node { margin-top: 10px; }
.rh-node + .rh-node::before { content: ''; position: absolute; left: -12px; top: -11px; width: 12px; height: 32px; border-left: 2px solid #d9c3ea; border-bottom: 2px solid #d9c3ea; border-bottom-left-radius: 8px; }
.rh-super_admin { --d: 0; border-color: #ffd2bd; background: #fff8f4; }
.rh-admin { --d: 1; } .rh-manager { --d: 2; } .rh-counsellor, .rh-telecaller { --d: 3; }
.rh-telecaller.rh-peer::before { top: -60px; height: 81px; }
.rh-badge { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 'Open Sans', sans-serif; color: #fff; background: var(--brand); }
.rh-super_admin .rh-badge { background: #FF5100; } .rh-admin .rh-badge { background: #7a2fae; } .rh-manager .rh-badge { background: #5C0F8B; }
.rh-counsellor .rh-badge { background: #1d7a45; } .rh-telecaller .rh-badge { background: #2f6fb3; }
.rh-body { display: flex; flex-direction: column; min-width: 0; }
.rh-body b { font-size: 14px; } .rh-body small { color: var(--muted); font-size: 12px; }
.rh-count { font-size: 13px; white-space: nowrap; }
.rh-access { font-size: 12px; color: var(--muted); white-space: nowrap; background: var(--bg, #f6f4f9); border-radius: 999px; padding: 3px 10px; }
.rh-locked { color: var(--muted); cursor: default; display: inline-flex; gap: 5px; align-items: center; }
.rh-locked svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (max-width: 760px) { .rh-node { grid-template-columns: 34px minmax(0, 1fr); margin-left: 0; } .rh-node::before { display: none; } .rh-count, .rh-access { grid-column: 2; } }

/* Sidebar: Leads Manager with its two pages */
.nav-sub > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--chalk-ink); padding: 7px 10px; border-radius: 8px; font-weight: 500; font-size: 12.5px; cursor: pointer; }
.nav-sub > summary::-webkit-details-marker { display: none; }
.nav-sub > summary svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-sub > summary:hover { background: var(--chalk-2); color: #fff; }
.nav-sub.has-on > summary { color: #fff; }
.nav-sub.has-on > summary svg { stroke: var(--marigold); opacity: 1; }
.nav-sub > summary .fold-ic { margin-left: auto; }
.nav-sub[open] > summary .fold-ic { transform: rotate(-135deg); margin-top: 3px; }
.nav-sub-body { position: relative; margin: 1px 0 2px 18px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nav-sub-body a svg { display: none; }
.nav-sub-body a.on::before { left: -9px; }
@media (min-width: 761px) {
  html.side-mini .nav-sub > summary { justify-content: center; padding: 9px 0; font-size: 0; gap: 0; }
  html.side-mini .nav-sub > summary .fold-ic { display: none; }
  html.side-mini .nav-sub-body { margin-left: 0; padding-left: 0; border-left: 0; }
  html.side-mini .nav-sub-body a svg { display: block; }
}

/* Lead Manager: the upload menu */
.lm-up .lm-menu { min-width: 230px; }
.lm-up .lm-menu a { display: flex; align-items: center; gap: 10px; }
.lm-up .lm-menu svg { width: 16px; height: 16px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Bulk Offline Upload */
.up-steps { list-style: none; display: flex; gap: 0; margin: 0 0 16px; padding: 0; max-width: 760px; counter-reset: s; }
.up-steps li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: 13px; position: relative; }
.up-steps li:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--line); margin: 0 12px; border-radius: 2px; }
.up-steps li.done:not(:last-child)::after { background: var(--brand); }
.up-steps li > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: #fff; font-size: 12px; flex: none; }
.up-steps li > span svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.up-steps li.on { color: var(--ink); } .up-steps li.on > span { border-color: var(--brand); color: var(--brand); }
.up-steps li.done { color: var(--brand); } .up-steps li.done > span { background: var(--brand); border-color: var(--brand); }
.up-panel { max-width: 1100px; }
.up-panel h2 { font-size: 17px; }
.up-panel h2 small { font: 400 13px/1.4 'Open Sans', sans-serif; }
.up-type { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; padding: 12px 14px; background: #f7f1fb; border: 1px solid #e6d6f1; border-radius: 10px; }
.up-type label { font-weight: 600; }
.up-type select { width: 260px; }
.up-guide { margin: 0; padding: 14px 18px 14px 38px; background: #f4f8fc; border: 1px solid #dbe7f3; border-radius: 10px; line-height: 1.6; font-size: 13.5px; }
.up-guide > li { margin: 0 0 9px; padding-left: 4px; }
.up-guide > li:last-child { margin-bottom: 0; }
.up-guide ul { margin: 4px 0 0; padding-left: 18px; }
.up-why { margin-top: 6px; }
.up-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.up-foot .btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.up-opts { display: grid; grid-template-columns: 170px minmax(0, 560px); gap: 14px 18px; align-items: start; margin: 8px 0 18px; }
.up-l { font-weight: 600; padding-top: 8px; }
.up-opts small { display: block; margin-top: 4px; }
.up-radios { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.up-radios .check { font-weight: 400; }
.up-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 190px; border: 2px dashed #cdb8dd; border-radius: 12px; background: #faf7fc; cursor: pointer; text-align: center; padding: 20px; margin-bottom: 10px; transition: background .15s, border-color .15s; }
.up-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-drop:hover, .up-drop.over { background: #f3eaf9; border-color: var(--brand); }
.up-drop.has { border-style: solid; border-color: #1d7a45; background: #f0faf4; }
.up-drop-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #efe5f6; }
.up-drop-ic svg { width: 26px; height: 26px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.up-drop u { color: var(--brand); }
.up-sub { margin-top: -4px; }
.up-table th[scope=row] { font-weight: 600; color: var(--ink); background: #fff; position: static; white-space: normal; }
.up-table td, .up-table th { vertical-align: middle; }
.up-sample span { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; margin: 2px 4px 2px 0; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.up-table select { min-width: 240px; }
.up-table select.mapped { border-color: #1d7a45; background-color: #f4fbf6; }
.up-warn { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) { .up-opts { grid-template-columns: 1fr; gap: 6px; } .up-l { padding-top: 6px; } .up-steps li { font-size: 0; } .up-steps li > span { font-size: 12px; } }

/* Offline Upload Logs */
.ul-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cd-kpi.k6 { --k: #475467; --kt: #f0f2f5; }
@media (max-width: 1100px) { .ul-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ul-table td { white-space: nowrap; }
.ul-table td.ul-file { white-space: normal; max-width: 260px; }
.ul-table a.bad { color: var(--bad); }
.ul-table td.num a { font-weight: 700; text-decoration: underline; }
.ul-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eef0f3; color: #475467; border: 1px solid #dde1e6; }
.ul-st.s-completed { background: #e7f6ee; color: #1d7a45; border-color: #bfe5cf; }
.ul-st.s-processing, .ul-st.s-queued { background: #fff4e5; color: #b54708; border-color: #fbd8a8; }
.ul-st.s-failed { background: #fdecea; color: #b42318; border-color: #f6c7c2; }
.ul-st.s-mapping { background: #efe5f6; color: var(--brand); border-color: #dcc7ec; }
.ul-hl td { background: #fff8f2; }
.ul-empty { text-align: center; padding: 28px !important; color: var(--muted); }
.ul-pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.ul-pager select { width: auto; padding: 4px 8px; }
.ul-total { background: #efe5f6; color: var(--brand); border-radius: 6px; padding: 3px 10px; font-weight: 600; font-size: 12px; }
.cd-filter[hidden] { display: none; }
.ul-table th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.ul-table th.num { min-width: 74px; }
.up-cols { margin-top: 12px; font-size: 13px; }
.up-cols summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.up-cols .facts { margin-top: 8px; }
.up-dl { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.up-dl .btn svg, .up-panel a > svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ul-table th, .ul-table td { padding-left: 10px; padding-right: 10px; }

/* ---------------- Report Builder (Meritto style): list + editor */
.rbl-table td { vertical-align: middle; }
.rbl-table th a { color: inherit; text-decoration: none; }
.rbl-sort { display: inline-flex; align-items: center; gap: 4px; }
.rbl-star { width: 40px; padding-right: 0 !important; }
.rbl-star form { display: inline; }
.rbl-fav { border: 0; background: none; padding: 2px; cursor: pointer; color: #c9c2d1; display: grid; place-items: center; }
.rbl-fav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.rbl-fav:hover { color: #f5a524; }
.rbl-fav.on, .rbx-star.on { color: #f5a524; }
.rbl-fav.on svg, .rbx-star.on svg { fill: #f5a524; }
.rbl-tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #efe5f6; color: var(--brand); margin: 1px 2px 1px 0; text-decoration: none; }
.rbl-q input { min-width: 280px; }

.rbx { position: relative; display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 110px); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: visible; }
.rbx.side-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.rbx.side-hidden .rbx-side { visibility: hidden; overflow: hidden; border-right: 0; }
.rbx-side { position: sticky; top: 70px; align-self: start; height: calc(100vh - 90px); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; border-radius: 12px 0 0 12px; }
.rbx-side-scroll { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.rbx-src { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.rbx-src select { flex: 1; }
.rbx-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rbx-sec.open { background: #fff; box-shadow: 0 1px 3px rgba(42, 10, 64, .06); }
.rbx-sec-h { width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 0; background: none; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; }
.rbx-sec-h > span:first-child { flex: 1; min-width: 0; }
.rbx-sec-h b { display: block; font-size: 15px; font-family: 'Merriweather', Georgia, serif; color: var(--ink); }
.rbx-sec-h small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.rbx-sec:not(.open) .rbx-sec-h small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbx-chev { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand); display: grid; place-items: center; flex: none; margin-top: 2px; }
.rbx-chev svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.rbx-sec.open .rbx-chev svg { transform: rotate(180deg); }
.rbx-sec-b { display: none; padding: 0 14px 12px; border-top: 2px solid transparent; }
.rbx-sec.open .rbx-sec-b { display: block; border-image: linear-gradient(90deg, var(--brand) 0 60px, var(--line) 60px) 1; }
.rbx-add-row { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 8px 0 6px; }
.rbx-add { border: 0; background: none; color: var(--brand); font: 600 13px/1 'Open Sans', sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; }
.rbx-add svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.rbx-add:hover { text-decoration: underline; }
.rbx-period { margin-right: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.rbx-period select { width: auto; padding: 4px 8px; }
.rbx-custom { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12px; } .rbx-custom input { padding: 4px 6px; }
.rbx-list { display: flex; flex-direction: column; gap: 6px; }
.rbx-grp { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.rbx-chip { display: flex; align-items: center; gap: 8px; background: #f3eff7; border: 1px solid #e6dcef; border-radius: 8px; padding: 7px 8px 7px 10px; }
.rbx-chip.filter { cursor: pointer; } .rbx-chip.filter:hover { border-color: var(--brand); }
.rbx-chip.over { outline: 2px dashed var(--brand); } .rbx-chip.dragging { opacity: .4; }
.rbx-grip { color: #8a7a99; cursor: grab; font-size: 14px; line-height: 1; }
.rbx-chip-t { flex: 1; min-width: 0; }
.rbx-chip-t b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbx-chip-t small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbx-x { border: 0; background: none; font-size: 18px; line-height: 1; color: #6b5d78; cursor: pointer; padding: 0 4px; border-radius: 4px; }
.rbx-x:hover { color: var(--bad); background: #fff; }
.rbx-empty { margin: 4px 0; font-size: 12px; color: var(--muted); }
.rbx-back { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--brand); font-weight: 600; font-size: 13px; text-decoration: none; border-radius: 0 0 0 12px; }
.rbx-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.rbx-collapse { position: absolute; left: 368px; top: 50%; z-index: 6; width: 24px; height: 44px; border-radius: 0 8px 8px 0; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.rbx.side-hidden .rbx-collapse { left: 0; }
.rbx-collapse svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.rbx-main { min-width: 0; display: flex; flex-direction: column; }
.rbx-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 60px; background: #fff; z-index: 5; border-radius: 0 12px 0 0; }
.rbx-star { border: 0; background: none; color: #c9c2d1; cursor: pointer; padding: 2px; display: grid; place-items: center; }
.rbx-star svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.rbx-star[disabled] { opacity: .4; cursor: default; }
.rbx-name { max-width: 420px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--panel-2); font-size: 15px; padding: 8px 10px; }
.rbx-name:focus { border-bottom-color: var(--brand); outline: none; background: #fff; }
.rbx-ic { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: none; color: #5d5468; display: grid; place-items: center; cursor: pointer; }
.rbx-ic:hover, .rbx-ic.on { background: #efe5f6; color: var(--brand); }
.rbx-ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rbx-pop-wrap, .rbx-save-grp { position: relative; }
.rbx-mini { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(42, 10, 64, .18); padding: 12px; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.rbx-mini[hidden], .rbx-menu[hidden] { display: none; }
.rbx-viz { min-width: 160px; padding: 6px 0; gap: 0; }
.rbx-viz button { border: 0; background: none; text-align: left; padding: 8px 16px; font: inherit; cursor: pointer; }
.rbx-viz button:hover, .rbx-viz button.on { background: var(--panel-2); color: var(--brand); font-weight: 600; }
.rbx-save-grp { display: flex; }
.rbx-save-grp .btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
#rb-save { border-radius: 8px 0 0 8px; }
.rbx-caret { border-radius: 0 8px 8px 0; padding: 0 9px; border-left: 1px solid rgba(255, 255, 255, .35); }
.rbx-menu { right: 0; min-width: 220px; }
.rbx-menu form { margin: 0; }
.rbx-menu-check { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rbx-body { padding: 14px 16px 20px; background: #faf9fc; flex: 1; border-radius: 0 0 12px 0; min-width: 0; }
.rbx-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; }
.rbx-sort { display: flex; align-items: center; gap: 6px; } .rbx-sort select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.rbx-body .rb-chart { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.rbx-table-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: opacity .15s; }
.rbx-table-wrap.loading { opacity: .45; }
.rbx-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.rbx-table th, .rbx-table td { padding: 11px 14px; border-bottom: 1px solid #eeeaf2; white-space: nowrap; text-align: left; }
.rbx-table thead th { position: sticky; top: 0; z-index: 2; background: #ece8f1; color: var(--ink); font-weight: 700; font-size: 12.5px; }
.rbx-table thead tr:nth-child(2) th { top: 39px; background: #f3f0f7; font-weight: 600; }
.rbx-table thead th.grp { text-align: center; border-left: 1px solid #ddd5e6; }
.rbx-table td.num, .rbx-table th.num { text-align: left; }
.rbx-table th.rbx-dim { font-weight: 500; color: var(--ink); background: #fff; }
.rbx-table thead th.rbx-dim { background: #ece8f1; font-weight: 700; }
.rbx-table th.rbx-dim.first { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 #eeeaf2; }
.rbx-table thead th.rbx-dim.first { z-index: 3; }
.rbx-table th.grp-cell { vertical-align: top; background: #fcfbfd; font-weight: 600; }
.rbx-table td a, .rbx-table th a { color: #2f6fb3; text-decoration: none; }
.rbx-table td a:hover { text-decoration: underline; }
.rbx-table tbody tr:hover td, .rbx-table tbody tr:hover th.rbx-dim:not(.grp-cell) { background: #f8f5fb; }
.rbx-zero { color: #9b93a5; }
.rbx-table .rbx-tot { background: #f8f6fa; font-weight: 600; }
.rbx-table tr.rbx-foot th, .rbx-table tr.rbx-foot td { position: sticky; bottom: 0; background: #e6e2ec; font-weight: 700; border-top: 1px solid #d5cfdd; }
.rbx-none { text-align: center !important; padding: 30px !important; color: var(--muted); }
.rbx-error { padding: 24px; color: var(--bad); }
.rbx-meta { margin: 10px 2px 0; font-size: 12px; }

.rbx-pick { position: absolute; z-index: 40; width: 380px; max-height: 560px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px rgba(42, 10, 64, .22); overflow: hidden; }
.rbx-pick[hidden] { display: none; }
.rbx.picking .rbx-main { opacity: .35; pointer-events: none; transition: opacity .15s; }
.rbx-pick-h { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 10px; background: var(--panel-2); }
.rbx-pick-h > div { flex: 1; }
.rbx-pick-h b { display: block; font-size: 15px; font-family: 'Merriweather', Georgia, serif; }
.rbx-pick-h small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.rbx-pick-s { padding: 8px 16px; background: var(--panel-2); }
.rbx-pick-s input[type=search] { width: 100%; }
.rbx-hint { padding: 8px 16px; font-size: 12px; color: #8a6d00; background: #fffaeb; border-top: 1px solid #f6e7b3; border-bottom: 1px solid #f6e7b3; }
.rbx-tabs { display: flex; gap: 0; margin: 10px 16px 4px; border: 1.5px solid var(--brand); border-radius: 999px; padding: 2px; align-self: center; flex-wrap: wrap; justify-content: center; }
.rbx-tabs button { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font: 600 12.5px/1.2 'Open Sans', sans-serif; color: var(--brand); cursor: pointer; }
.rbx-tabs button.on { background: var(--brand); color: #fff; }
.rbx-pick-l { flex: 1; overflow-y: auto; padding: 6px 8px 10px; min-height: 120px; }
.rbx-pick-g { font: 700 13px/1.2 'Merriweather', Georgia, serif; padding: 12px 8px 4px; }
.rbx-opt { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 6px 8px; border-radius: 6px; cursor: pointer; position: relative; }
.rbx-opt:hover { background: var(--panel-2); }
.rbx-opt label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding-right: 26px; }
label.rbx-opt { display: flex; align-items: center; gap: 8px; }
.rbx-opt.used { opacity: .55; }
.rbx-opt input { margin: 0; }
.rbx-pills { display: flex; gap: 6px; margin: 6px 0 2px 24px; }
.rbx-pills button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; color: var(--muted); }
.rbx-pills button.on { background: #efe5f6; border-color: #cdb6e0; color: var(--brand); font-weight: 600; }
.rbx-pills button.on::before { content: '✓ '; }
.rbx-del { position: absolute; right: 6px; top: 5px; border: 0; background: none; color: #9b93a5; font-size: 16px; cursor: pointer; line-height: 1; padding: 0 4px; }
.rbx-cond .rbx-del { position: static; }
.rbx-del:hover { color: var(--bad); }
.rbx-apply { border: 0; background: var(--brand); color: #fff; font: 600 14px/1 'Open Sans', sans-serif; padding: 13px; cursor: pointer; width: 100%; }
.rbx-apply:hover { background: #4a0b70; }
.rbx-pick-foot { display: flex; align-items: center; gap: 8px; padding: 0; border-top: 1px solid var(--line); }
.rbx-pick-foot .btn { margin: 8px 0 8px 10px; }
.rbx-pick-foot .rbx-apply { flex: 1; width: auto; }
.rbx-pick-foot:has(.btn.primary) { justify-content: flex-end; padding: 8px 12px; }
.rbx-pick-foot:has(.btn.primary) .btn { margin: 0; }
.rbx-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; margin: 8px 8px; }
.rbx-cm .rbx-vals { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin: 0 8px; }
.rbx-vals label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.rbx-cm [data-addc] { margin: 4px 8px; }
.rbx-cond { display: flex; align-items: center; gap: 6px; margin: 6px 8px; padding: 7px 10px; background: #f3eff7; border-radius: 8px; font-size: 12.5px; }
.rbx-cond span { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .rbx { grid-template-columns: 1fr; }
  .rbx-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rbx-collapse { display: none; }
  .rbx-pick { left: 8px !important; right: 8px; width: auto; }
  .rbx-bar { flex-wrap: wrap; position: static; }
}
.rbx-sub { flex-wrap: nowrap; }
.rbx-sub #rb-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbx-sub .spacer { display: none; }
