/* CRM styles
   The main colour (--navy) frames the work; the highlight (--yellow) only means "act on this now".
   Both are set in Settings → Branding (see app/brand.php). */

:root {
  --navy: #001935;
  --navy-2: #0a2747;
  --navy-3: #18395c;
  --yellow: #ffcc00;
  --yellow-soft: #fff4c2;
  --glass: #b7dbde;
  --glass-2: #dcedef;
  --glass-3: #eef6f7;
  --paper: #f5f8f9;
  --white: #ffffff;
  --ink: #10202f;
  --ink-2: #44566a;
  --ink-3: #6d7e8e;
  --line: #d9e3e7;
  --line-2: #e8eef1;
  --red: #b42318;
  --red-soft: #fdecea;
  --green: #1e7a46;
  --green-soft: #e3f4ea;
  --orange: #b4532a;

  --s-new: #8a6a00;      --s-new-bg: #fff4c2;
  --s-contacted: #1f5f99; --s-contacted-bg: #e2eefa;
  --s-survey: #5b3fa8;   --s-survey-bg: #eeeafa;
  --s-quoted: #a8481c;   --s-quoted-bg: #fcebe2;
  --s-won: #1e7a46;      --s-won-bg: #e3f4ea;
  --s-lost: #5f6b76;     --s-lost-bg: #eceff1;

  --src-website: #2a78d6;
  --src-facebook: #eb6834;
  --src-canvasser: #1baf7a;
  --src-phone: #7a5cc4;
  --src-other: #c98500;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r: 9px;
  --r-lg: 14px;
  --r-xl: 18px;
  --side: 248px;
  --tab: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variation-settings: "wdth" 100;
}
img { max-width: 100%; }
a { color: var(--s-contacted); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.i { flex: none; display: block; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--yellow); color: var(--on-accent, var(--navy)); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Frame ---------- */

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: var(--navy); color: var(--on-navy, #cfe0ea);
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: block; }
.brand img { width: 150px; height: auto; display: block; }
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .me {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  color: var(--on-navy, #cfe0ea); text-decoration: none; font-weight: 500;
}
.side-nav a:hover { background: var(--navy-2); color: var(--white); }
.side-nav a.on { background: var(--navy-3); color: var(--white); box-shadow: inset 3px 0 0 var(--yellow); }
.pill-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--yellow); color: var(--on-accent, var(--navy));
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center;
}
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--navy-3); display: flex; align-items: center; gap: 4px; }
.me { flex: 1; min-width: 0; padding: 8px; }
.me:hover { background: var(--navy-2); }
.me span:last-child { min-width: 0; color: var(--white); font-size: 14px; line-height: 1.25; }
.me small { display: block; color: var(--on-navy-2, #8fa8ba); font-size: 12px; }
.avatar {
  --c: #2f6f8f;
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--c); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; letter-spacing: .02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.icon-btn {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center;
}
.side .icon-btn:hover { background: var(--navy-2); color: #fff; }

.main-wrap { margin-left: var(--side); min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(245, 248, 249, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2);
}
.top-brand { display: none; }
.search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 0 12px; color: var(--ink-3);
}
.search:focus-within { border-color: var(--navy-3); }
.search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; color: var(--ink); }
.add-lead { margin-left: auto; }
.main { padding: 24px 28px 64px; max-width: 1400px; }

.tabbar { display: none; }

/* ---------- Type & headings ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
h2.h { font-size: 17px; font-weight: 650; font-variation-settings: "wdth" 106; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-size: 14px; }

/* ---------- Buttons & form controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 9px 14px; border-radius: var(--r); cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--on-accent, var(--navy)); }
.btn-yellow:hover { background: var(--accent-hover, #ffd633); border-color: var(--accent-hover, #e6b800); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--glass-3); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-lg { padding: 13px 18px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: var(--s-contacted); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--red); }

.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--white); color: var(--ink);
}
.field textarea, textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--glass-2); }
.hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--navy); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--glass-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; word-break: break-all;
}
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; padding: 8px 10px; }

/* ---------- Surfaces ---------- */

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }

.flashes { padding: 16px 28px 0; display: grid; gap: 8px; max-width: 1400px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r); background: var(--green-soft); color: var(--green); font-weight: 500; }
.flash span { flex: 1; color: var(--ink); }
.flash-error { background: var(--red-soft); color: var(--red); }
.flash-warn { background: var(--yellow-soft); color: #8a6a00; }
.flash-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; }

/* ---------- Badges ---------- */

.stage {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--c); background: var(--bg);
}
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, currentColor); }
.stage-new { --c: var(--s-new); --bg: var(--s-new-bg); }
.stage-contacted { --c: var(--s-contacted); --bg: var(--s-contacted-bg); }
.stage-survey_booked { --c: var(--s-survey); --bg: var(--s-survey-bg); }
.stage-quoted { --c: var(--s-quoted); --bg: var(--s-quoted-bg); }
.stage-won { --c: var(--s-won); --bg: var(--s-won-bg); }
.stage-lost { --c: var(--s-lost); --bg: var(--s-lost-bg); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--glass-3); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tag-warn { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* ---------- Dashboard ---------- */

.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.dash-col { display: grid; gap: 20px; min-width: 0; }

/* The waiting list: the one loud thing in the app. */
.waiting { background: var(--navy); color: var(--white); border-radius: var(--r-lg); padding: 20px 20px 10px; }
.waiting-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.waiting-head h2 { font-size: 22px; font-weight: 700; font-variation-settings: "wdth" 115; }
.waiting-head h2 b { color: var(--accent-on-dark, var(--yellow)); }
.waiting-head a { color: var(--glass); font-size: 14px; }
.waiting-list { list-style: none; margin: 0; padding: 0; }
.wait {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--navy-3);
}
.wait-bar { align-self: stretch; border-radius: 4px; background: var(--yellow); }
.wait.late .wait-bar { background: #ff8a4c; }
.wait-name { font-weight: 650; font-size: 16px; color: var(--white); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-name:hover { text-decoration: underline; }
.wait-meta { color: var(--on-navy-2, #9fb7c8); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-time { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
.wait-time b { display: block; font-size: 20px; font-weight: 700; font-variation-settings: "wdth" 85; color: var(--accent-on-dark, var(--yellow)); }
.wait.late .wait-time b { color: #ff9d66; }
.wait-time small { color: var(--on-navy-2, #9fb7c8); font-size: 12px; }
.waiting .btn-call { background: var(--yellow); color: var(--on-accent, var(--navy)); border: 0; padding: 10px 14px; }
.waiting-empty { padding: 4px 0 14px; color: var(--on-navy, #cfe0ea); }
.waiting-empty b { color: var(--white); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line-2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; font-variation-settings: "wdth" 88; letter-spacing: -.01em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--ink-3); }
.kpi-sub .up { color: var(--green); font-weight: 600; }
.kpi-sub .down { color: var(--red); font-weight: 600; }

.range { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--white); }
.range a { padding: 6px 12px; font-size: 13px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.range a + a { border-left: 1px solid var(--line); }
.range a.on { background: var(--navy); color: var(--white); }

.today-list { list-style: none; margin: 0; padding: 0; }
.today-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.today-item:first-child { border-top: 0; }
.today-time { font-weight: 700; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 90; font-size: 17px; }
.today-time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.today-item a { font-weight: 600; text-decoration: none; color: var(--ink); }
.today-item a:hover { text-decoration: underline; }

.funnel { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.funnel li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.funnel-bar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 5px; background: var(--c); min-width: 4px; }
.funnel li a { color: var(--ink); text-decoration: none; }
.funnel li a:hover { text-decoration: underline; }

.setup { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: var(--r-lg); padding: 14px 18px; }
.setup h2 { font-size: 15px; margin-bottom: 6px; }
.setup ul { margin: 0; padding-left: 18px; }
.setup li { margin: 3px 0; }
.setup a { color: var(--navy); font-weight: 500; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + g rect, .chart g.col:hover rect { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--navy); color: var(--white);
  font-size: 13px; padding: 8px 10px; border-radius: var(--r); min-width: 140px; transform: translate(-50%, -100%); margin-top: -8px;
  box-shadow: 0 6px 18px rgba(0, 25, 53, .25);
}
.tip[hidden] { display: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip div span { display: flex; align-items: center; gap: 6px; color: var(--on-navy, #cfe0ea); }
.tip i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--glass-3); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--glass-3); }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-name a { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-name small { display: block; color: var(--ink-3); font-size: 12.5px; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); flex: none; }
.dot-src { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot-src::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--ink-3)); }

/* ---------- Leads list ---------- */

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.chip b { font-weight: 500; color: var(--ink-3); }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip.on b { color: var(--glass); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.empty h2 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.lead-cards { display: none; }

/* ---------- Pipeline ---------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x mandatory; }
.col { background: var(--glass-3); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 10px; scroll-snap-align: start; min-height: 220px; }
.col.over { background: var(--glass-2); border-color: var(--glass); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 10px; }
.col-head h2 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.col-head h2 .n { color: var(--ink-3); font-weight: 500; }
.col-value { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 8px; min-height: 160px; align-content: start; }
.card {
  display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; text-decoration: none; color: var(--ink); cursor: grab; position: relative;
}
.card:hover { border-color: var(--ink-3); }
.card.dragging { opacity: .45; }
.card.uncalled { border-left: 4px solid var(--yellow); padding-left: 9px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-name { font-weight: 650; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.card-name:hover { text-decoration: underline; }
.card-value { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.card-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.card-move { display: none; }

/* ---------- Contact page ---------- */

.contact-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; margin-bottom: 18px; }
.contact-title { display: flex; align-items: center; gap: 14px; }
.contact-title .avatar { width: 52px; height: 52px; font-size: 18px; }
.contact-title h1 { font-size: 26px; font-weight: 700; font-variation-settings: "wdth" 110; }
.contact-sub { color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.stage-track { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 4px; margin-bottom: 20px; }
.stage-track form { display: contents; }
.stage-step {
  border: 0; padding: 10px 6px 8px; background: var(--white); color: var(--ink-3); font-weight: 600; font-size: 13px;
  border-top: 4px solid var(--line); cursor: pointer; text-align: center; border-radius: 0;
}
.stage-step:hover { color: var(--ink); background: var(--glass-3); }
.stage-step.done { border-top-color: var(--navy-3); color: var(--ink-2); }
.stage-step.current { border-top-color: var(--sc, var(--yellow)); color: var(--ink); background: var(--white); box-shadow: inset 0 -2px 0 var(--sc, var(--yellow)); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--navy); }
.tab-panel[hidden] { display: none; }
.composer textarea { min-height: 96px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.templates { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.templates button { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-3); cursor: pointer; color: var(--ink-2); }
.templates button:hover { border-color: var(--ink-3); color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.ev { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.ev-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--white); border: 2px solid var(--line); display: grid; place-items: center; color: var(--ink-3); position: relative; }
.ev-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.ev-head strong { font-weight: 650; }
.ev-time { color: var(--ink-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.ev-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--ink); }
.ev-bubble { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; }
.ev.out .ev-bubble { background: var(--glass-3); border-color: var(--glass-2); }
.ev.in .ev-bubble { background: var(--yellow-soft); border-color: var(--yellow-soft); }
.ev.in .ev-ic { border-color: var(--yellow); color: var(--on-accent, var(--navy)); background: var(--yellow); }
.ev.t-note .ev-bubble { background: #fffdf4; }
.ev.quiet .ev-body { color: var(--ink-2); font-size: 13.5px; margin-top: 0; }
.ev.quiet .ev-ic { width: 32px; height: 20px; border: 0; background: transparent; }
.ev.quiet .ev-ic::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ev.quiet .ev-ic svg { display: none; }
.ev-status { font-size: 12px; color: var(--ink-3); }
.ev-status.bad { color: var(--red); }

.side-panel h2 { font-size: 15px; margin-bottom: 10px; }
.dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; word-break: break-word; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mini-row b { font-variant-numeric: tabular-nums; }
.mini-actions { display: flex; gap: 10px; margin-top: 4px; font-size: 13px; }
.mini-actions form { display: inline; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 12px; }

dialog.sheet {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  box-shadow: 0 20px 60px rgba(0, 25, 53, .3); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(0, 25, 53, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { font-size: 17px; }
.sheet-body { padding: 18px 20px 8px; }
.sheet-foot { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Calendar ---------- */

.cal-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar h1 { font-size: 24px; font-weight: 700; font-variation-settings: "wdth" 110; margin-right: auto; }
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; }
.week-head { position: sticky; top: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px; text-align: center; font-size: 13px; color: var(--ink-2); z-index: 2; }
.week-head b { display: block; font-size: 20px; color: var(--ink); font-variation-settings: "wdth" 90; }
.week-head.today b { background: var(--yellow); color: var(--on-accent, var(--navy)); border-radius: 50%; width: 34px; height: 34px; line-height: 34px; margin: 0 auto; }
.hours { position: relative; }
.hour { height: 56px; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--ink-3); text-align: right; padding: 2px 6px 0 0; }
.day-col { position: relative; border-left: 1px solid var(--line-2); }
.day-col .slot { height: 56px; border-top: 1px solid var(--line-2); }
.day-col.today { background: #fffdf2; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.appt {
  position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 4px 6px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 14%, white); border-left: 4px solid var(--c);
  font-size: 12px; line-height: 1.3; color: var(--ink); text-decoration: none; z-index: 1;
}
.appt:hover { z-index: 4; box-shadow: 0 4px 12px rgba(0, 25, 53, .18); }
.appt b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.done { opacity: .6; }
.appt.cancelled { opacity: .45; text-decoration: line-through; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.month-dow { padding: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--glass-3); }
.month-day { min-height: 112px; padding: 6px; border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); font-size: 12.5px; }
.month-day:nth-child(7n + 1) { border-left: 0; }
.month-day.other { background: var(--paper); color: var(--ink-3); }
.month-day.today .mday { background: var(--yellow); color: var(--on-accent, var(--navy)); }
.mday { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; }
.m-appt { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda { display: none; }
.cal-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.cal-key span { display: inline-flex; gap: 6px; align-items: center; }
.cal-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* ---------- Settings ---------- */

.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 80px; }
.settings-nav a { padding: 9px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-weight: 600; }
.settings-nav a:hover { background: var(--white); color: var(--ink); }
.settings-nav a.on { background: var(--white); color: var(--ink); box-shadow: inset 3px 0 0 var(--navy); }
.settings-body { max-width: 860px; display: grid; gap: 16px; min-width: 0; }
.settings-body > * { min-width: 0; }
.settings-body .panel h2 { font-size: 17px; margin-bottom: 4px; }
.settings-body .panel > p { margin: 0 0 16px; color: var(--ink-2); }
.step-list { display: grid; gap: 10px; }
.step { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--white); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.step.off { background: var(--paper); }
.step.off textarea, .step.off input:not([type=checkbox]), .step.off select { opacity: .6; }
.step-when { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.step-when input[type=number] { width: 70px; }
.step-when select, .step-when input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 4px; }
.vars { font-size: 13px; color: var(--ink-2); }
.vars code { font-size: 12px; margin: 2px 2px 0 0; display: inline-block; cursor: copy; }
.ol { margin: 0; padding-left: 20px; }
.ol li { margin-bottom: 8px; }


/* ---------- Settings: stages, fields, templates, spend, backup, updates ---------- */

.stage-list { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: auto 40px minmax(0, 1fr) 190px 110px 38px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.stage-row.moved { background: var(--glass-3); }
.stage-move { display: flex; flex-direction: column; }
.stage-move .icon-btn { width: 28px; height: 20px; }
.stage-move .icon-btn:hover { background: var(--glass-3); }
.stage-row .icon-btn { color: var(--ink-3); }
.stage-row .icon-btn:hover { color: var(--red); }
.stage-move .icon-btn:hover { color: var(--ink); }
input.swatch { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); cursor: pointer; }
.stage-kind-fixed { font-size: 13.5px; color: var(--ink-2); padding-left: 4px; }
.stage-count { font-size: 13px; text-align: right; }
.note { background: var(--glass-3); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.note ul { margin: 6px 0 8px; padding-left: 18px; }
.note li { margin: 3px 0; }
.note p { margin: 0; }
.tfoot-row td, .table tfoot td { border-top: 1px solid var(--line); background: var(--glass-3); }
.table-note { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line-2); }
.money-in { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 8px; background: var(--white); }
.money-in:focus-within { border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--glass-2); }
.money-in span { color: var(--ink-3); font-size: 14px; }
.money-in input { border: 0; outline: 0; width: 76px; padding: 7px 0; text-align: right; font-variant-numeric: tabular-nums; background: transparent; }
.spend-grid td { padding: 6px 10px; }
.spend-grid th { white-space: nowrap; }
.version-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; color: var(--green); }
.version-head h2 { color: var(--ink); }
.version-head p { color: var(--ink-2); margin: 4px 0 14px; }
.err div + div { margin-top: 4px; }
.tpl-edit { font-size: 12.5px; align-self: center; margin-left: 4px; }

@media (max-width: 860px) {
  .stage-row { grid-template-columns: auto 40px minmax(0, 1fr) 34px; grid-template-areas: "mv sw lb del" "mv . kd kd" "mv . ct ct"; row-gap: 6px; }
  .stage-row .stage-move { grid-area: mv; }
  .stage-row .swatch { grid-area: sw; }
  .stage-row .stage-label { grid-area: lb; }
  .stage-row .stage-kind { grid-area: kd; }
  .stage-row .stage-count { grid-area: ct; text-align: left; font-size: 12.5px; }
  .stage-row .stage-del { grid-area: del; }
  .stage-row .stage-kind-fixed { padding-left: 2px; }
  .range { display: flex; width: 100%; }
  .range a { flex: 1; text-align: center; white-space: nowrap; padding: 7px 4px; font-size: 12.5px; }
}

/* ---------- Login ---------- */

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); background: var(--white); }
.login-art { background: var(--navy); color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art img { width: 200px; height: auto; position: relative; }
.login-art p { z-index: 1; text-shadow: 0 2px 12px rgba(0,25,53,.6); font-size: 34px; line-height: 1.15; font-weight: 700; font-variation-settings: "wdth" 115; max-width: 14ch; margin: 0; position: relative; }
.login-art .panes { position: absolute; right: -80px; bottom: -60px; width: 420px; height: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; border: 14px solid var(--yellow); transform: rotate(-6deg); opacity: .9; }
.login-art .panes i { background: linear-gradient(135deg, rgba(var(--glass-rgb, 183, 219, 222), .55), rgba(var(--glass-rgb, 183, 219, 222), .18) 55%, rgba(var(--glass-rgb, 183, 219, 222), .4)); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.login-form h1 { font-size: 26px; margin-bottom: 6px; font-variation-settings: "wdth" 110; }
.login-form > p { color: var(--ink-2); margin: 0 0 24px; }
.login-form .btn { width: 100%; }
.err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .side { display: none; }
  .main-wrap { margin-left: 0; padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); }
  .top { padding: 10px 14px; gap: 10px; }
  .top-brand { display: block; }
  .top-brand img { display: block; border-radius: 6px; }
  .add-lead span { display: none; }
  .add-lead { padding: 9px 10px; }
  .main { padding: 16px 14px 40px; }
  .flashes { padding: 12px 14px 0; }
  .page-head h1 { font-size: 24px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--navy); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--on-navy-2, #9fb7c8); text-decoration: none; font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a.on { color: var(--white); box-shadow: inset 0 3px 0 var(--yellow); }
  .tabbar .pill-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }

  .wait { grid-template-columns: 6px minmax(0, 1fr) auto; gap: 10px; }
  .wait .btn-call span { display: none; }
  .wait-time { display: none; }
  .wait-meta .t-mobile { display: inline; color: var(--accent-on-dark, var(--yellow)); font-weight: 600; }
  .waiting-head h2 { font-size: 19px; }

  .table-leads { display: none; }
  .lead-cards { display: grid; gap: 0; }
  .lead-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
  .lead-card:first-child { border-top: 0; }
  .lead-card strong { display: flex; gap: 8px; align-items: center; }
  .lead-card .meta { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }

  .board { grid-auto-columns: 82vw; }
  .card-move { display: block; margin-top: 8px; width: 100%; padding: 6px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }

  .contact-head { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .actions .btn { flex: 1; }
  .stage-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .week { display: none; }
  .month { display: none; }
  .agenda { display: block; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .step { grid-template-columns: 1fr auto; }
  .step-n { display: none; }

  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: 220px; }
  .login-art p { font-size: 26px; }
  .login-art .panes { width: 170px; height: 220px; right: -50px; bottom: -90px; border-width: 9px; opacity: .55; }
  .login-form { padding: 28px; }
}

@media (min-width: 861px) {
  .wait-meta .t-mobile { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .wait-new { animation: arrive .6s ease-out; }
  @keyframes arrive { from { background: var(--navy-3); } to { background: transparent; } }
}

@media print {
  .side, .top, .tabbar, .actions, .composer { display: none !important; }
  .main-wrap { margin: 0; }
}

/* 2.2: odd-hour warning in the appointment dialogs */
.time-warn { margin: -4px 0 12px; padding: 8px 12px; border-radius: var(--r); background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 600; }

/* 2.3: booking pages */
.stack { display: grid; gap: 0; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--glass-1, #fff); }
.input-prefix span { padding: 0 10px; display: flex; align-items: center; color: var(--ink-3); font-size: 13.5px; background: var(--glass-3); border-right: 1px solid var(--line-2); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-prefix input { border: 0 !important; border-radius: 0 !important; flex: 1; min-width: 0; box-shadow: none !important; }
.open-hours { display: grid; gap: 6px; margin-bottom: 8px; }
.hours-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; min-height: 44px; }
.hours-row .input { width: auto; }
.hours-row .off { opacity: .35; pointer-events: none; }
.bq-list { display: grid; gap: 10px; margin: 6px 0 12px; }
.bq { display: flex; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 12px 4px 14px; background: var(--glass-1, #fff); }
.bq-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 2fr 1.2fr 1.4fr; gap: 0 12px; }
.bq-main > .field:nth-child(4), .bq-main > .bq-choices { grid-column: 1 / -1; }
.bq-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.bq-tools { display: flex; flex-direction: column; gap: 2px; }
.icon-btn.danger { color: var(--red); }
.tag-ok { background: #e7f6ec; color: #1e7a46; border-color: #bfe3cb; }
.bp-list { list-style: none; margin: 0; padding: 0; }
.bp { padding: 16px 18px; border-top: 1px solid var(--line); }
.bp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.bp-head b { font-size: 16px; margin-right: 6px; }
.bp-share .field { margin-bottom: 10px; }
.bp-share .copy-row { align-items: flex-start; }
.bp-share .copy-row .input { flex: 1; min-width: 0; }
.input.code, textarea.code { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.color-input, .field input.color-input:not([type=checkbox]) { width: 64px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; cursor: pointer; }
@media (max-width: 720px) {
  .bq-main { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 1fr; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .hours-row .row-gap { flex-wrap: nowrap; }
  .hours-row .input { flex: 1; min-width: 0; }
}
.bq [hidden], .open-hours [hidden] { display: none !important; }

/* 2.4: branding */
.brand img { max-width: 182px; max-height: 84px; width: auto; }
.on-white img { background: #fff; padding: 8px 10px; border-radius: 8px; }
.login-logo { display: block; position: relative; }
.brand-text { display: block; color: #fff; font-weight: 800; font-size: 20px; line-height: 1.15; letter-spacing: -.01em; font-variation-settings: "wdth" 110; text-decoration: none; }
.brand-text small { display: block; color: var(--accent-on-dark, var(--yellow)); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.login-art img { max-width: 220px; max-height: 110px; width: auto; }
.login-art .brand-text { font-size: 28px; position: relative; }
.top-brand img { width: 32px; height: 32px; object-fit: contain; }
.brand-form .logo-box { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.brand-form .logo-box:first-of-type { border-top: 0; }
.logo-prev { height: 96px; border-radius: var(--r-lg); border: 1px dashed var(--line); display: grid; place-items: center; padding: 10px; background: #fff; overflow: hidden; }
.logo-prev.dark { background: var(--navy); border-color: var(--navy); }
.logo-prev img { max-width: 100%; max-height: 76px; }
.logo-prev .muted { font-size: 13px; text-align: center; }
.logo-prev.dark .muted { color: var(--on-navy-2, #9fb7c8); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13.5px; }
.preset:hover { border-color: var(--ink-3); }
.preset i { width: 24px; height: 24px; border-radius: 50%; display: block; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.colour-pair { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.colour-pair .field { margin: 0; }
.colour-pair .row-gap input[type=text] { width: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.brand-preview { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: grid; grid-template-columns: 170px 1fr; min-height: 170px; }
.bp-side { background: var(--pv-p); padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.bp-side .bp-logo { color: #fff; font-weight: 800; margin-bottom: 8px; font-size: 15px; }
.bp-side span { display: block; padding: 7px 10px; border-radius: 6px; color: var(--pv-on); font-size: 13.5px; }
.bp-side span.on { background: var(--pv-p3); color: #fff; box-shadow: inset 3px 0 0 var(--pv-a); }
.bp-main { background: var(--pv-paper); padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bp-main .bp-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bp-btn { display: inline-block; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 13.5px; }
.bp-btn.a { background: var(--pv-a); color: var(--pv-ona); }
.bp-btn.p { background: var(--pv-p); color: #fff; }
.adjust-note { margin: 8px 0 0; }
@media (max-width: 720px) {
  .brand-form .logo-box { grid-template-columns: 1fr; }
  .brand-preview { grid-template-columns: 120px 1fr; }
}

/* =====================================================================
   2.5 design
   One idea: the sidebar is a solid slab of the brand colour and the active
   page is "lit" with the highlight colour. Everything else stays quiet:
   white surfaces, hairlines tinted from the brand, generous spacing.
   ===================================================================== */

:root {
  --tint: color-mix(in srgb, var(--navy) 9%, transparent);
  --shadow-1: 0 1px 2px color-mix(in srgb, var(--navy) 6%, transparent);
  --shadow-2: 0 12px 32px -10px color-mix(in srgb, var(--navy) 28%, transparent), 0 2px 6px color-mix(in srgb, var(--navy) 8%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--navy) 16%, transparent);
}

body { background: var(--paper); }
a { color: color-mix(in srgb, var(--navy) 70%, #2f6fd6); }
:focus-visible { outline: 0; box-shadow: var(--ring), 0 0 0 1px var(--navy); border-radius: var(--r); }

/* ---------- Sidebar ---------- */
.side { width: var(--side); }
.brand-link { display: block; padding: 22px 22px 14px; text-decoration: none; }
.side-nav { flex: 1; padding: 6px 12px 10px; gap: 1px; overflow-y: auto; }
.side-nav a { position: relative; padding: 9px 12px; border-radius: 10px; font-weight: 550; font-size: 14.5px; transition: background .12s; }
.side-nav a .i { opacity: .82; }
.side-nav a:hover { background: color-mix(in srgb, #fff 7%, transparent); }
.side-nav a.on { background: color-mix(in srgb, #fff 11%, transparent); color: #fff; box-shadow: none; }
.side-nav a.on .i { opacity: 1; color: var(--accent-on-dark, var(--yellow)); }
.side-nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.side-sep { height: 1px; margin: 10px 12px; background: color-mix(in srgb, #fff 12%, transparent); }
.side-push { flex: 1; min-height: 12px; }
.side-foot { border-top: 1px solid color-mix(in srgb, #fff 10%, transparent); padding: 12px; }
.me { border-radius: 10px; }

/* ---------- Top bar ---------- */
.top { background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom-color: transparent; padding: 14px 32px; }
.search { max-width: 560px; border-radius: 12px; border-color: var(--line); background: #fff; min-height: 44px; box-shadow: var(--shadow-1); transition: box-shadow .15s, border-color .15s; }
.search:focus-within { border-color: var(--navy-3); box-shadow: var(--ring); }
.main { padding: 18px 32px 72px; }
.flashes { padding: 12px 32px 0; }

/* ---------- Type ---------- */
.page-head { margin-bottom: 22px; align-items: center; }
.page-head h1 { font-size: 30px; font-weight: 750; font-variation-settings: "wdth" 118; letter-spacing: -.02em; }
.page-head-lg { margin: 8px 0 26px; }
.page-head-lg h1 { font-size: 34px; }
.page-head-lg p { font-size: 15.5px; max-width: 62ch; margin-top: 6px; color: var(--ink-2); }
.panel h2, .settings-body .panel h2 { font-size: 17.5px; font-weight: 700; font-variation-settings: "wdth" 108; letter-spacing: -.005em; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; padding: 10px 16px; font-weight: 650; min-height: 40px; box-shadow: var(--shadow-1); transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-ghost { box-shadow: none; }
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 9px; }
.btn-lg { min-height: 48px; padding: 12px 22px; border-radius: 12px; }
.btn-navy:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-yellow { box-shadow: 0 1px 0 color-mix(in srgb, var(--navy) 12%, transparent); }
.icon-btn { border-radius: 9px; }
.icon-btn:hover { background: var(--glass-3); }

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }
.field > span, .label { font-size: 13.5px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, select.input, textarea.input {
  border-radius: 10px; padding: 10px 12px; min-height: 44px; border-color: var(--line); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.field input:not([type=checkbox]):not([type=radio]):hover, .field select:hover, .field textarea:hover, .input:hover { border-color: color-mix(in srgb, var(--navy) 28%, #cfd8de); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-3); box-shadow: var(--ring); }
select.input, .field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d7e8e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; }
.hint { font-size: 13px; line-height: 1.45; margin-top: 6px; }

/* Checkboxes and radios in the brand colour */
.check { align-items: center; gap: 10px; font-size: 14.5px; }
.check input[type=checkbox], .check input[type=radio] {
  appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; flex: none; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--navy) 30%, #c3cdd4); background: #fff; display: inline-grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.check input[type=checkbox] { border-radius: 6px; }
.check input[type=radio] { border-radius: 50%; }
.check input:hover { border-color: var(--navy-3); }
.check input:checked { background: var(--navy); border-color: var(--navy); }
.check input[type=checkbox]:checked::after { content: ""; width: 11px; height: 11px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check input:focus-visible { box-shadow: var(--ring); }

/* On/off switch: <label class="switch"><input type="checkbox"><i></i><span>…</span></label> */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 40px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--navy) 18%, #d5dde2); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }

/* ---------- Surfaces ---------- */
.panel { border-radius: var(--r-lg); padding: 22px 24px; border-color: var(--line); box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 18px; }
.panel-flush { padding: 0; }
.panel-head { padding: 16px 22px; border-bottom-color: var(--line-2); }
.tag { border-radius: 999px; padding: 2px 9px; font-weight: 600; font-size: 12px; border: 0; background: var(--glass-3); }
.tag-ok { background: var(--green-soft); color: var(--green); }
.flash { border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-1); }
.note { border-radius: 12px; }
code, .code { border-radius: 6px; }

/* ---------- Tables ---------- */
.table th { background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 16px; }
.table tbody tr.clickable:hover td, tr[data-href]:hover td { background: color-mix(in srgb, var(--navy) 3%, #fff); }

/* ---------- Dialogs ---------- */
dialog.sheet { border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
dialog.sheet::backdrop { background: color-mix(in srgb, var(--navy) 45%, transparent); backdrop-filter: blur(2px); }
.sheet-head { padding: 18px 22px; }
.sheet-body { padding: 20px 22px 8px; }
.sheet-foot { padding: 14px 22px 20px; }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in .18s ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---------- Dashboard & pages ---------- */
.waiting { border-radius: var(--r-xl); padding: 22px 22px 12px; box-shadow: var(--shadow-2); }
.kpis { border-radius: var(--r-lg); box-shadow: var(--shadow-1); border-color: var(--line); }
.kpi { padding: 18px 20px; }
.range { border-radius: 10px; box-shadow: var(--shadow-1); border-color: var(--line); }
.range a { padding: 7px 13px; }
.chip { border-color: var(--line); padding: 7px 13px; }
.col { border-radius: var(--r-lg); background: color-mix(in srgb, var(--navy) 4%, var(--paper)); border-color: var(--line-2); }
.card { border-radius: 11px; border-color: var(--line); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: color-mix(in srgb, var(--navy) 30%, #cfd8de); box-shadow: var(--shadow-2); }
.stage-step { border-radius: 8px 8px 0 0; }
.week, .month { border-radius: var(--r-lg); box-shadow: var(--shadow-1); border-color: var(--line); }

/* ---------- Settings ---------- */
.settings { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.settings-nav { gap: 2px; top: 86px; }
.settings-nav a { padding: 10px 14px; border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.settings-nav a:hover { background: color-mix(in srgb, var(--navy) 5%, #fff); }
.settings-nav a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1), inset 3px 0 0 var(--yellow); }
.settings-body { max-width: 900px; gap: 18px; }
.settings-solo { display: block; }
.settings-solo .settings-body { max-width: 1040px; }
.settings-body .panel > p { color: var(--ink-2); }
.step { border-radius: 12px; border-color: var(--line); padding: 14px; }

/* ---------- Mobile "More" menu ---------- */
.tabbar button { border: 0; background: none; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--on-navy-2, #9fb7c8); font-size: 11px; font-weight: 600; }
.tabbar button.on { color: #fff; box-shadow: inset 0 3px 0 var(--yellow); }
dialog.more-sheet { width: min(460px, calc(100vw - 16px)); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px; }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: color-mix(in srgb, var(--navy) 5%, #fff); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 650; text-align: center; }
.more-grid a .i { color: var(--navy); }
.more-grid a.on { background: var(--navy); color: #fff; }
.more-grid a.on .i { color: var(--accent-on-dark, var(--yellow)); }
.more-out { padding: 0 16px 18px; }
.more-out .btn { width: 100%; }
@media (max-width: 860px) {
  .more-sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .top { padding: 10px 14px; }
  .main { padding: 14px 14px 40px; }
  .flashes { padding: 12px 14px 0; }
  .page-head h1, .page-head-lg h1 { font-size: 26px; }
  .page-head-lg { margin: 4px 0 18px; }
  .panel { padding: 18px 16px; }
  .settings { gap: 16px; }
  .settings-nav { background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow-1); }
  .settings-nav a.on { box-shadow: inset 0 -3px 0 var(--yellow); }
}

/* ---------- Booking forms: list ---------- */
.settings-booking .settings-body { max-width: 1180px; }
.bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.bf-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-1); }
.bf-card.is-off .bf-preview { filter: grayscale(.85); opacity: .7; }
.bf-preview { display: block; padding: 18px 18px 0; background: color-mix(in srgb, var(--bc) 9%, #fff); text-decoration: none; color: var(--ink); }
.bf-mini { background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 -1px 0 color-mix(in srgb, var(--bc) 14%, transparent), 0 10px 24px -12px color-mix(in srgb, var(--bc) 45%, transparent); padding: 14px 14px 12px; display: grid; grid-template-columns: 1fr 112px 54px; gap: 12px; align-items: start; min-height: 128px; }
.bf-mini-info { min-width: 0; display: grid; gap: 4px; }
.bf-mini-info img { max-height: 22px; max-width: 90px; width: auto; }
.bf-mini-co { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.bf-mini-info strong { font-size: 13px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bf-mini-info span { font-size: 11px; color: var(--ink-3); }
.bf-mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-top: 6px; }
.bf-mini-cal i { aspect-ratio: 1; border-radius: 50%; background: var(--line-2); }
.bf-mini-cal i.f { background: color-mix(in srgb, var(--bc) 18%, #fff); }
.bf-mini-cal i.s { background: var(--bc); }
.bf-mini-times { display: grid; gap: 5px; padding-top: 6px; }
.bf-mini-times i { height: 14px; border-radius: 4px; border: 1.5px solid var(--bc); }
.bf-mini-times i.s { background: var(--bc); }
.bf-body { padding: 18px 20px 20px; display: grid; gap: 14px; flex: 1; }
.bf-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bf-title h2 { font-size: 19px; font-weight: 750; font-variation-settings: "wdth" 110; }
.bf-title h2 a { color: var(--ink); text-decoration: none; }
.bf-title h2 a:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.on { color: var(--green); }
.status.on::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.bf-facts { margin: -4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.bf-stats { display: grid; grid-template-columns: auto auto 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: 12px; }
.bf-stats > div { padding: 10px 14px; display: grid; gap: 1px; border-left: 1px solid var(--line-2); min-width: 0; }
.bf-stats > div:first-child { border-left: 0; }
.bf-stats b { font-size: 20px; font-weight: 750; font-variation-settings: "wdth" 90; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bf-stats span { font-size: 12.5px; color: var(--ink-3); }
.bf-people { align-content: center; }
.bf-people > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-av { display: flex; margin-bottom: 3px; }
.stack-av .avatar { box-shadow: 0 0 0 2px #fff; }
.stack-av .avatar + .avatar { margin-left: -6px; }
.bf-link { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 10px; padding: 4px 4px 4px 12px; font-size: 13.5px; color: var(--ink-2); }
.bf-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-link .btn { min-height: 32px; }
.bf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.bf-actions .btn { flex: 1; }
.bf-new { border: 2px dashed var(--line); border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 32px; min-height: 280px; text-decoration: none; color: var(--ink-2); text-align: center; transition: border-color .12s, background .12s; }
.bf-new:hover { border-color: var(--navy-3); background: #fff; color: var(--ink); }
.bf-new-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; margin-bottom: 6px; }
.bf-new b { font-size: 16px; color: var(--ink); }
.bf-new small { font-size: 13.5px; }
.empty-big { text-align: center; padding: 48px 24px; }
.empty-big h2 { font-size: 22px !important; margin-bottom: 6px; }
.empty-big p { color: var(--ink-2); margin: 0 0 20px; }

/* ---------- Booking forms: editor ---------- */
.crumb { margin: 0 0 4px !important; font-size: 14px !important; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--ink); }
.bf-editor { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.bf-toc { position: sticky; top: 92px; display: grid; gap: 2px; }
.bf-toc a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; border-left: 3px solid transparent; }
.bf-toc a:hover { background: #fff; color: var(--ink); }
.bf-toc a.on { color: var(--ink); background: #fff; border-left-color: var(--yellow); box-shadow: var(--shadow-1); }
.bf-form { display: grid; gap: 18px; min-width: 0; }
.bf-form .panel + .panel { margin-top: 0; }
.fs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; scroll-margin-top: 90px; }
.fs-head h2 { margin-bottom: 6px; }
.fs-head p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.fs-body { min-width: 0; }
.fs-stack { grid-template-columns: 1fr; gap: 16px; }
.fs-stack .fs-head p { max-width: 70ch; }
.switch.big { font-size: 16px; font-weight: 700; }
.switch-list { display: grid; gap: 12px; margin: 4px 0 6px; }

.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.person { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; }
.person input { position: absolute; opacity: 0; }
.person-name { display: grid; line-height: 1.25; font-weight: 650; font-size: 14px; min-width: 0; }
.person-name small { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.person-tick { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.person:has(input:checked) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 4%, #fff); }
.person:has(input:checked) .person-tick { background: var(--navy); border-color: var(--navy); color: #fff; }
.person:has(input:focus-visible) { box-shadow: var(--ring); }

.open-hours { display: grid; gap: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; margin: 0; }
.hours-row { grid-template-columns: 170px 1fr; padding: 8px 14px; min-height: 58px; border-top: 1px solid var(--line-2); background: #fff; }
.hours-row:first-child { border-top: 0; }
.hours-times { display: flex; align-items: center; gap: 10px; }
.hours-times .input { width: 132px; min-height: 40px; }
.hours-closed { display: none; color: var(--ink-3); font-size: 14px; }
.hours-row.closed { background: var(--paper); }
.hours-row.closed .hours-times { display: none; }
.hours-row.closed .hours-closed { display: block; }

.bq-list { gap: 8px; margin: 0 0 12px; }
.bq { display: block; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow .12s, border-color .12s; }
.bq.open { border-color: var(--navy-3); box-shadow: var(--shadow-2); }
.bq-sum { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 4px; }
.bq-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; padding: 8px 10px; border-radius: 9px; display: grid; gap: 3px; }
.bq-title:hover { background: var(--paper); }
.bq-title b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); }
.bq-req { color: var(--navy); font-weight: 650; }
.bq-tools { flex-direction: row; }
.bq-main { display: none; padding: 6px 16px 14px; border-top: 1px solid var(--line-2); grid-template-columns: 2fr 1.2fr 1.5fr; gap: 0 14px; padding-top: 16px; }
.bq.open .bq-main { display: grid; }
.bq-checks { gap: 10px 26px; margin: 2px 0 4px; }
.bq-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 12px; background: transparent; color: var(--ink-2); font-weight: 650; cursor: pointer; }
.bq-add:hover { border-color: var(--navy-3); color: var(--ink); background: #fff; }

.colour-field { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.bf-swatch { margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px; border-radius: 12px; background: var(--paper); }
.bf-swatch .d { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--bc) 12%, #fff); color: var(--bc); }
.bf-swatch .d.sel { background: var(--bc); color: var(--bc-on); }
.bf-swatch .t { padding: 8px 16px; border: 1.5px solid var(--bc); border-radius: 8px; color: var(--bc); font-weight: 700; font-size: 14px; margin-left: 8px; background: #fff; }
.bf-swatch .b { padding: 9px 18px; border-radius: 8px; background: var(--bc); color: var(--bc-on); font-weight: 700; font-size: 14px; }

.savebar { position: sticky; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 14px 12px 20px; background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); }
.savebar-note { margin-right: auto; color: var(--ink-3); font-size: 14px; }
.bf-delete { margin: 18px 0 0 218px; }
.sheet-wide { width: min(680px, calc(100vw - 24px)); }
.steps-ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; }
.code-box { position: relative; }
.code-box textarea { padding-bottom: 52px; background: var(--paper); }
.code-box .btn { position: absolute; right: 10px; bottom: 10px; }

@media (max-width: 1180px) {
  .bf-editor { grid-template-columns: 1fr; }
  .bf-toc { position: sticky; top: 64px; z-index: 5; display: flex; overflow-x: auto; gap: 4px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); padding: 6px 0; margin: -6px 0 0; }
  .bf-toc a { white-space: nowrap; border-left: 0; }
  .bf-toc a.on { box-shadow: var(--shadow-1), inset 0 -3px 0 var(--yellow); }
  .fs { grid-template-columns: 1fr; gap: 14px; scroll-margin-top: 130px; }
  .bf-delete { margin-left: 0; }
}
@media (max-width: 720px) {
  .bf-grid { grid-template-columns: 1fr; }
  .bf-stats { grid-template-columns: 1fr 1fr; }
  .bf-people { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .bq-main { grid-template-columns: 1fr; }
  .bq-tools .icon-btn { width: 32px; }
  .hours-row { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; border-bottom: 0; }
  .hours-times .input { flex: 1; width: auto; }
  .savebar { bottom: calc(var(--tab) + 10px); flex-wrap: wrap; }
  .savebar-note { display: none; }
  .savebar .btn-lg { flex: 1; }
  .bf-mini { grid-template-columns: 1fr 96px; }
  .bf-mini-times { display: none; }
}
.field > .hint, .field > span.hint { font-size: 13px; font-weight: 400; color: var(--ink-3); margin: 6px 0 0; }
.conn { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.conn .status { font-size: 13px; }
@media (max-width: 860px) {
  dialog.more-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
  .settings-team .table th:nth-child(n+3), .settings-team .table td:nth-child(n+3) { display: none; }
}

/* =====================================================================
   2.6: every page in the booking-forms style
   ===================================================================== */

/* Shared pieces */
.panel-pad { padding: 22px 24px; }
.panel-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); margin: 0; }
.panel-head h2.h { font-size: 17px; }
.status { line-height: 1.3; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.copy-field { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; padding: 5px 5px 5px 12px; }
.copy-field code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.fs-head .status { display: inline-flex; }
.savebar + .savebar { display: none; }
.settings-body > form { display: grid; gap: 18px; min-width: 0; }
.settings-body > form > .panel + .panel { margin-top: 0; }

/* Business profile */
.biz { display: grid; gap: 18px; }
.biz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.biz-grid .panel + .panel { margin-top: 0; }
.acct-id { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.acct-id code { background: var(--paper); border: 0; font-size: 12.5px; }
.acct-id .icon-btn { width: 30px; height: 30px; }
.logo-row { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; margin-bottom: 22px; }
.logo-row .logo-prev { height: 110px; }
.logo-row .logo-prev.removing img { opacity: .25; }
.domain-row { display: flex; gap: 8px; }
.domain-row input { flex: 1; min-width: 0; }
.settings-business .settings-body { max-width: 1120px; }

/* Team */
.settings-team .settings-body { max-width: 1120px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; gap: 2px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.pcard:hover { border-color: color-mix(in srgb, var(--navy) 30%, #cfd8de); box-shadow: var(--shadow-2); }
.pcard.is-off { opacity: .6; }
.pcard-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.role-pill { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--glass-3); color: var(--ink-2); }
.role-pill.admin { background: var(--navy); color: #fff; }
.pcard-name { font-size: 16.5px; font-weight: 700; }
.pcard-mail { font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-facts { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 7px; font-size: 13.5px; }
.pcard-facts div { display: flex; justify-content: space-between; gap: 10px; }
.pcard-facts dt { color: var(--ink-3); }
.pcard-facts dd { margin: 0; text-align: right; }
.pcard-new { align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--line); background: transparent; box-shadow: none; min-height: 220px; color: var(--ink-2); gap: 6px; }
.pcard-new b { color: var(--ink); font-size: 15.5px; }
.pcard-new small { font-size: 13px; }
.settings-team .people-grid { margin-bottom: 18px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.choice input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--navy) 30%, #c3cdd4); margin: 1px 0 0; flex: none; display: grid; place-items: center; }
.choice input:checked { border-color: var(--navy); background: var(--navy); }
.choice input:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.choice span { display: grid; gap: 2px; }
.choice small { color: var(--ink-3); font-size: 13px; }
.choice:has(input:checked) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 4%, #fff); }

/* Integrations */
.int-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.int-card { display: grid; gap: 2px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.int-card:hover { box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--navy) 30%, #cfd8de); }
.int-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--accent-on-dark, var(--yellow)); margin-bottom: 10px; }
.int-card b { font-size: 16px; }
.int-card small { color: var(--ink-3); font-size: 13.5px; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-row { display: flex; gap: 8px; flex-wrap: wrap; }
.test-row select { width: auto; }
.test-row input { flex: 1; min-width: 200px; }

/* Follow-ups */
.fu-form { display: grid; gap: 18px; }
.fu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fu-head p { max-width: 70ch; }
.timeline-steps { gap: 0; counter-reset: step; }
.timeline-steps .step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 0; border: 0; background: none; }
.step-rail { position: relative; display: flex; justify-content: center; }
.step-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline-steps .step:first-child .step-rail::before { top: 22px; }
.timeline-steps .step:last-child .step-rail::before { bottom: calc(100% - 22px); }
.timeline-steps .step-n { display: grid; position: relative; margin-top: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 0 0 4px #fff; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin-bottom: 12px; display: grid; gap: 8px; min-width: 0; transition: opacity .12s; }
.step.off .step-card { background: var(--paper); }
.step.off .step-card textarea, .step.off .step-card .step-when { opacity: .55; }
.step.off .step-n { background: var(--ink-3); }
.step-top { display: flex; align-items: center; gap: 12px; }
.step-when { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.step-when .input { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; border-radius: 9px; }
.step-when .step-amt { width: 70px; padding-right: 8px; }
.step-card textarea { min-height: 84px; }
.fillins { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; font-size: 13px; color: var(--ink-3); }
.fillins span { margin-right: 4px; }
.fillins code { cursor: copy; background: var(--paper); border-color: var(--line-2); }
.fillins code:hover { border-color: var(--navy-3); }
.pill-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-check { position: relative; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; }
.pill-check span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; background: #fff; }
.pill-check input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill-check input:focus-visible + span { box-shadow: var(--ring); }
.quiet-row { display: flex; gap: 14px; flex-wrap: wrap; }
.quiet-row .field { margin: 0; width: 170px; }
.appt-msgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.msg-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; display: grid; align-content: start; gap: 8px; }
.msg-card.off { background: var(--paper); }
.msg-card.off textarea { opacity: .55; }
.msg-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.msg-card-head .input { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; }
.msg-card textarea { min-height: 120px; }

/* Today */
.dash-head { align-items: flex-end; }
.kpis { background: none; border: 0; box-shadow: none; gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line) !important; border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.kpi-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); }
.kpi-value { font-size: 32px; margin: 10px 0 4px; }
.setup { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.setup::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--yellow); }
.setup h2 { font-size: 16px; margin-bottom: 2px; }
.setup p { margin: 0 0 10px; color: var(--ink-2); font-size: 13.5px; }
.setup ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.setup li { margin: 0; }
.setup a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.setup a:hover { background: var(--paper); }
.setup a .i { margin-left: auto; color: var(--ink-3); }
.setup-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--yellow); flex: none; }
.today-item { grid-template-columns: 70px 1fr; align-items: center; padding: 10px 0; }
.today-time { border-left: 3px solid var(--c, var(--navy)); padding-left: 10px; font-size: 16px; }
.funnel li { grid-template-columns: 120px 1fr auto; }
.funnel-bar { height: 8px; background: var(--paper); }

/* Leads */
.stage-tabs { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; gap: 4px; flex-wrap: nowrap; overflow-x: auto; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.stage-tabs .chip { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; white-space: nowrap; color: var(--ink-2); }
.stage-tabs .chip:hover { background: var(--paper); color: var(--ink); }
.stage-tabs .chip b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.stage-tabs .chip.on { background: var(--navy); color: #fff; }
.stage-tabs .chip.on b { background: color-mix(in srgb, #fff 18%, transparent); color: #fff; }
.toolbar { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-1); gap: 8px; margin-bottom: 16px; }
.toolbar .input { min-height: 40px; }
.tool-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--paper); color: var(--ink-3); }
.tool-search input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 40px; color: var(--ink); }
.tool-search:focus-within { box-shadow: var(--ring); }
.leads-panel { border-radius: var(--r-xl); }
.lead-av { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--bg); color: var(--c); }
.lead-av .new-dot { position: absolute; top: -1px; right: -1px; box-shadow: 0 0 0 2px #fff; }
.cell-name { gap: 12px; }
.lead-card { grid-template-columns: auto minmax(0, 1fr) auto !important; align-items: center; }
.lead-card .meta { grid-column: 2 / -1 !important; margin-top: -4px; }

/* Pipeline */
.board { gap: 14px; grid-auto-columns: minmax(230px, 1fr); }
.col { background: color-mix(in srgb, var(--navy) 3.5%, var(--paper)); border: 1px solid var(--line-2); border-top: 3px solid var(--sc); padding: 12px 10px 10px; }
.col-head { padding: 0 4px 12px; }
.col-head h2 { font-size: 14.5px; font-weight: 700; gap: 8px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc); }
.col-head h2 .n { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.col-value { font-weight: 650; }
.card { padding: 12px 13px; border-radius: 12px; }
.card.uncalled { border-left: 3px solid var(--yellow); padding-left: 11px; }
.card-name { font-size: 15px; }

/* Calendar */
.cal-bar { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 10px 18px; box-shadow: var(--shadow-1); margin-bottom: 16px; gap: 10px; }
.cal-title { font-size: 22px !important; font-weight: 750; font-variation-settings: "wdth" 115; }
.cal-bar .btn-sm { min-height: 36px; }
.cal-bar .input { min-height: 38px; width: auto; }
.week { border-radius: var(--r-xl); }
.week-head { padding: 10px 8px; font-weight: 600; }
.week-head b { font-size: 22px; font-weight: 750; }
.week-head.today b { background: var(--navy); color: #fff; width: 38px; height: 38px; line-height: 38px; }
.day-col.today { background: color-mix(in srgb, var(--yellow) 6%, #fff); }
.appt { border-radius: 8px; border-left-width: 3px; padding: 5px 7px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.month { border-radius: var(--r-xl); }
.month-day.today .mday { background: var(--navy); color: #fff; }
.m-appt { border-radius: 6px; padding: 3px 7px; }
.cal-key { gap: 8px; }
.cal-key span { background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px 4px 8px; }
.agenda { border-radius: var(--r-xl); }

/* Contact page */
.contact-head { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px 22px; box-shadow: var(--shadow-1); }
.contact-title h1 { font-size: 28px; font-variation-settings: "wdth" 114; }
.stage-track { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; gap: 6px; box-shadow: var(--shadow-1); }
.stage-step { border-top: 0; border-radius: 9px; padding: 10px 6px; background: transparent; }
.stage-step.done { background: color-mix(in srgb, var(--navy) 6%, #fff); color: var(--ink-2); }
.stage-step.current { background: var(--sc, var(--navy)); color: #fff; box-shadow: none; }
.tabs { border-bottom: 1px solid var(--line-2); }
.tabs button[aria-selected=true] { border-bottom-color: var(--yellow); }
.ev-bubble { border-radius: 14px; }

/* Settings sub-pages */
.stage-row, .step, .bq { border-radius: 12px; }
.settings-nav a .i { display: none; }

@media (max-width: 1180px) {
  .biz-grid { grid-template-columns: 1fr; }
  .appt-msgs { grid-template-columns: 1fr; }
  .int-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .int-grid { grid-template-columns: 1fr; }
  .choice-cards { grid-template-columns: 1fr; }
  .logo-row { grid-template-columns: 1fr; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .toolbar { padding: 6px; }
  .toolbar .input { flex: 1; }
  .cal-bar { padding: 10px; }
  .cal-title { width: 100%; font-size: 19px !important; }
  .contact-head { padding: 16px; }
  .timeline-steps .step { grid-template-columns: 1fr; }
  .step-rail { display: none; }
  .step-top { align-items: flex-start; }
  .people-grid { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 84vw; }
}

/* Settings: section tabs across the top, full-width content */
.settings { display: block; }
.settings-nav { position: static; display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin-bottom: 18px; box-shadow: var(--shadow-1); scrollbar-width: none; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav a { white-space: nowrap; padding: 8px 14px; border-radius: 10px; }
.settings-nav a.on { background: var(--navy); color: #fff; box-shadow: none; }
.settings-body { max-width: 1120px; }
.settings > * { min-width: 0; }
@media (max-width: 860px) {
  .settings-nav { margin: 0 -14px 14px; border-radius: 0; border-left: 0; border-right: 0; padding: 6px 10px; }
  .settings-nav a.on { box-shadow: none; }
  .copy-field { flex-wrap: wrap; }
  .copy-field code { white-space: normal; word-break: break-all; }
}
@media (max-width: 860px) { .panel-head { flex-wrap: wrap; } .acct-id { width: 100%; } .acct-id code { overflow-wrap: anywhere; } .panel-pad { padding: 18px 16px; } }
.spend-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; } @media (max-width: 860px) { .spend-kpis { grid-template-columns: 1fr; } }

/* =====================================================================
   2.7: client page, in the Booking forms style
   White cards with a quiet header row, a calm summary strip, and one
   loud action per job (Call, WhatsApp). WhatsApp keeps its own green.
   ===================================================================== */
:root { --wa: #1fa855; --wa-dark: #168a45; --wa-soft: #e9f8ef; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); border-color: var(--wa-dark); color: #fff; }
.btn-wa .i { color: #fff; }

.cp { display: grid; gap: 18px; }
.cp-hero { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-1); overflow: hidden; position: relative; }
.cp-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--sc, var(--navy)); }
.cp-hero-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 26px 26px 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 4%, #fff), #fff 75%); }
.cp-av { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 23px; font-weight: 750; letter-spacing: .02em;
  background: var(--bg); color: var(--c); box-shadow: 0 0 0 4px #fff, 0 0 0 5px color-mix(in srgb, var(--dot, var(--navy)) 35%, transparent); }
.cp-id { min-width: 0; }
.cp-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ink-3); }
.cp-eyebrow > span:not(.stage) { display: inline-flex; align-items: center; gap: 5px; }
.cp-id h1 { font-size: 30px; font-weight: 750; font-variation-settings: "wdth" 116; letter-spacing: -.02em; margin: 6px 0 2px; overflow-wrap: anywhere; }
.cp-sub { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.cp-sub > * { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cp-sub a { color: var(--ink-2); text-decoration: none; }
.cp-sub a:hover { color: var(--ink); text-decoration: underline; }
.cp-sub .i { color: var(--ink-3); }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cp-icon-btn { width: 48px; padding: 0; justify-content: center; }
.cp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--navy) 2.5%, #fff); }
.cp-facts > div { padding: 14px 26px; border-left: 1px solid var(--line-2); min-width: 0; }
.cp-facts > div:first-child { border-left: 0; }
.cp-facts dt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cp-facts dd { margin: 5px 0 0; font-size: 14.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cp-facts dd small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.cp-facts dd b { font-size: 17px; font-weight: 750; }
.cp-rep { display: inline-flex; align-items: center; gap: 8px; }

.cp-stages { margin: 0; }
.cp-stages .stage-step { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; }
.cp-step-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; border: 1.5px solid color-mix(in srgb, var(--navy) 22%, #cdd6dc); }
.cp-stages .stage-step.done .cp-step-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.cp-stages .stage-step.current .cp-step-dot { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 4px var(--sc, var(--navy)); }
.cp-stages .stage-step:not(.current):hover .cp-step-dot { border-color: var(--sc, var(--navy)); }

.cp-grid { grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; }
.cp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); padding: 22px 24px; margin-bottom: 18px; min-width: 0; }
.cp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cp-card-head h2 { font-size: 17.5px; font-weight: 700; font-variation-settings: "wdth" 108; }
.cp-card-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-3); }
.cp-head-ic { display: flex; align-items: center; gap: 10px; }
.cp-head-ic > i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); }
.cp-card-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* Message box */
.cp-tabs { border: 0 !important; background: color-mix(in srgb, var(--navy) 5%, #fff); padding: 4px; border-radius: 12px; gap: 4px; margin: 0 0 18px; scrollbar-width: none; }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs button { border: 0 !important; margin: 0; border-radius: 9px; padding: 8px 14px; flex: 1; justify-content: center; transition: background .12s, color .12s; }
.cp-tabs button:hover { color: var(--ink); }
.cp-tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px color-mix(in srgb, var(--navy) 16%, transparent); }
.cp-tabs button[data-tab=whatsapp][aria-selected=true] .i { color: var(--wa); }
.cp-pick { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 12px; }
.cp-pick-field { flex: 1; min-width: 0; display: grid; gap: 6px; }
.cp-pick-field > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; }
.cp-pick-field > span .i { color: var(--ink-3); }
.cp-pick-field select { width: 100%; font-weight: 550; }
.cp-pick-edit { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; white-space: nowrap; padding: 11px 2px; text-decoration: none; }
.cp-pick-edit:hover { text-decoration: underline; }
.cp-pick-empty { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-3); }
.cp-msg { margin-bottom: 14px; }
.cp-msg textarea { min-height: 150px; font-size: 15px; line-height: 1.55; resize: vertical; }
.cp-send { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cp-to { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.cp-to b { color: var(--ink); font-weight: 650; }
.cp-to .i { color: var(--ink-3); }
.cp-wa-done { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--wa-soft); color: #136c3a; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cp-wa-done[hidden] { display: none; }
.cp-api { margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; }
.cp-api > summary { padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; list-style: none; }
.cp-api > summary::-webkit-details-marker { display: none; }
.cp-api > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s; }
.cp-api[open] > summary::after { transform: rotate(225deg); }
.cp-api > summary small { font-weight: 400; color: var(--ink-3); }
.cp-api[open] > summary { border-bottom: 1px solid var(--line-2); }
.cp-api-body { padding: 14px; }
.cp-warn { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--yellow) 16%, #fff); font-size: 14px; color: var(--ink); }

/* History */
.cp-timeline .ev-ic { width: 34px; height: 34px; }
.cp-timeline::before { left: 16px; }
.ev.t-whatsapp .ev-ic { color: var(--wa); border-color: color-mix(in srgb, var(--wa) 35%, #fff); background: var(--wa-soft); }
.ev.out.t-whatsapp .ev-bubble { background: #f1fbf5; border-color: #d4f0de; }
.ev.t-email .ev-ic { color: #2f6fd6; border-color: #cfe0f8; background: #eef4fd; }
.ev.t-enquiry .ev-ic { color: #fff; background: var(--navy); border-color: var(--navy); }
.ev.t-quote .ev-ic { color: #a8481c; border-color: #f2d3c3; background: #fcf1ea; }
.ev.t-appointment .ev-ic { color: #5b3fa8; border-color: #ddd4f3; background: #f4f1fc; }
.ev-bubble { box-shadow: 0 1px 2px color-mix(in srgb, var(--navy) 5%, transparent); }

/* Side cards */
.cp-dl-group + .cp-dl-group { border-top: 1px solid var(--line-2); margin-top: 14px; padding-top: 14px; }
.cp-dl-group h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.cp-dl { margin: 0; display: grid; gap: 10px; }
.cp-dl > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.cp-dl dt { color: var(--ink-3); font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.cp-dl dt .i { flex: none; position: relative; top: 1px; }
.cp-dl dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.cp-empty { text-align: center; padding: 18px 12px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--ink-3); }
.cp-empty .i { margin: 0 auto; }
.cp-empty p { margin: 8px 0 2px; font-size: 14px; }
.cp-empty .link-btn { font-size: 13.5px; font-weight: 650; }
.cp-items { list-style: none; margin: 0; padding: 0; }
.cp-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.cp-item:first-child { border-top: 0; padding-top: 0; }
.cp-item:last-child { padding-bottom: 0; }
.cp-item-main { flex: 1; min-width: 0; }
.cp-item-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.cp-item-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; padding: 7px 10px; background: var(--paper); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-date { width: 46px; flex: none; border-radius: 12px; background: var(--navy); color: #fff; text-align: center; padding: 6px 0 5px; line-height: 1.05; align-self: flex-start; }
.cp-date b { display: block; font-size: 19px; font-weight: 750; }
.cp-date small { display: block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; opacity: .85; margin-top: 2px; }
.cp-date.is-past { background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--ink-2); }
.cp-amount { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cp-quote-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cp-quote .mini-row + .mini-row { margin-top: 4px; }
.cp-ch { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); }
.cp-ch-whatsapp { background: var(--wa-soft); color: var(--wa); }
.cp-ch-email { background: #eef4fd; color: #2f6fd6; }
.cp-delete { text-align: right; margin: 0 4px; }
.cp-delete .link-btn { display: inline-flex; align-items: center; gap: 6px; }

/* Dialogs */
dialog.sheet { border-radius: 18px; }
.sheet-head { padding: 18px 22px; }
.sheet-body { padding: 20px 22px 8px; }
.sheet-foot { padding: 14px 22px 20px; border-top: 1px solid var(--line-2); margin-top: 8px; }

/* Message templates (Settings) */
.tpl-group + .tpl-group { border-top: 1px solid var(--line-2); }
.tpl-group-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px 6px; }
.tpl-group-head h3 { font-size: 15px; font-weight: 700; }
.tpl-group-head .muted { font-size: 13px; }
.tpl-group-head .link-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 650; }
.tpl-rows { list-style: none; margin: 0; padding: 0 12px 10px; }
.tpl-rows li { display: flex; align-items: center; gap: 8px; border-radius: 12px; }
.tpl-rows li:hover { background: var(--paper); }
.tpl-row { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 10px; color: var(--ink); text-decoration: none; }
.tpl-ch { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); }
.tpl-ch-whatsapp { background: var(--wa-soft); color: var(--wa); }
.tpl-ch-email { background: #eef4fd; color: #2f6fd6; }
.tpl-main { min-width: 0; display: grid; gap: 1px; }
.tpl-main b { font-weight: 650; }
.tpl-main small { font-size: 12px; color: var(--ink-3); }
.tpl-prev { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.tpl-move { display: flex; flex: none; padding-right: 6px; }

/* Booking form cards: never cut off the status or buttons */
.bf-card, .bf-body > * { min-width: 0; }
.bf-title h2 { min-width: 0; }
.bf-actions .btn { flex: 1 1 auto; }

@media (max-width: 1180px) {
  .cp-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .cp-facts > div { padding: 14px 18px; }
}
@media (max-width: 980px) {
  .cp-grid { grid-template-columns: 1fr; }
  .cp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-facts > div:nth-child(3) { border-left: 0; }
  .cp-facts > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 860px) {
  .cp { gap: 14px; }
  .cp-hero-top { grid-template-columns: auto minmax(0, 1fr); padding: 20px 16px 16px; gap: 14px; }
  .cp-av { width: 52px; height: 52px; font-size: 18px; }
  .cp-id h1 { font-size: 24px; }
  .cp-actions { grid-column: 1 / -1; justify-content: stretch; }
  .cp-actions > .btn:not(.cp-icon-btn) { flex: 1; }
  .cp-facts > div { padding: 12px 16px; }
  .cp-card { padding: 18px 16px; margin-bottom: 14px; }
  .cp-tabs button { flex: none; padding: 8px 12px; }
  .cp-pick { flex-direction: column; align-items: stretch; gap: 6px; }
  .cp-pick-edit { padding: 2px 0 4px; }
  .cp-send .btn-wa { width: 100%; }
  .cp-dl > div { grid-template-columns: 104px minmax(0, 1fr); }
  .tpl-group-head { padding: 14px 14px 4px; }
  .tpl-rows { padding: 0 4px 8px; }
}

/* =====================================================================
   2.7.1: System health, two-step login
   ===================================================================== */
:root { --ok: #1e7a46; --ok-soft: #e3f4ea; --warn: #9a6200; --warn-soft: #fff3d6; --bad: #b42318; --bad-soft: #fdecea; }

.hl-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; margin-bottom: 18px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.hl-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--hc, var(--ok)); }
.hl-hero.hl-warn { --hc: #e0a100; } .hl-hero.hl-bad { --hc: var(--bad); }
.hl-hero-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--hc, var(--ok)) 12%, #fff); color: var(--hc, var(--ok)); }
.hl-hero-text h2 { font-size: 24px; font-weight: 750; font-variation-settings: "wdth" 112; }
.hl-hero-text p { margin: 4px 0 10px; color: var(--ink-2); }
.hl-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.hl-pill { font-size: 12.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.hl-pill.ok { background: var(--ok-soft); color: var(--ok); } .hl-pill.warn { background: var(--warn-soft); color: var(--warn); } .hl-pill.bad { background: var(--bad-soft); color: var(--bad); }
.hl-hero-actions { display: grid; gap: 8px; justify-items: stretch; max-width: 280px; }
.hl-hero-actions .hint { margin: 0; text-align: center; }

.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.hl-check { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hl-check p { margin: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.hl-check .hl-fix { font-size: 13.5px; color: var(--ink); background: var(--paper); border-radius: 8px; padding: 7px 10px; }
.hl-check-head { display: flex; align-items: center; gap: 8px; }
.hl-check-head b { font-size: 14.5px; font-weight: 700; }
.hl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ink-3); }
.hl-tag { margin-left: auto; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-3); }
.hl-check.hl-ok .hl-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .hl-check.hl-ok .hl-tag { background: var(--ok-soft); color: var(--ok); }
.hl-check.hl-warn { border-color: #f1d79a; } .hl-check.hl-warn .hl-dot { background: #e0a100; box-shadow: 0 0 0 3px var(--warn-soft); } .hl-check.hl-warn .hl-tag { background: var(--warn-soft); color: var(--warn); }
.hl-check.hl-bad { border-color: #f3b8b2; } .hl-check.hl-bad .hl-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); } .hl-check.hl-bad .hl-tag { background: var(--bad-soft); color: var(--bad); }
.hl-check.hl-info .hl-dot { background: color-mix(in srgb, var(--navy) 40%, #fff); }
.hl-link { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 650; text-decoration: none; }

.hl-empty { text-align: center; color: var(--ink-3); padding: 26px 16px 28px; }
.hl-empty .i { margin: 0 auto; color: var(--ok); }
.hl-empty p { margin: 8px 0 0; }
.hl-errors { list-style: none; margin: 0; padding: 0 22px 12px; }
.hl-errors li { padding: 12px 0; border-top: 1px solid var(--line-2); }
.hl-errors li:first-child { border-top: 0; }
.hl-err-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hl-err-top b { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 200px; }
.hl-when { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.hl-kind { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.hl-kind-error, .hl-kind-fatal-error { background: var(--bad-soft); color: var(--bad); }
.hl-kind-notice { background: var(--paper); color: var(--ink-3); }
.hl-errors details { margin-top: 6px; }
.hl-errors summary { cursor: pointer; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.hl-pre { margin: 8px 0 0; padding: 10px 12px; background: var(--paper); border-radius: 10px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.hl-skipped { padding: 12px 22px 16px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.hl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hl-two > .panel { margin: 0 0 18px; }
.hl-help { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.hl-help code { font-size: 13px; }

/* Two-step login */
.tf-head { display: flex; align-items: center; gap: 12px; }
.tf-head > div { flex: 1; min-width: 0; }
.tf-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--ink-3); }
.tf-ic.on { background: var(--ok-soft); color: var(--ok); }
.tf-panel > p { margin: 14px 0 12px; }
.tf-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.danger-text { color: var(--bad); }
.tf-steps { list-style: none; margin: 0; padding: 0; counter-reset: tf; display: grid; gap: 22px; }
.tf-steps > li { counter-increment: tf; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; }
.tf-steps > li::before { content: counter(tf); width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; grid-row: 1 / span 4; }
.tf-steps h2 { font-size: 16.5px !important; margin: 4px 0 4px; }
.tf-steps p { margin: 0 0 8px; color: var(--ink-2); }
.tf-qr-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.tf-qr { width: 200px; height: 200px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.tf-qr svg { width: 100%; height: 100%; display: block; }
.tf-key { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.tf-key code { font: 600 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; background: var(--paper); padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.tf-key .hint { margin: 0; }
.tf-confirm { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.code-input { font: 650 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; letter-spacing: .18em; text-align: center; max-width: 220px; }
.tf-codes { list-style: none; margin: 14px 0 18px; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; background: var(--paper); border-radius: 14px; }
.tf-codes code { font: 650 17px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
.login-step-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); margin-bottom: 14px; }
.login-form .code-input { max-width: none; }
.login-help { margin-top: 14px; }
.ok-msg { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }

@media (max-width: 980px) {
  .hl-hero { grid-template-columns: auto minmax(0, 1fr); }
  .hl-hero-actions { grid-column: 1 / -1; max-width: none; grid-template-columns: 1fr 1fr; }
  .hl-hero-actions .hint { grid-column: 1 / -1; }
  .hl-two { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hl-hero { padding: 18px 16px; gap: 14px; }
  .hl-hero-ic { width: 46px; height: 46px; }
  .hl-hero-text h2 { font-size: 20px; }
  .hl-hero-actions { grid-template-columns: 1fr; }
  .hl-errors { padding: 0 16px 10px; }
  .hl-skipped { padding: 12px 16px 14px; }
  .tf-steps > li { grid-template-columns: 1fr; }
  .tf-steps > li::before { grid-row: auto; margin-bottom: 6px; }
  .tf-qr { width: 180px; height: 180px; }
  .tf-codes { grid-template-columns: 1fr 1fr; padding: 12px; }
}

/* =====================================================================
   2.8.0: Leads page, bulk actions, flash actions
   ===================================================================== */
.lp { display: grid; gap: 14px; }
.lp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 4px; }
.lp-head h1 { font-size: 32px; font-weight: 750; font-variation-settings: "wdth" 118; letter-spacing: -.02em; }
.lp-head p { margin: 4px 0 0; color: var(--ink-2); }
.lp-head p b { color: var(--ink); }
.lp-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--navy) 8%, #fff); font-size: 12px; font-weight: 700; }

.lp-stages { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; box-shadow: var(--shadow-1); }
.lp-stages::-webkit-scrollbar { display: none; }
.lp-stages a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .12s; }
.lp-stages a:hover { background: var(--paper); color: var(--ink); }
.lp-stages a i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.lp-stages a b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.lp-stages a.on { background: var(--navy); color: #fff; }
.lp-stages a.on i { box-shadow: 0 0 0 2px #fff; }
.lp-stages a.on b { background: color-mix(in srgb, #fff 18%, transparent); color: #fff; }

.lp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-1); }
.lp-filters .input { width: auto; min-height: 42px; }
.lp-filters .btn { min-height: 42px; }
.lp-cf { max-width: 170px; }
.lp-search { flex: 1 1 260px; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--paper); color: var(--ink-3); }
.lp-search input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 42px; color: var(--ink); min-width: 0; }
.lp-search:focus-within { box-shadow: var(--ring); background: #fff; }

.lp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); overflow: hidden; }
.lp-table .table th { background: color-mix(in srgb, var(--navy) 2.5%, #fff); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; padding-top: 12px; padding-bottom: 12px; white-space: nowrap; }
.lp-table .table td { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
.lp-table tbody tr { transition: background .1s; }
.lp-table tbody tr:hover { background: color-mix(in srgb, var(--navy) 3%, #fff); }
.lp-table tbody tr.is-picked, .lp-mcard.is-picked { background: color-mix(in srgb, var(--navy) 7%, #fff); }
.lp-table .cell-name a { font-weight: 650; color: var(--ink); text-decoration: none; }
.lp-table .cell-name a:hover { text-decoration: underline; }
.lp-phone { color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums; }
.lp-phone:hover { color: var(--ink); text-decoration: underline; }
.lp-svc { max-width: 240px; color: var(--ink-2); font-size: 14px; }
.lp-cfv { max-width: 200px; font-size: 14px; overflow-wrap: anywhere; }
.lp-new-msg { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--wa-soft); color: #137a3d; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.lp-ck { width: 44px; padding-right: 0 !important; }
.lp-box { display: inline-grid; place-items: center; cursor: pointer; position: relative; width: 22px; height: 22px; }
.lp-box input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lp-box i { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid color-mix(in srgb, var(--navy) 30%, #c3cdd4); background: #fff; display: grid; place-items: center; transition: background .1s, border-color .1s; }
.lp-box input:checked + i { background: var(--navy); border-color: var(--navy); }
.lp-box input:checked + i::after { content: ""; width: 10px; height: 10px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.lp-box input:indeterminate + i { background: var(--navy); border-color: var(--navy); }
.lp-box input:indeterminate + i::after { content: ""; width: 9px; height: 2px; background: #fff; border-radius: 2px; }
.lp-box input:focus-visible + i { box-shadow: var(--ring); }
.lp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.lp-foot b { color: var(--ink); }
.lp-pg { font-size: 13.5px; color: var(--ink-3); }
.lp-empty { text-align: center; padding: 56px 20px 60px; }
.lp-empty-ic { width: 64px; height: 64px; border-radius: 18px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); margin-bottom: 14px; }
.lp-empty h2 { font-size: 20px; font-weight: 750; }
.lp-empty p { color: var(--ink-2); max-width: 46ch; margin: 6px auto 18px; }
.lp-mcard { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line-2); padding-left: 10px; }
.lp-mcard:first-child { border-top: 0; }
.lp-mcard .lead-card { flex: 1; border-top: 0 !important; min-width: 0; }

.lp-bulk { position: fixed; z-index: 40; left: calc(var(--side) + (100vw - var(--side)) / 2); bottom: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - var(--side) - 32px); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--navy); color: #fff; box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--navy) 55%, transparent), 0 2px 8px rgba(0,0,0,.12); animation: lp-up .16s ease-out; }
.lp-bulk[hidden] { display: none; }
@keyframes lp-up { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.lp-bulk-count { font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lp-bulk-count b { font-size: 16px; }
.lp-bulk-all { border: 0; background: color-mix(in srgb, #fff 14%, transparent); color: #fff; border-radius: 8px; padding: 4px 10px; font-weight: 650; font-size: 13px; cursor: pointer; }
.lp-bulk-all[hidden] { display: none; }
.lp-bulk-all:hover { background: color-mix(in srgb, #fff 22%, transparent); }
.lp-bulk-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-bulk-grp { display: inline-flex; align-items: center; gap: 0; background: #fff; border-radius: 10px; padding: 2px; }
.lp-bulk-grp select { border: 0; background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 6px 8px; max-width: 160px; outline: 0; cursor: pointer; }
.lp-bulk-grp .btn { min-height: 32px; box-shadow: none; }
.lp-bulk-del { background: #fff; color: var(--bad); border-color: #fff; }
.lp-bulk-del:hover { background: var(--bad-soft); }
.lp-bulk-x { color: #fff; }
.lp-bulk-x:hover { background: color-mix(in srgb, #fff 14%, transparent) !important; }
body.has-bulk .main { padding-bottom: 120px; }
.flash-act { margin-left: auto; }
.flash-act .btn { min-height: 30px; padding: 4px 12px; }
.flash-act + .flash-x { margin-left: 4px; }

@media (max-width: 860px) {
  .lp-head h1 { font-size: 26px; }
  .lp-head-actions { width: 100%; }
  .lp-head-actions .btn { flex: 1; }
  .lp-filters .input, .lp-cf { flex: 1 1 calc(50% - 8px); max-width: none; }
  .lp-filters .btn { flex: 1; }
  .lp-table { display: none; }
  .lp-cards { display: grid !important; }
  .lp-bulk { left: 8px; right: 8px; transform: none; width: auto; max-width: none; bottom: calc(var(--tab) + 10px + env(safe-area-inset-bottom)); padding: 10px 12px; gap: 8px; animation: none; }
  .lp-bulk-acts { width: 100%; }
  .lp-bulk-grp { flex: 1; min-width: 0; }
  .lp-bulk-grp select { flex: 1; min-width: 0; }
  body.has-bulk .main { padding-bottom: 200px; }
}

/* Custom fields (Settings) */
.cf-page { display: grid; gap: 16px; }
.cf-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.cf-intro h2 { font-size: 22px !important; font-weight: 750; }
.cf-intro p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
.cf-folders { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.cf-folders::-webkit-scrollbar { display: none; }
.cf-folder { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; font-weight: 650; white-space: nowrap; transition: border-color .12s, box-shadow .12s; }
.cf-folder:hover { border-color: color-mix(in srgb, var(--navy) 30%, var(--line)); }
.cf-folder b { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--paper); font-size: 12.5px; color: var(--ink-2); }
.cf-folder-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); }
.cf-folder.on { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 12%, transparent); background: color-mix(in srgb, var(--navy) 4%, #fff); }
.cf-folder.on b { background: var(--navy); color: #fff; }
.cf-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); overflow: hidden; }
.cf-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.cf-panel-title { display: flex; align-items: center; gap: 8px; }
.cf-panel-title h3 { font-size: 16.5px; font-weight: 700; }
.cf-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.cf-tools .input { width: auto; min-height: 40px; }
.cf-search { flex: 0 1 240px; min-width: 180px; }
.cf-search input { min-height: 40px; }
.cf-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; background: color-mix(in srgb, var(--navy) 2.5%, #fff); white-space: nowrap; }
.cf-table td { vertical-align: middle; }
.cf-table tr[hidden] { display: none; }
.cf-ord { width: 34px; padding-right: 0 !important; }
.cf-ord form { display: block; line-height: 0; }
.cf-move { border: 0; background: none; color: var(--ink-3); padding: 1px 4px; cursor: pointer; border-radius: 4px; }
.cf-move:hover:not(:disabled) { background: var(--paper); color: var(--ink); }
.cf-move:disabled { opacity: .25; cursor: default; }
.cf-name { display: inline-flex; align-items: center; gap: 10px; }
.cf-name b { font-weight: 650; }
.cf-type-ic { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.cf-lock { color: var(--ink-3); display: inline-flex; }
.cf-choices { display: block; margin: 4px 0 0 38px; color: var(--ink-3); font-size: 12.5px; max-width: 360px; }
.cf-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.cf-key { border: 0; background: color-mix(in srgb, var(--navy) 5%, #fff); color: var(--ink); font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 4px 8px; border-radius: 7px; cursor: copy; white-space: nowrap; }
.cf-key:hover { background: color-mix(in srgb, var(--navy) 10%, #fff); }
.cf-del:hover { color: var(--bad); }
.cf-none { text-align: center; color: var(--ink-3); padding: 24px; margin: 0; }
.cf-none[hidden] { display: none; }
.cf-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cf-help > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.cf-help b { font-size: 14.5px; }
.cf-help p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.cf-help code { font-size: 12.5px; }
.cf-dialog { width: min(560px, calc(100vw - 24px)); }
.cf-keyin { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; min-height: 44px; }
.cf-keyin:focus-within { border-color: var(--navy-3); box-shadow: var(--ring); }
.cf-keyin code { color: var(--ink-3); font-size: 13.5px; background: none; padding: 0; }
.cf-keyin input { flex: 1; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important; min-height: 40px !important; padding: 0 2px !important; font: 600 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
[data-cf-choices][hidden] { display: none; }
.cf-multi { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-pill { position: relative; }
.cf-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cf-pill span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; background: #fff; cursor: pointer; }
.cf-pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.cf-pill input:focus-visible + span { box-shadow: var(--ring); }
.cf-money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding-left: 12px; }
.cf-money b { color: var(--ink-3); font-weight: 600; }
.cf-money input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.cf-money:focus-within { border-color: var(--navy-3); box-shadow: var(--ring); }
.field.span-2 { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .cf-help { grid-template-columns: 1fr; }
  .cf-intro .row-gap { width: 100%; }
  .cf-intro .row-gap .btn { flex: 1; }
  .cf-panel-head { padding: 12px; }
  .cf-tools { width: 100%; }
  .cf-tools .input, .cf-search { flex: 1 1 100%; }
}

/* ===================== 2.8.0 Conversations ===================== */
.page-conversations .main { max-width: none; padding-bottom: 16px; }
.cv {
  --cv-h: calc(100dvh - 72px - 34px);
  display: grid; grid-template-columns: 340px minmax(0, 1fr) 290px; height: var(--cv-h); min-height: 520px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-1);
}
.cv:not(.has-thread) { grid-template-columns: 340px minmax(0, 1fr); }
.cv-list { border-right: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.cv-list-head { padding: 18px 16px 10px; border-bottom: 1px solid var(--line-2); display: grid; gap: 12px; }
.cv-title { display: flex; align-items: baseline; gap: 10px; }
.cv-title h1 { font-size: 21px; margin: 0; }
.cv-unread-n { font-size: 12.5px; font-weight: 700; color: var(--navy); background: var(--yellow-soft); padding: 2px 8px; border-radius: 99px; }
.cv-search { width: 100%; }
.cv-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; }
.cv-chips::-webkit-scrollbar { display: none; }
.cv-chips a { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.cv-chips a:hover { border-color: var(--navy-3); color: var(--ink); }
.cv-chips a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cv-chips a b { font-size: 11px; background: var(--yellow); color: var(--navy); border-radius: 99px; padding: 0 6px; margin-left: 3px; }
.cv-items { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.cv-item { display: flex; gap: 11px; align-items: center; padding: 10px 10px; border-radius: 12px; text-decoration: none; color: inherit; position: relative; }
.cv-item:hover { background: var(--glass-3); }
.cv-item.on { background: color-mix(in srgb, var(--navy) 8%, #fff); box-shadow: inset 3px 0 0 var(--navy); }
.cv-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--bg, var(--glass-2)); color: var(--c, var(--navy)); }
.cv-av.lg { width: 44px; height: 44px; font-size: 15px; }
.cv-av.xl { width: 64px; height: 64px; font-size: 21px; }
.cv-item-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.cv-item-top { display: flex; align-items: baseline; gap: 8px; }
.cv-item-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cv-item-top time { font-size: 12px; color: var(--ink-3); flex: none; }
.cv-item-snip { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); min-width: 0; }
.cv-item-snip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cv-item.unread .cv-item-top b { font-weight: 800; }
.cv-item.unread .cv-item-snip { color: var(--ink); font-weight: 600; }
.cv-item.unread .cv-item-top time { color: var(--navy); font-weight: 700; }
.cv-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #2a78d6; }
.cv-ch { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-style: normal; background: var(--glass-3); color: var(--ink-2); }
.cv-ch svg { width: 12px; height: 12px; }
.cv-ch-whatsapp { background: #e4f6ea; color: #128c4b; }
.cv-ch-email { background: #e7effb; color: #1f5f99; }
.cv-ch-sms { background: #f0ebfa; color: #5b3fa8; }
.cv-empty-list { padding: 40px 22px; text-align: center; color: var(--ink-2); display: grid; justify-items: center; gap: 6px; }
.cv-empty-list p { margin: 0 0 6px; font-size: 14px; }
.cv-more { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 4px 0 10px; }
.cv-setup { display: flex; align-items: center; gap: 10px; margin: 8px; padding: 12px; border-radius: 12px; background: var(--yellow-soft); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.cv-setup span { flex: 1; display: grid; }
.cv-setup small { color: var(--ink-2); }

.cv-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: color-mix(in srgb, var(--paper) 70%, #fff); }
.cv-pick { margin: auto; text-align: center; max-width: 340px; padding: 30px; color: var(--ink-2); }
.cv-pick-ic { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: var(--glass-3); color: var(--navy); margin-bottom: 14px; }
.cv-pick h2 { font-size: 19px; margin: 0 0 6px; color: var(--ink); }
.cv-pick p { margin: 0; }
.cv-thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line-2); }
.cv-back { display: none; }
.cv-who { min-width: 0; flex: 1; }
.cv-who h2 { font-size: 17px; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-who h2 a { color: inherit; text-decoration: none; }
.cv-who h2 a:hover { text-decoration: underline; }
.cv-who p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-3); }
.cv-who p span:not(.badge) { white-space: nowrap; }
.cv-head-acts { display: flex; align-items: center; gap: 8px; }
.cv-head-acts form { display: inline; }
.cv-show-sm { display: none; }

.cv-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 10px; display: flex; flex-direction: column; gap: 10px; }
.cv-none { text-align: center; color: var(--ink-3); margin: auto; }
.cv-day { text-align: center; margin: 10px 0 2px; position: sticky; top: -10px; z-index: 1; }
.cv-day span { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ink-2); background: #fff; border: 1px solid var(--line-2); padding: 3px 11px; border-radius: 99px; box-shadow: var(--shadow-1); }
.cv-event { text-align: center; }
.cv-event span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); background: color-mix(in srgb, var(--line-2) 55%, transparent); padding: 4px 11px; border-radius: 99px; max-width: 90%; }
.cv-event svg { flex: none; }
.cv-note { align-self: center; width: min(560px, 92%); display: flex; gap: 10px; background: var(--yellow-soft); border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.cv-note-ic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #fff; color: #8a6a00; }
.cv-note b { font-size: 13px; }
.cv-note-t { font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.cv-note p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.cv-msg { display: flex; flex-direction: column; max-width: min(620px, 78%); }
.cv-msg.in { align-self: flex-start; align-items: flex-start; }
.cv-msg.out { align-self: flex-end; align-items: flex-end; }
.cv-bubble { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14.5px; }
.cv-msg.in .cv-bubble { background: #fff; border: 1px solid var(--line-2); border-bottom-left-radius: 6px; box-shadow: var(--shadow-1); }
.cv-msg.out .cv-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 6px; }
.cv-msg.out.t-whatsapp .cv-bubble { background: #d9fdd3; color: var(--ink); }
.cv-msg.out .cv-bubble a { color: inherit; }
.cv-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; padding: 0 4px; }
.cv-meta .cv-ch { width: 16px; height: 16px; border-radius: 5px; }
.cv-meta .cv-ch svg { width: 10px; height: 10px; }
.cv-st { margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--glass-3); color: var(--ink-2); }
.cv-st.bad { background: var(--red-soft); color: var(--red); }
.cv-mail { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; width: min(620px, 100%); box-shadow: var(--shadow-1); }
.cv-msg.out .cv-mail { border-color: color-mix(in srgb, var(--navy) 22%, var(--line)); }
.cv-mail header { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line-2); background: var(--glass-3); }
.cv-msg.out .cv-mail header { background: color-mix(in srgb, var(--navy) 6%, #fff); }
.cv-mail header > div { min-width: 0; display: grid; }
.cv-mail header b { font-size: 14px; overflow-wrap: anywhere; }
.cv-mail header small { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.cv-mail-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #e7effb; color: #1f5f99; }
.cv-mail-body { padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.cv-mail-body.folded { max-height: 300px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.cv-more-btn { margin: 0 14px 10px; font-size: 13px; }
.cv-mail footer { padding: 0 14px 12px; }
.cv-newbar { position: sticky; bottom: 4px; text-align: center; margin-top: auto; }
.cv-newbar[hidden] { display: none; }

.cv-compose { background: #fff; border-top: 1px solid var(--line-2); padding: 8px 16px 14px; }
.cv-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.cv-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-3); padding: 7px 11px; border-radius: 9px; cursor: pointer; }
.cv-tabs button:hover { color: var(--ink); background: var(--glass-3); }
.cv-tabs button[aria-selected=true] { color: var(--navy); background: color-mix(in srgb, var(--navy) 8%, #fff); }
.cv-panel { border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.cv-panel:focus-within { border-color: var(--navy-3); box-shadow: var(--ring); }
.cv-panel[hidden] { display: none; }
.cv-panel textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; font: inherit; font-size: 14.5px; padding: 12px 14px 6px; min-height: 64px; max-height: 260px; background: transparent; color: var(--ink); }
.cv-subj { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); padding: 0 14px; }
.cv-subj span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cv-subj input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 14px; padding: 10px 0; background: transparent; min-width: 0; }
.cv-compose-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 10px; flex-wrap: wrap; }
.cv-tpl { width: auto; max-width: 220px; font-size: 13px; padding: 6px 28px 6px 10px; min-height: 34px; }
.cv-to { font-size: 12.5px; color: var(--ink-3); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cv-miss { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px; font-size: 14px; color: var(--ink-2); }
.cv-wa-done { margin: 0 10px 10px; }
.cv-hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin: 0; padding: 0 12px 10px; }

.cv-side { border-left: 1px solid var(--line-2); padding: 22px 18px; overflow-y: auto; background: #fff; }
.cv-side-card { text-align: center; display: grid; justify-items: center; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.cv-side-card h3 { margin: 6px 0 0; font-size: 17px; }
.cv-side-card p { margin: 0; font-size: 13.5px; }
.cv-dl { margin: 0 0 16px; display: grid; gap: 12px; }
.cv-dl div { display: grid; gap: 2px; }
.cv-dl dt { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cv-dl dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.cv-side-btn { width: 100%; justify-content: center; }
.rp-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.rp-status p { flex: 1; min-width: 220px; }

@media (max-width: 1240px) {
  .cv, .cv:not(.has-thread) { grid-template-columns: 320px minmax(0, 1fr); }
  .cv-side { display: none; }
}
@media (max-width: 860px) {
  .page-conversations .main { padding: 0; }
  .page-conversations .flashes { padding: 10px 12px 0; }
  .cv, .cv:not(.has-thread) { --cv-h: calc(100dvh - 64px - var(--tab) - env(safe-area-inset-bottom)); grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; min-height: 0; }
  .cv.has-thread .cv-list { display: none; }
  .cv:not(.has-thread) .cv-thread { display: none; }
  .cv-list { border-right: 0; }
  .cv-list-head { padding: 14px 14px 10px; }
  .cv-back { display: inline-grid; margin-left: -8px; }
  .cv-thread-head { padding: 8px 12px; gap: 8px; }
  .cv-av.lg { width: 38px; height: 38px; font-size: 14px; }
  .cv-hide-sm { display: none !important; }
  .cv-show-sm { display: inline-grid; }
  .cv-msgs { padding: 12px 12px 8px; }
  .cv-msg { max-width: 88%; }
  .cv-compose { padding: 6px 10px 10px; }
  .cv-tpl { max-width: 150px; }
  .cv-to { display: none; }
  .cv-compose-foot .btn-wa { margin-left: auto; }
}
.ev-subj { display: block; margin-bottom: 6px; white-space: normal; }
.cv-who p { flex-wrap: nowrap; overflow: hidden; }
.cv-who p span:not(.badge) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cv-compose-foot { flex-wrap: nowrap; }
.cv-compose-foot .cv-tpl { height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; flex: 0 1 200px; min-width: 0; }
.cv-compose-foot .btn { flex: none; }
.cv-panel textarea { min-height: 56px; }
.cv-who p .badge { flex: none; }
@media (min-width: 1241px) { .cv.has-thread .cv-who-x { display: none; } }
.rp-ok { display: flex; gap: 6px; align-items: flex-start; } .rp-ok svg { flex: none; margin-top: 2px; color: var(--green); }

/* ===================== 2.8.1 Sign-in page ===================== */
.login-art { justify-content: flex-end; }
.login-art.has-photo { background: var(--navy); }
.login-art .login-photo { position: absolute; inset: 0; width: 100% !important; height: 100%; max-width: none !important; max-height: none !important; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); }
.login-art.has-photo::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, calc(var(--dim, .45) + .18)), rgba(0, 0, 0, var(--dim, .45)) 55%, rgba(0, 0, 0, calc(var(--dim, .45) * .7))); }
.login-art.has-photo p { text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.login-brand { margin-bottom: 28px; min-height: 40px; display: flex; align-items: center; }
.login-form-logo { display: block; max-width: 220px; max-height: 64px; width: auto; height: auto; }
.login-form-name { display: block; color: var(--navy); font-weight: 800; font-size: 22px; line-height: 1.1; letter-spacing: -.01em; font-variation-settings: "wdth" 110; }
.login-form-name small { display: block; color: var(--ink-3); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.login-form .login-step-ic { margin-top: 0; }
@media (max-width: 860px) {
  .login-art { min-height: 200px; }
  .login-art.has-photo { min-height: 230px; }
  .login-brand { margin-bottom: 20px; }
  .login-form-logo { max-height: 52px; }
}

/* Branding → Sign-in page */
.si-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.si-controls { display: grid; gap: 16px; }
.si-drop { position: relative; display: grid; place-items: center; text-align: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--glass-3); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.si-drop:hover, .si-drop.over { border-color: var(--navy-3); background: color-mix(in srgb, var(--navy) 5%, #fff); }
.si-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.si-drop b { color: var(--ink); }
.si-drop small { font-size: 12.5px; color: var(--ink-3); }
.si-file { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.si-file[hidden] { display: none; }
.si-focus { position: relative; border-radius: 12px; overflow: hidden; background: #0d1720; cursor: crosshair; user-select: none; touch-action: none; line-height: 0; }
.si-focus img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; pointer-events: none; }
.si-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; background: color-mix(in srgb, var(--yellow) 85%, transparent); box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.4); pointer-events: none; }
.si-focus-hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.si-range { display: grid; grid-template-columns: 110px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 14px; }
.si-range input[type=range] { width: 100%; accent-color: var(--navy); }
.si-range output { font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; font-size: 13px; }
.si-ranges { display: grid; gap: 8px; }
.si-off { opacity: .45; pointer-events: none; }
.si-previews { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 14px; align-items: end; position: sticky; top: 90px; }
.si-label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: block; }
.si-pv { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); background: #fff; display: grid; font-size: 10px; }
.si-pv.desk { aspect-ratio: 16 / 10; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.si-pv.phone { aspect-ratio: 9 / 18; grid-template-rows: 38% 1fr; border-radius: 18px; border-width: 4px; border-color: #1b2733; }
.si-art { position: relative; overflow: hidden; background: var(--navy); display: flex; align-items: flex-end; padding: 8%; }
.si-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.si-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(0,0,0,calc(var(--dim, .45) + .18)), rgba(0,0,0,var(--dim, .45)) 55%, rgba(0,0,0,calc(var(--dim, .45) * .7))); }
.si-art:not(.has-photo)::before { display: none; }
.si-art .si-panes { position: absolute; right: -14%; bottom: -12%; width: 46%; height: 62%; border: 5px solid var(--yellow); transform: rotate(-6deg); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; opacity: .9; }
.si-art .si-panes i { background: rgba(183, 219, 222, .35); }
.si-art.has-photo .si-panes { display: none; }
.si-slogan { position: relative; z-index: 2; color: #fff; font-weight: 700; font-size: 1.9em; line-height: 1.1; max-width: 14ch; margin: 0; text-shadow: 0 2px 10px rgba(0,0,0,.5); font-variation-settings: "wdth" 115; overflow-wrap: anywhere; }
.si-pv.phone .si-slogan { font-size: 1.15em; }
.si-form { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10%; }
.si-form .si-logo { max-width: 70%; max-height: 22px; object-fit: contain; object-position: left; margin-bottom: 6px; }
.si-form .si-name { font-weight: 800; color: var(--navy); font-size: 1.15em; margin-bottom: 6px; }
.si-form b { font-size: 1.3em; color: var(--ink); }
.si-form i { display: block; height: 14px; border: 1px solid var(--line); border-radius: 4px; }
.si-form u { display: block; height: 15px; background: var(--navy); border-radius: 4px; margin-top: 3px; }
.si-pv.phone .si-form { justify-content: flex-start; padding: 12% 10%; }
@media (max-width: 1100px) { .si-grid { grid-template-columns: 1fr; } .si-previews { position: static; } }
@media (max-width: 520px) { .si-previews { grid-template-columns: minmax(0, 1fr) 96px; } .si-range { grid-template-columns: 92px minmax(0, 1fr) 40px; } }
.login-art .login-photo { z-index: 0; }
.login-art.has-photo::before { z-index: 1; }
.login-art.has-photo p { z-index: 2; }
.si-dim-text { opacity: .55; }

/* 2.8.2 Automatic sign-out warning */
.idle-warn { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0, 12, 26, .55); backdrop-filter: blur(3px); }
.idle-warn[hidden] { display: none; }
.idle-card { background: #fff; border-radius: 18px; padding: 26px 24px 22px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow-2); }
.idle-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--yellow-soft); color: #8a6a00; margin-bottom: 10px; }
.idle-card h2 { margin: 0 0 6px; font-size: 20px; }
.idle-card p { margin: 0 0 18px; color: var(--ink-2); }
.idle-card b { font-variant-numeric: tabular-nums; color: var(--ink); }
.idle-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.idle-acts form { display: contents; }
.idle-msg { display: flex; gap: 8px; align-items: flex-start; }
.idle-msg svg { flex: none; margin-top: 2px; }

/* 2.8.2 Starter packs */
.pk { padding: 22px 24px; margin-top: 18px; }
.pk-head h2 { margin: 0 0 4px; }
.pk-head p { margin: 0 0 16px; color: var(--ink-2); max-width: 70ch; }
.pk-list { display: grid; gap: 12px; }
.pk-card { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pk-card.on { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: color-mix(in srgb, var(--green) 4%, #fff); }
.pk-ic { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); }
.pk-main { flex: 1; min-width: 0; }
.pk-main h3 { margin: 0 0 3px; font-size: 16.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-main p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.pk-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pk-chips li { font-size: 12.5px; color: var(--ink-2); background: var(--glass-3); border-radius: 99px; padding: 2px 9px; }
.pk-card > .btn { flex: none; }
.pk-more { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13.5px; margin: 2px 0 0; }
.pk-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--yellow-soft); font-size: 14px; }
.pk-undo span { display: flex; gap: 8px; align-items: center; }
.pk-dialog { max-width: 620px; }
.pk-parts { display: grid; gap: 8px; }
.pk-part { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; }
.pk-part:has(input:checked) { border-color: color-mix(in srgb, var(--navy) 30%, var(--line)); background: color-mix(in srgb, var(--navy) 3%, #fff); }
.pk-part input { margin-top: 3px; accent-color: var(--navy); width: 17px; height: 17px; flex: none; }
.pk-part span { display: grid; gap: 1px; min-width: 0; }
.pk-part small { color: var(--ink-3); font-size: 13px; }
.pk-part em { font-style: normal; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 720px) { .pk { padding: 18px 16px; } .pk-card { flex-wrap: wrap; } .pk-card > .btn { width: 100%; justify-content: center; } }

/* ---------- Agency area (3.1.0) ---------- */
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, #fff 48%, transparent); padding: 10px 12px 4px; }
.switcher { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; padding: 9px 10px; border-radius: 11px; border: 1px solid color-mix(in srgb, #fff 16%, transparent); background: color-mix(in srgb, #fff 6%, transparent); color: #fff; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
button.switcher:hover { background: color-mix(in srgb, #fff 11%, transparent); }
.switcher-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--yellow); color: var(--navy); flex: none; }
.switcher-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.switcher-t small { font-size: 11px; color: color-mix(in srgb, #fff 60%, transparent); font-weight: 600; }
.switcher-t b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher-in { cursor: default; }
.switch-sheet { width: min(520px, calc(100vw - 24px)); }
.switch-find { display: flex; align-items: center; gap: 8px; margin: 14px 20px 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3); }
.switch-find input, .ag-search input { border: 0 !important; box-shadow: none !important; outline: 0; flex: 1; min-width: 0; padding: 11px 0 !important; font: inherit; background: transparent !important; color: var(--ink); }
.switch-find:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 14%, transparent); }
.switch-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px 10px 10px; }
.switch-row .btn { flex: none; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px; text-decoration: none; color: var(--ink); margin: 0; }
.switch-row:hover { background: color-mix(in srgb, var(--navy) 5%, #fff); }
.switch-row[hidden] { display: none; }
.switch-av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--navy) 9%, #fff); color: var(--navy); font-weight: 700; font-size: 13px; }
.is-agency .switch-av { background: var(--navy); color: var(--yellow); }
.switch-n { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.switch-n b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-n small, .ag-name small, .ag-sub { color: var(--ink-3); font-size: 12.5px; display: block; }
.switch-empty { color: var(--ink-2); padding: 10px; margin: 0; }
.switch-foot { padding: 12px 20px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; }
.more-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; border: 0; background: color-mix(in srgb, var(--navy) 5%, #fff); color: var(--ink); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.more-grid button .i { color: var(--navy); }

.support-bar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--yellow); color: var(--navy); font-size: 14px; position: sticky; top: 0; z-index: 30; }
.support-bar span { flex: 1; min-width: 0; }
.support-bar .btn { background: var(--navy); color: #fff; border-color: var(--navy); }

.ag-kpis { margin-bottom: 20px; }
.ag-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.ag-grid > .panel + .panel { margin-top: 0; }
.ag-side { display: flex; flex-direction: column; gap: 18px; }
.ag-side .panel + .panel { margin-top: 0; }
.ag-name { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.ag-name b { font-weight: 650; }
.ag-table td { vertical-align: middle; }
.ag-tag { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--glass-3); color: var(--ink-2); white-space: nowrap; }
.ag-tag.warn { background: var(--yellow-soft, #fff4c2); color: #7a5a00; }
.ag-tag.bad { background: var(--red-soft); color: var(--red); }
.ag-bars { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ag-bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.ag-bars li i { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--line-2); position: relative; overflow: hidden; }
.ag-bars li i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--navy); border-radius: 4px; }
.ag-list { list-style: none; margin: 10px 0 0; padding: 0; }
.ag-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.ag-list li:first-child { border-top: 0; }
.ag-empty { text-align: center; padding: 44px 24px; }
.ag-empty-ic { width: 60px; height: 60px; border-radius: 16px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); margin-bottom: 12px; }
.ag-empty p { max-width: 58ch; margin: 8px auto 20px; color: var(--ink-2); }
.ag-search { display: flex; align-items: center; gap: 8px; max-width: 420px; margin-bottom: 16px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3); }
.ag-search input { border: 0; outline: 0; flex: 1; padding: 11px 0; font: inherit; background: transparent; color: var(--ink); }
.ag-form .panel + .panel { margin-top: 18px; }
.ag-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 20px 0 8px; }
.ag-err { margin-bottom: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: var(--ink); }
.field > span.slug-input, .slug-input { display: flex; margin: 0; font-size: inherit; font-weight: 400; color: var(--ink); align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.slug-input:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 14%, transparent); }
.slug-pre { padding: 0 4px 0 12px; display: flex; align-items: center; color: var(--ink-3); background: var(--glass-3); font-size: 14px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.field .slug-input input { border: 0 !important; box-shadow: none !important; outline: 0; flex: 1; min-width: 0; width: auto; border-radius: 0 !important; padding-left: 2px; }
.hint.bad { color: var(--red); }
.hint.good { color: var(--green); }
.ag-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ag-pack { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; position: relative; }
.ag-pack:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 12%, transparent); }
.ag-pack input { position: absolute; opacity: 0; pointer-events: none; }
.ag-pack:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.ag-pack-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); flex: none; }
.ag-pack b { display: block; font-weight: 650; }
.ag-pack small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.ag-head p a { color: inherit; }
.ag-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; margin: 12px 0 18px; font-size: 14.5px; }
.ag-dl dt { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.ag-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ag-invite { margin-bottom: 18px; border-left: 4px solid var(--green); }
.ag-invite.warn { border-left-color: var(--yellow); }
.ag-invite p { color: var(--ink-2); margin: 6px 0 12px; }
.ag-copy { display: flex; gap: 8px; }
.ag-copy input { flex: 1; min-width: 0; font-size: 13.5px; }
.powered { position: fixed; right: 0; bottom: 0; width: min(480px, 100%); margin: 0; padding: 12px; text-align: center; font-size: 12px; color: var(--ink-3); }

@media (max-width: 980px) {
  .ag-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hide-sm { display: none; }
  .ag-table .switch-av { display: none; }
  .ag-table td, .ag-table th { padding-left: 12px; padding-right: 12px; }
  .support-bar { padding: 10px 14px; font-size: 13px; flex-wrap: wrap; }
  .powered { position: static; width: auto; }
  .ag-dl { grid-template-columns: 1fr; gap: 2px; }
  .ag-dl dd { margin-bottom: 10px; }
  .ag-actions .btn { flex: 1; }
  .ag-copy { flex-direction: column; }
}

/* ---------- Templates (3.2.0) ---------- */
.ag-h2 { font-size: 18px; font-weight: 700; margin: 26px 0 12px; font-variation-settings: "wdth" 108; }
.ag-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ag-tpl-grid > .panel + .panel { margin-top: 0; }
.ag-tpl { display: flex; flex-direction: column; gap: 14px; }
.ag-tpl-top { display: flex; gap: 14px; align-items: flex-start; }
.ag-tpl-top h3 { font-size: 16px; font-weight: 700; margin: 0 0 3px; }
.ag-tpl-top p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.ag-tpl .ag-pack-ic { width: 42px; height: 42px; border-radius: 12px; }
.ag-tpl .hint { margin: -4px 0 0; }
.ag-tpl-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
.ag-tpl-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ag-tpl-acts form { margin: 0; }
.ag-empty-sm { padding: 30px 24px; }
.ag-empty-sm h3 { font-size: 17px; margin: 0; }
.ag-packs-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ag-packs-sm .ag-pack { padding: 10px 12px; align-items: center; }
.ag-packs-sm .ag-pack-ic { width: 32px; height: 32px; }
.ag-tplcard { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.ag-tplcard-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1 1 320px; }
.ag-tplcard-main .ag-pack-ic { width: 44px; height: 44px; border-radius: 12px; }
.ag-tplcard h2 { margin: 0 0 3px; }
.ag-tplcard p { margin: 0; }
.ag-tplcard .hint { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.ag-tplcard-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-tplcard-acts form { margin: 0; }
@media (max-width: 860px) {
  .ag-tpl-grid { grid-template-columns: 1fr; }
  .ag-tplcard-acts { width: 100%; }
  .ag-tplcard-acts .btn, .ag-tplcard-acts form { flex: 1; }
  .ag-tplcard-acts form .btn { width: 100%; }
}

/* ---------- Control: health lights, pause, delete, import (3.3.0) ---------- */
.hdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; box-shadow: 0 0 0 2px #fff; }
.hdot-ok { background: #1e9e55; }
.hdot-warn { background: #e0a100; }
.hdot-bad { background: #d33b2c; }
.hdot-paused { background: #8a96a3; }
.hdot-none { background: #c9d1d8; }
.switch-av { position: relative; }
.switch-av .hdot { position: absolute; right: -3px; bottom: -3px; }
.ag-hlabel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ag-hlabel::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #c9d1d8; }
.ag-hlabel-ok { color: #17803f; } .ag-hlabel-ok::before { background: #1e9e55; }
.ag-hlabel-warn { color: #8a6200; } .ag-hlabel-warn::before { background: #e0a100; }
.ag-hlabel-bad { color: var(--red); } .ag-hlabel-bad::before { background: #d33b2c; }
.ag-hlabel-paused { color: var(--ink-3); } .ag-hlabel-paused::before { background: #8a96a3; }
.ag-health { margin-bottom: 18px; border-left: 4px solid #c9d1d8; }
.ag-health-ok { border-left-color: #1e9e55; }
.ag-health-warn { border-left-color: #e0a100; }
.ag-health-bad { border-left-color: #d33b2c; }
.ag-health-paused { border-left-color: #8a96a3; }
.ag-health-head { display: flex; align-items: center; gap: 12px; }
.ag-health-head > div { flex: 1; min-width: 0; }
.ag-health-head h2 { margin: 0; }
.ag-health-head p { margin: 2px 0 0; font-size: 13px; }
.ag-health-head .hdot { width: 14px; height: 14px; }
.ag-health-head form { margin: 0; }
.ag-hlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ag-hlist li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.45; }
.ag-hlist .hdot { position: relative; top: 1px; box-shadow: none; }
.ag-hok { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.ag-attn a { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.ag-attn a > span { display: flex; flex-direction: column; min-width: 0; }
.ag-attn small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ag-attn .hdot { box-shadow: none; }
.ag-controls .ag-ctl { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.ag-controls h2 + .ag-ctl { border-top: 0; padding-top: 8px; }
.ag-ctl p { margin: 3px 0 0; font-size: 13.5px; max-width: 70ch; }
.ag-ctl form { margin: 0; flex: none; }
.ag-ctl .btn { flex: none; }
.ag-danger { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); margin-top: 18px; }
.ag-danger h2 { color: var(--red); }
.ag-danger-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 12px; }
.ag-danger-form .field { margin: 0; }
.ag-danger .btn-danger { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.ag-digest { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.ag-digest .i { color: var(--ink-3); flex: none; }
.ag-head-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.ag-note { margin-top: 18px; background: color-mix(in srgb, var(--navy) 3%, #fff); }
.ag-note ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.paused-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg, #f3f6f8); padding: 24px 16px 60px; }
.paused-card { width: min(520px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; box-shadow: var(--shadow-1); text-align: center; }
.paused-logo { max-height: 48px; max-width: 220px; margin-bottom: 18px; }
.paused-name { font-weight: 750; font-size: 20px; margin: 0 0 18px; }
.paused-ic { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); margin-bottom: 12px; }
.paused-card h1 { font-size: 24px; margin: 0 0 10px; }
.paused-card p { color: var(--ink-2); line-height: 1.55; }
.paused-contact { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 860px) {
  .ag-controls .ag-ctl { flex-direction: column; align-items: stretch; }
  .ag-ctl form .btn, .ag-ctl > .btn { width: 100%; }
  .ag-danger-form { grid-template-columns: 1fr; }
  .ag-digest { flex-wrap: wrap; }
  .paused-card { padding: 28px 20px; }
}

/* ---------- Billing (3.4.0) ---------- */
.bchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--glass-3); color: var(--ink-2); }
.bchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.bchip-paid { background: #e5f5ec; color: #17803f; }
.bchip-due_soon { background: #fff4d1; color: #8a6200; }
.bchip-overdue, .bchip-locked { background: var(--red-soft); color: var(--red); }
.bchip-free, .bchip-none { background: var(--glass-3); color: var(--ink-3); }
.kpi-money { font-size: 26px; overflow-wrap: anywhere; }
.kpi-bad { color: var(--red); }
.bl-table td { vertical-align: middle; }
.bl-acts { white-space: nowrap; }
.bl-acts .btn { margin-left: 4px; }
.bl-grid { margin-top: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
.bl-card { margin-bottom: 18px; }
.bl-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.bl-card-head h2 { margin: 0 0 4px; }
.bl-price { font-size: 20px; font-weight: 700; margin: 0 0 4px; font-variation-settings: "wdth" 100; }
.bl-card-head p { margin: 0; }
.bl-card-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.bl-pays { margin-top: 14px; }
.bl-pays li form { margin: 0; }
.bl-side-head { display: flex; justify-content: space-between; align-items: center; }
.bl-side-head h2 { margin: 0; }
.bl-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 12px 0 0; font-size: 14px; }
.bl-dl dt { color: var(--ink-3); }
.bl-dl dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.bl-dl dd.bad { color: var(--red); }
.mini-num { width: 56px !important; display: inline-block; padding: 2px 6px !important; min-height: 0 !important; height: 28px; margin: 0 2px; text-align: center; border: 1px solid var(--line); border-radius: 7px; }
.bill-bar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: #fff1ef; color: #8f2117; border-bottom: 1px solid #f3c9c3; font-size: 14px; }
.bill-bar .i { flex: none; }
.paused-how { text-align: left; background: color-mix(in srgb, var(--navy) 4%, #fff); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px; }
.paused-how p { margin: 4px 0 0; color: var(--ink); }
@media (max-width: 980px) { .bl-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .bill-bar { padding: 10px 14px; font-size: 13px; }
  .bl-card-head { flex-direction: column; }
  .bl-card-acts .btn { flex: 1; }
  .kpi-money { font-size: 21px; }
}
