/* ═══════════════════════════════════════════════════════════════════════════
 * BRK Wellness CRM — colours follow the BRK Wellness website (dist/brk.css):
 * deep indigo surfaces, marigold fills and terracotta text accents, flat neutral
 * cards with 16px corners, 44px targets. The tokens keep their TvastrOps names
 * (--gold-*) so every component follows without edits.
 *
 * Marigold: --gold (#E9A23B) is for fills, rules and accents; accent text uses
 * --gold-text (terracotta). Contrast (WCAG AA): --text on --void 14.6:1, --muted 7.2:1,
 * --dim 4.7:1. No gradients or extra palettes.
 *
 * Type: IBM Plex Sans throughout, like the website and Studio (2026-10-24;
 * replaces Source Serif 4 / Source Sans 3).
 *
 * Hybrid theme, as on the website: the header (and the sign-in screen) stay
 * dark; the working area is light paper. The light values sit on :root and
 * the dark ones are re-declared on .top-navbar and .auth-screen, so every
 * component follows the tokens of wherever it sits.
 * ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Light paper working area: the website's light tokens. */
  --void: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #EFECE5;
  --surface-alt: #FAF9F6;

  --text: #111111;
  --muted: #55524E;
  --dim: #6B6762;

  --gold: #E9A23B;
  --gold-deep: #A8492A;
  --gold-light: #8F3C21; /* link hover text: a shade darker than --gold-text */
  --gold-hover: #F0B65C; /* gold button hover: a lighter gold, with dark text */
  --gold-text: #A8492A;
  --gold-wash: rgba(233, 162, 59, 0.2);
  --gold-line: rgba(168, 73, 42, 0.5);

  --live: #2F8F63;
  --live-wash: rgba(47, 143, 99, 0.12);
  --alert: #B4472E;
  --alert-wash: rgba(180, 71, 46, 0.1);

  --line: rgba(17, 17, 17, 0.13);
  --line-soft: rgba(17, 17, 17, 0.08);
  --ink: #111111;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04);

  --header-h: 76px;
  --header-surface: rgb(22 27 54 / 0.92);
  --gutter: clamp(18px, 3.2vw, 56px);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 16px;
  --radius-full: 9999px;
  --gap: 20px;
  --target: 44px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms var(--ease);
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: var(--font-sans);
  color-scheme: light;
}

/* Dark: the header (with its menus and search) and the sign-in screen. */
.top-navbar, .auth-screen {
  --void: #161B36;
  --surface: #1F2547;
  --surface-2: #2A3160;
  --surface-alt: #1B2140;
  --text: #F1EFE9;
  --muted: #B4B1A9;
  --dim: #94918A;
  --gold-light: #F4C47A;
  --gold-hover: #F4C47A;
  --gold-text: #E9A23B;
  --gold-wash: rgba(233, 162, 59, 0.14);
  --gold-line: rgba(233, 162, 59, 0.45);
  --live: #7fd4a8;
  --live-wash: rgba(127, 212, 168, 0.12);
  --alert: #E8927C;
  --alert-wash: rgba(232, 146, 124, 0.12);
  --line: rgba(241, 239, 233, 0.13);
  --line-soft: rgba(241, 239, 233, 0.07);
  color-scheme: dark;
  color: var(--text);
}
/* Solid, so the light page never shows through and greys the header. */
.top-navbar { --header-surface: rgb(22 27 54 / 0.97); }
.auth-screen { background: var(--void); }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { background: var(--void); }
body { color-scheme: light; }

h1, h2, h3, h4, .case-panel-title, .welcome-title { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: clip;
}

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

/* Component display rules must not override the hidden attribute. */
[hidden] { display: none !important; }
button { cursor: pointer; }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 3000;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.num-tabular { font-variant-numeric: tabular-nums; }

/* Small uppercase labels — the website's .nav-text / SectionLabel. */
.nav-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* ---------- Top bar ---------- */

.app-container { display: flex; flex-direction: column; min-height: 100vh; }

.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: var(--header-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-icon { height: 34px; width: auto; display: block; }

.brand-product {
  color: var(--gold-text);
  padding-left: 14px;
  border-left: 1px solid var(--line);
  height: 22px;
  display: flex;
  align-items: center;
}

/* Tabs with the website's sliding hover pill. */
.nav-tabs-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  background: rgba(241, 239, 233, 0.08);
  opacity: 0;
  transition: transform 260ms var(--ease), width 260ms var(--ease), opacity 160ms ease;
  pointer-events: none;
}

.nav-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--target);
  padding: 0 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--t-fast);
}

.nav-tab-btn:hover { color: var(--text); }
.nav-tab-btn.active { color: var(--gold-text); }

.nav-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.tab-badge {
  font-size: 11px;
  letter-spacing: 0;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-box { position: relative; width: 260px; }

.search-input-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  height: var(--target);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 0 44px 0 38px;
  font-size: 13px;
  transition: border-color var(--t-fast);
}

.search-input-box input::placeholder { color: var(--dim); }
.search-input-box input:focus { outline: none; border-color: var(--gold-line); }
.search-input-box input::-webkit-search-cancel-button { display: none; }

.search-shortcut-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font-family: inherit;
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--target);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-hover); }

.btn-secondary { background: transparent; border-color: var(--line); color: var(--text); }
.btn-secondary:hover { border-color: var(--gold-line); background: var(--surface); }

.btn-ghost-danger { background: transparent; color: var(--alert); padding: 0 12px; }
.btn-ghost-danger:hover { background: var(--alert-wash); }
.btn-danger { background: var(--alert); color: var(--ink); }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-icon { width: var(--target); padding: 0; }

/* ---------- Layout ---------- */

.main-viewport {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
}
.main-viewport:focus { outline: none; }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 220ms var(--ease); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.section-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: var(--gap);
}

.section-title-wrap h2 {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.section-subtitle { margin-top: 6px; font-size: 14px; color: var(--muted); }
.section-subtitle strong { color: var(--text); font-weight: 600; }

.count-indicator { font-size: 13px; color: var(--dim); }

/* ---------- Headline figures (dashboard) ---------- */

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  text-align: left;
}

.kpi-card.is-alert .kpi-value { color: var(--alert); }

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value { font-size: 28px; font-weight: 600; line-height: 1.15; }
.kpi-sub { font-size: 12px; color: var(--dim); min-height: 1.2em; }

/* ---------- Filters ---------- */

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.toolbar-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.select-control {
  min-height: var(--target);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 0 14px;
  font-size: 13px;
  transition: border-color var(--t-fast);
}
.select-control:hover { border-color: var(--gold-line); }
.select-control.is-set { border-color: var(--gold); color: var(--gold-text); }

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--target);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
}
.check-control:has(input:checked) { border-color: var(--gold); color: var(--gold-text); }
.check-control input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ---------- Enquiries table ---------- */

.table-card-container {
  position: relative; /* keeps the visually-hidden header inside the scroller on phones */
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.leads-data-table { width: 100%; min-width: 980px; border-collapse: collapse; text-align: left; }

.leads-data-table th {
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
}

.leads-data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.leads-data-table tbody tr { cursor: pointer; transition: background-color var(--t-fast); }
.leads-data-table tbody tr:hover { background: var(--surface-alt); }
.leads-data-table tbody tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 56px 16px !important; color: var(--muted); cursor: default; }
.empty-state strong { display: block; color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 4px; }

.company-cell { display: flex; align-items: center; gap: 12px; }

.initials {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--gold-text);
}
.initials-sm { width: 26px; height: 26px; border-radius: 50%; font-size: 10px; }

.cell-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
.cell-sub { font-size: 12px; color: var(--muted); }
.cell-muted { color: var(--dim); }

.value-cell { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Stage pill: label always shown, so state is never colour alone. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text);
}
.stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.status-pill[data-stage="won"] { background: var(--live-wash); color: var(--live); }
.status-pill[data-stage="won"] .stage-dot { background: var(--live); }
.status-pill[data-stage="lost"] { color: var(--dim); }
.status-pill[data-stage="lost"] .stage-dot { background: var(--dim); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag-high { border-color: var(--gold-line); color: var(--gold-text); }
.tag-alert { border-color: rgba(232, 146, 124, 0.5); color: var(--alert); background: var(--alert-wash); }
.tag-ok { color: var(--dim); }

.next-step { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.owner-cell { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.action-cell-btns { display: flex; justify-content: flex-end; gap: 4px; }

.action-btn-sm {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: all var(--t-fast);
}
.action-btn-sm:hover { color: var(--text); border-color: var(--line); background: var(--surface-2); }
.action-btn-sm.delete-btn:hover { color: var(--alert); background: var(--alert-wash); border-color: transparent; }

/* ---------- Boards (pipeline + delivery) ---------- */

.pipeline-board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: calc(100vh - 340px);
}

.kanban-column {
  flex: 1 0 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.kanban-column.drag-over { border-color: var(--gold); background: var(--gold-wash); }

.column-header { padding: 16px 16px 14px; border-bottom: 1px solid var(--line-soft); }

.column-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

.stage-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.column-step { color: var(--gold-text); margin-right: 6px; font-variant-numeric: tabular-nums; }

.column-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--muted);
}

.column-metrics-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.column-metrics-row strong { color: var(--text); font-weight: 600; }

.column-cards-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
}

.column-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}

.deal-card {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  user-select: none;
  transition: border-color var(--t-fast);
}
.deal-card:hover { border-color: var(--gold-line); }
.deal-card.dragging { opacity: 0.4; }

.deal-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.deal-company-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.deal-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.deal-card-value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.deal-card-value.unscoped { font-size: 13px; font-weight: 500; color: var(--dim); }

.deal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.deal-footer-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

.quick-advance-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.quick-advance-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* Delivery phase stepper on cards. */
.phase-track { display: flex; gap: 3px; margin-bottom: 10px; }
.phase-track span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.phase-track span.done { background: var(--gold); }

/* ---------- Analytics ---------- */

.analytics-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  min-width: 0;
}
.chart-card.col-6 { grid-column: span 6; }
.chart-card.col-12 { grid-column: span 12; }

.chart-title-wrap h3 { font-size: 17px; font-weight: 600; }
.chart-title-wrap p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Single-hue magnitude bars with direct labels: text stays in text tokens. */
.bar-list { display: flex; flex-direction: column; gap: 14px; }

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

.bar-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.bar-name { color: var(--text); font-weight: 500; }
.bar-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bar-track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill {
  height: 100%;
  min-width: 4px;
  background: var(--gold);
  border-radius: 0 4px 4px 0;
  transition: width 600ms var(--ease);
}
.bar-fill.is-zero { min-width: 0; }
.bar-fill.tone-won { background: var(--live); }
.bar-fill.tone-muted { background: var(--dim); }

.table-scroll { overflow-x: auto; }

.leaderboard-table { width: 100%; min-width: 620px; border-collapse: collapse; }

.leaderboard-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.leaderboard-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 9, 10, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transform: translateY(12px);
  transition: transform 220ms var(--ease);
}
.modal-backdrop.open .modal-card { transform: none; }

.modal-card form { display: flex; flex-direction: column; min-height: 0; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close-btn {
  width: var(--target);
  height: var(--target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.modal-close-btn:hover { color: var(--text); background: var(--surface-2); }

.modal-body { padding: 20px 24px 8px; overflow-y: auto; }

.form-section { border: none; margin-bottom: 18px; }
.form-section legend { margin-bottom: 12px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }

.form-field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.form-field-group label { font-size: 12px; font-weight: 500; color: var(--muted); }

.form-control-input, .form-control-select, .form-control-textarea {
  width: 100%;
  min-height: var(--target);
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color var(--t-fast);
}
.form-control-input:focus, .form-control-select:focus, .form-control-textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-control-input[aria-invalid="true"] { border-color: var(--alert); }
.form-control-input::placeholder, .form-control-textarea::placeholder { color: var(--dim); }
.form-control-input[type="date"] { color-scheme: dark; }
.form-control-textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

.form-error { color: var(--alert); font-size: 13px; margin: 0 0 12px; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
}
.modal-footer-spacer { flex: 1; }

/* ---------- Toasts ---------- */

.toast-shelf {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInUp 220ms var(--ease);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast-item.is-error { border-left-color: var(--alert); pointer-events: auto; }
/* The shelf is a popover (top layer, above dialogs): undo the browser's popover box. */
.toast-shelf[popover] { inset: auto 24px 24px auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible; width: auto; height: auto; color: inherit; }
.toast-close { margin-left: auto; display: inline-flex; padding: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.toast-close:hover { color: var(--text); }
.toast-close svg { width: 16px; height: 16px; }
.toast-item.leaving { opacity: 0; transform: translateY(8px); }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Shared small controls ---------- */

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--gold-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--gold-light); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
}

.form-hint { font-size: 12px; color: var(--dim); margin: 2px 0 12px; line-height: 1.5; }
.field-label, .form-legend { font-size: 12px; font-weight: 500; color: var(--muted); }
.form-legend { margin-bottom: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
  color: var(--text);
  text-align: left;
}
button.chip:hover { border-color: var(--gold-line); background: var(--surface-2); }
.chip-static { color: var(--muted); }

.tag-status-scheduled { border-color: var(--gold-line); color: var(--gold-text); }
.tag-status-sent { border-color: rgba(127, 212, 168, 0.45); color: var(--live); background: var(--live-wash); }
.tag-status-failed { border-color: rgba(232, 146, 124, 0.5); color: var(--alert); background: var(--alert-wash); }
.tag-status-cancelled { color: var(--dim); }

.success-line { display: flex; align-items: center; gap: 8px; color: var(--live); margin-bottom: 8px; }
.success-line strong { color: var(--text); }

.plain-list { margin: 12px 0 12px 18px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.plain-list strong { color: var(--text); font-weight: 600; }

.inline-form { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.inline-form .form-control-input { flex: 1 1 180px; width: auto; }

.item-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 10px 0 16px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.item-row > div:first-child, .item-row .check-inline { flex: 1; min-width: 0; }
.item-row.is-done .cell-title { text-decoration: line-through; color: var(--dim); }
.check-inline { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-inline input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Sign in ---------- */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.auth-lead { color: var(--muted); margin: 6px 0 22px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Top bar additions ---------- */

.bell-btn { position: relative; }
.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--alert);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.profile-menu-wrap { position: relative; }
.avatar-btn {
  width: var(--target);
  height: var(--target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--gold-line); }
.avatar-btn .initials-sm { width: 32px; height: 32px; font-size: 11px; }

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 200;
  min-width: 250px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.profile-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.profile-menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.profile-menu button:hover, .profile-menu button:focus-visible { background: var(--surface-2); outline: none; }
.profile-menu .menu-danger { color: var(--alert); }

/* ---------- Selection & bulk bar ---------- */

.select-cell { width: 44px; cursor: default; }
.row-check { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.leads-data-table th:first-child, .leads-data-table td:first-child { padding-right: 0; }
.leads-data-table tbody tr.is-selected { background: var(--gold-wash); }

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  background: var(--gold-wash);
  font-size: 13px;
  font-weight: 600;
}
.bulk-bar > span { margin-right: 6px; color: var(--gold-text); }

.card-scan {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius-md);
}

/* ---------- Dialogs & drawer ---------- */

.ui-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.ui-dialog[open] { display: flex; flex-direction: column; animation: fadeIn 200ms var(--ease); }
.ui-dialog::backdrop { background: rgba(9, 9, 10, 0.72); backdrop-filter: blur(6px); }
.ui-dialog-wide { width: min(760px, calc(100vw - 32px)); }

.ui-dialog-drawer {
  width: min(620px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border-radius: 0;
  border-width: 0 0 0 1px;
}
.ui-dialog-drawer[open] { animation: drawerIn 260ms var(--ease); }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.ui-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.ui-dialog-header h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.ui-dialog-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ui-dialog-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.ui-dialog-body > p { margin-bottom: 10px; }
.ui-dialog-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
}

.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.drawer-actions:last-child { margin-bottom: 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 16px;
}
.detail-grid dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 3px;
}
.detail-grid dd { font-size: 14px; }
.detail-grid a { color: var(--gold-text); }

.lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 18px; }
.lead-meta:has(#dClass:empty) #dClass { display: none; }

.drawer-notes {
  padding: 12px 14px;
  border-left: 2px solid var(--gold-line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  margin-bottom: 18px;
}

.drawer-card {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}
.drawer-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.drawer-card-head h4 { font-size: 15px; font-weight: 600; }

/* Case file (js/case-file.js) */
.drawer-card.cf-needs-you { border-color: var(--gold-line); background: var(--gold-wash); }
.cf-approval { padding: 12px 0; border-top: 1px solid var(--line-soft); list-style: none; }
.cf-approval:first-child { border-top: 0; padding-top: 0; }
.cf-approval .inline-form { margin-top: 10px; }
.cf-facility { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cf-transfer, .drawer-card details:has(> summary.btn) { margin-top: 14px; }
.cf-transfer > summary, .drawer-card details > summary.btn { display: inline-flex; list-style: none; cursor: pointer; }
.cf-transfer > summary::-webkit-details-marker, .drawer-card details > summary.btn::-webkit-details-marker { display: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; border: 0; padding: 0; margin: 0 0 14px; }
.check-grid legend { margin-bottom: 8px; }

.send-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.send-row .form-field-group { flex: 1 1 260px; margin-bottom: 0; }

.email-preview {
  white-space: pre-wrap;
  padding: 14px;
  margin: 8px 0 12px;
  border-radius: var(--radius-sm);
  background: var(--void);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  max-height: 260px;
  overflow-y: auto;
}
.email-preview strong { color: var(--text); }

.timeline { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.timeline .tag { flex-shrink: 0; margin-top: 1px; }

.pick-list {
  max-height: 210px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: var(--surface-2); }
.pick-row input { accent-color: var(--gold); width: 16px; height: 16px; }

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

.settings-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.settings-tab {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab[aria-selected="true"] { color: var(--gold-text); border-bottom-color: var(--gold); }
.settings-form { margin-bottom: 24px; }
.settings-form .section-label { margin-bottom: 12px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.initials-lg { width: 48px; height: 48px; border-radius: 50%; font-size: 15px; }

/* ---------- Meetings ---------- */

.meeting-day { margin-bottom: 28px; }
.meeting-day > .section-label { margin-bottom: 12px; }
.meeting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: var(--gap); }
.meeting-grid.is-past { margin-top: 14px; opacity: 0.75; }

.meeting-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
}
.meeting-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.meeting-card h3 { font-size: 16px; font-weight: 600; }
.meeting-when { color: var(--gold-text); font-size: 13px; font-weight: 500; margin-top: 2px; }
.meeting-purpose { color: var(--muted); font-size: 13px; }
.meeting-people { display: flex; flex-wrap: wrap; gap: 6px; }
.meeting-link { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; color: var(--muted); }
.meeting-link a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
}
.meeting-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-panel {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  margin-bottom: 20px;
}
.empty-panel strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

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

/* Logo, six tabs and the account controls need ~1600px on one line (measured); below that the tabs get their own row. */
@media (max-width: 1640px) {
  .top-navbar { height: auto; flex-wrap: wrap; row-gap: 6px; padding-top: 12px; padding-bottom: 8px; }
  .nav-tabs-wrapper { order: 3; width: 100%; overflow-x: auto; }
}

@media (max-width: 1100px) {
  .chart-card.col-6 { grid-column: span 12; }
  .search-input-box { width: 200px; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .navbar-actions { flex: 1; justify-content: flex-end; }
  .search-input-box { width: auto; flex: 1; min-width: 0; }
  .search-shortcut-kbd { display: none; }
  #btnNewLead { width: var(--target); padding: 0; font-size: 0; gap: 0; }
  .nav-tab-btn { padding: 0 12px; }
  .nav-tab-btn.active::after { left: 12px; right: 12px; }
  .brand-section { width: 100%; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .section-title-wrap h2 { font-size: 22px; }
  .toast-shelf, .toast-shelf[popover] { left: 16px; right: 16px; inset: auto 16px 16px 16px; }
  .kpi-value { font-size: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .meeting-grid { grid-template-columns: 1fr; }
  .ui-dialog-body, .ui-dialog-header, .ui-dialog-footer { padding-left: 16px; padding-right: 16px; }
  .auth-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2-step login setup */
.qr-box { width: 184px; height: 184px; padding: 8px; background: #fff; border-radius: 8px; margin: 4px 0 12px; }
.qr-box svg { display: block; width: 100%; height: 100%; }
.secret-key { font-size: 13px; letter-spacing: 0.06em; color: var(--text); word-break: break-all; }
.recovery-codes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 12px 0 16px; padding: 0; }
.recovery-codes code { font-size: 14px; letter-spacing: 0.04em; color: var(--text); }

/* Sign-up consent, bot check and policy links */
.auth-consent { align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; margin: 4px 0 14px; }
.auth-consent input { margin-top: 3px; flex-shrink: 0; }
.auth-consent a, .ui-dialog-body p a { color: var(--gold-text); }
.turnstile-box { min-height: 65px; margin: 0 0 12px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-size: 12px; }
.legal-links a { color: var(--dim); text-decoration: none; }
.legal-links a:hover { color: var(--gold-light); text-decoration: underline; }

/* Lead score tags (server/scoring.js) */
.tag-class-hot { border-color: rgba(232, 146, 124, 0.55); color: var(--alert); background: var(--alert-wash); }
.tag-class-warm { border-color: var(--gold-line); color: var(--gold-text); background: var(--gold-wash); }
.tag-class-cool { color: var(--muted); }
.tag-class-cold { color: var(--dim); }
.tag-class-unclassified { color: var(--dim); border-style: dashed; }
.cell-title .tag { margin-left: 6px; vertical-align: 1px; }

/* AI call panel in the lead drawer */
.ai-score { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.ai-score .tag { font-size: 13px; }
.ai-reasons { margin: 6px 0 10px 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ai-next { color: var(--text); font-size: 14px; margin: 0 0 12px; }
.ai-call { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 12px; }
.ai-call-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-answers { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 4px 14px; font-size: 13px; margin: 8px 0; }
.ai-answers dt { color: var(--dim); text-transform: capitalize; }
.ai-answers dd { margin: 0; color: var(--text); }
.ai-transcript { white-space: pre-wrap; font-size: 13px; color: var(--muted); max-height: 280px; overflow: auto; background: var(--surface-alt); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.ai-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }

/* ---------- Enquiries list ---------- */
.section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-actions .count-indicator { margin-right: 6px; }
/* The company name opens the account: a real button, so it works from the keyboard. */
.link-title { background: none; border: none; padding: 0; font-family: inherit; color: var(--text); text-align: left; cursor: pointer; }
.link-title:hover { color: var(--gold-light); }
.link-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.tab-badge-alert { background: var(--alert-wash); color: var(--alert); }
.bar-fill.tone-alert { background: var(--alert); }

/* ---------- Dashboard (js/dashboard.js) ---------- */
.dash-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
/* Two independent columns, so a short panel never stretches to match its neighbour. */
.dash-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: var(--gap); align-items: start; }
.dash-col-main, .dash-col-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.dash-panel {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 22px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-card);
}
.dash-panel > .btn, .dash-panel > .btn-link { align-self: flex-start; }
.dash-panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.dash-panel-head h3 { font-size: 17px; font-weight: 600; }
.dash-subhead { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.dash-message { align-items: flex-start; margin-bottom: var(--gap); }
.dash-message strong { font-size: 16px; font-weight: 600; }
.dash-message p { color: var(--muted); max-width: 72ch; }

/* Needs you now */
.dash-queue { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.dash-item {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; align-items: start; gap: 4px 14px;
  width: 100%; padding: 12px; border: none; border-radius: var(--radius-md);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.dash-item:hover { background: var(--surface-2); }
.dash-item:focus-visible, .dash-live-row:focus-visible, .dash-person:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.dash-item .tag { justify-self: start; margin-top: 2px; }
.dash-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-item-detail { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-age { font-size: 12px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 2px; }
.dash-more { align-self: flex-start; margin-left: 12px; }
.dash-clear { display: flex; align-items: center; gap: 8px; color: var(--live); }

/* AI caller */
.dash-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: var(--radius-full); color: var(--muted);
}
.dash-status.is-ok, .dash-status.is-live { color: var(--live); border-color: rgba(127, 212, 168, 0.45); background: var(--live-wash); }
.dash-status.is-warn { color: var(--gold-text); border-color: var(--gold-line); }
.dash-status.is-off { color: var(--dim); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: livePulse 1.6s var(--ease) infinite; }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(127, 212, 168, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(127, 212, 168, 0); }
}
.dash-live { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.dash-live-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; border-radius: var(--radius-md); background: var(--surface-2);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.dash-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.dash-stats dt { font-size: 12px; color: var(--dim); }
.dash-stats dd { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-stats dd .cell-sub { font-size: 12px; font-weight: 400; }
.dash-outcome { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.seg-connected { background: var(--live); }
.seg-unanswered { background: var(--gold); }
.seg-failed { background: var(--alert); }
.dash-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.dash-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }

/* Lead quality × stage: shade grows with the count; the number is always printed */
.dash-matrix { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 4px; }
.dash-matrix th { padding: 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); text-align: left; }
.dash-matrix tbody th, .dash-matrix tfoot th { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.dash-matrix td { height: 40px; text-align: center; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; background: rgb(207 185 145 / calc(var(--heat, 0) * 0.32)); }
.dash-matrix tfoot td, .dash-matrix .dash-total { background: none; color: var(--muted); font-size: 13px; }
.dash-cell { width: 100%; min-height: 40px; border: none; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.dash-cell:hover { box-shadow: inset 0 0 0 1px var(--gold-line); }
.dash-cell:focus-visible { outline: 2px solid var(--gold); }
.dash-zero { color: var(--dim); }

/* Team */
.dash-team { min-width: 680px; }
.dash-person { display: flex; align-items: center; gap: 10px; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dash-person .cell-sub { display: block; }
.dash-person:hover .cell-title { color: var(--gold-light); }

/* System health */
.dash-health { list-style: none; display: flex; flex-direction: column; }
.dash-health-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.dash-health-row:last-child { border-bottom: none; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--dim); }
.health-dot.is-ok { background: var(--live); }
.health-dot.is-warn { background: var(--gold); }
.health-dot.is-fail { background: var(--alert); }
.dash-health-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dash-health-word { font-size: 12px; color: var(--dim); }
.dash-health-word.is-ok { color: var(--live); }
.dash-health-word.is-warn { color: var(--gold-text); }
.dash-health-word.is-fail { color: var(--alert); }

/* Loading placeholders */
.dash-skel { min-height: 104px; animation: skelPulse 1.4s ease-in-out infinite; }
.dash-skel-tall { min-height: 320px; }
@keyframes skelPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* One column, in priority order: queue, AI caller, speed, quality, team, health. */
@media (max-width: 1100px) {
  .dash-columns { display: flex; flex-direction: column; align-items: stretch; }
  .dash-col-main, .dash-col-side { display: contents; }
  .dash-order-1 { order: 1; } .dash-order-2 { order: 2; } .dash-order-3 { order: 3; }
  .dash-order-4 { order: 4; } .dash-order-5 { order: 5; } .dash-order-6 { order: 6; }
}
/* Five figures as a balanced 2 + 3 on tablets. */
@media (min-width: 721px) and (max-width: 1100px) {
  .dash-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash-metrics > :nth-child(-n + 2) { grid-column: span 3; }
  .dash-metrics > :nth-child(n + 3) { grid-column: span 2; }
}
@media (max-width: 720px) {
  .dash-metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .dash-metrics > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dash-columns { gap: 12px; }
  .dash-panel { padding: 16px; }
  .dash-item { grid-template-columns: minmax(0, 1fr) auto; }
  .dash-item .tag { grid-column: 1 / -1; }
  .dash-item-detail { white-space: normal; }
}

/* Why they reached out: each Enquiry as the customer gave it (js/lead-drawer.js) */
.enquiry-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.enquiry { padding: 12px 14px; border-left: 2px solid var(--gold-line); background: var(--surface-alt); font-size: 14px; display: grid; gap: 6px; }
.enquiry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.enquiry-message { white-space: pre-wrap; color: var(--muted); }
.enquiry-figures { color: var(--text); }
.case-link { padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); font-size: 14px; display: grid; gap: 8px; }
.case-link-ask { border-color: var(--gold-line); background: var(--gold-wash); }
.case-link > .btn-link { justify-self: start; }

/* Review: the Owner's first decision on a new Enquiry (js/lead-drawer.js) */
.review-box { padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--gold-line); border-radius: var(--radius-md); background: var(--gold-wash); display: grid; gap: 10px; }
.review-box h4 { font-size: 15px; font-weight: 600; }
.review-box.is-overdue { border-color: var(--alert); background: var(--alert-wash); }
.review-form { display: grid; gap: 10px; padding-top: 4px; }

/* Progress at the top of the Case file: a read-only circuit track (js/lead-drawer.js) */
.track { margin-bottom: 12px; }
.track-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.track-cap { font-size: 14px; color: var(--text); }
.track-pct { font: 600 12px var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-text); }
.track-rail { position: relative; padding-top: 2px; }
/* Line and fill run from the first node's centre to the last's (nodes are 20px wide). */
.track-line, .track-fill { position: absolute; left: 10px; top: 10px; height: 2px; }
.track-line { right: 10px; background: var(--line); }
.track-fill { width: calc((100% - 20px) * var(--p) / 100); background: var(--gold); transition: width 600ms var(--ease); }
.track-nodes { position: relative; display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; }
.track-nodes li { display: grid; justify-items: center; gap: 8px; width: 20px; }
.track-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.track-nodes .done .track-dot { background: var(--gold); border-color: var(--gold); }
.track-nodes .cur .track-dot { width: 14px; height: 14px; margin-top: 2px; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-wash); animation: trackGlow 2s ease-in-out infinite; }
.track-name { font: 500 11px var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.track-nodes .done .track-name { color: var(--muted); }
.track-nodes .cur .track-name { color: var(--gold-text); font-weight: 600; }
.track-nodes li:first-child .track-name { justify-self: start; }
.track-nodes li:last-child .track-name { justify-self: end; }
.track.is-lost .track-pct, .track.is-lost .track-cap { color: var(--alert); }
@keyframes trackGlow { 50% { box-shadow: 0 0 0 6px rgba(233, 162, 59, 0.1), 0 0 20px var(--gold); } }
@media (prefers-reduced-motion: reduce) { .track-nodes .cur .track-dot { animation: none; } .track-fill { transition: none; } }
@media (max-width: 760px) { .track-name { font-size: 9px; letter-spacing: 0; } .track-nodes li:not(.cur) .track-name { color: var(--dim); } }
.stage-guide { padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); display: grid; gap: 10px; }
.stage-guide .drawer-card-head { margin-bottom: 0; }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.guide-list li { display: flex; align-items: center; gap: 8px; }
.guide-list li.is-done { color: var(--dim); text-decoration: line-through; }
.guide-list svg { width: 14px; height: 14px; color: var(--live); }
.guide-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; background: var(--gold-wash); border-radius: var(--radius-md); font-size: 14px; }
.stage-guide > [data-act="advance"] { justify-self: start; }

/* The Case file: an overlay with named sections, one shown at a time (js/lead-drawer.js) */
.ui-dialog-case { width: min(1120px, calc(100vw - 32px)); height: min(840px, calc(100vh - 32px)); }
.ui-dialog-case .ui-dialog-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.case-top { padding: 14px 24px 12px; border-bottom: 1px solid var(--line-soft); }
.case-top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.case-top-row .lead-meta { margin: 0; }
.case-top-row .drawer-actions { margin: 0; gap: 8px; }
.case-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px 1fr; }
.case-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line-soft); overflow-y: auto; }
.case-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 14px; border: 0; border-left: 3px solid transparent; border-radius: 0 var(--radius-md) var(--radius-md) 0; background: none; color: var(--muted); font-size: 14px; text-align: left; cursor: pointer; }
.case-nav-item:hover { color: var(--text); background: var(--surface-alt); }
.case-nav-item[aria-selected="true"] { color: var(--text); font-weight: 600; background: var(--gold-wash); border-left-color: var(--gold); }
.case-nav-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.case-nav-count { font-size: 12px; color: var(--dim); }
.case-panels { overflow-y: auto; padding: 22px 28px 28px; }
.case-panel-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.case-panel-purpose { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.case-panel:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
/* A section is already titled: the card inside needs no second heading or frame. */
.case-panel > .drawer-card:only-of-type, .case-panel[data-panel="ai"] > .drawer-card, .case-panel[data-panel="email"] > .drawer-card, .case-panel[data-panel="followup"] > .drawer-card, .case-panel[data-panel="tasks"] > .drawer-card, .case-panel[data-panel="sites"] > .drawer-card { padding: 0; border: 0; background: none; }
.case-panel[data-panel="ai"] #aiHead, .case-panel[data-panel="email"] #emailHead, .case-panel[data-panel="followup"] #fuHead, .case-panel[data-panel="tasks"] > .drawer-card > .drawer-card-head, .case-panel[data-panel="sites"] > .drawer-card > .drawer-card-head { display: none; }
.enquiry-did { font-weight: 600; color: var(--text); }
.enquiry.is-new { border-left-color: var(--gold); }
@media (max-width: 760px) {
  .ui-dialog-case { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .case-top { padding: 12px 16px; }
  .case-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .case-nav { flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .case-nav-item { flex-shrink: 0; min-height: 38px; border-left: 0; border-bottom: 3px solid transparent; border-radius: var(--radius-md) var(--radius-md) 0 0; white-space: nowrap; }
  .case-nav-item[aria-selected="true"] { border-bottom-color: var(--gold); }
  .case-panels { padding: 16px; }
}
.cc-toggle { margin: 12px 0 4px; }
.cc-toggle[open] .form-field-group { margin-top: 10px; }
.history-item { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); list-style: none; }
.journey-toggle { margin-top: 18px; }
.journey-toggle .timeline { margin-top: 12px; }
.timeline > .history-item { display: grid; grid-template-columns: 1fr; gap: 2px; }
/* Touch screens: everything in a Case you can tap is at least 44px tall. */
@media (pointer: coarse) {
  .ui-dialog-case .detail-grid dd a { display: inline-flex; align-items: center; min-height: 44px; }
  .ui-dialog-case summary, .ui-dialog-case .btn-link { display: inline-flex; align-items: center; min-height: 44px; }
  .ui-dialog-case .check-inline { min-height: 44px; }
  .ui-dialog-case .check-inline input { width: 20px; height: 20px; }
  .toast-close { min-width: 44px; min-height: 44px; justify-content: center; }
}
@media (max-width: 480px) { .track-nodes li:not(.cur) .track-name { visibility: hidden; } .track-nodes li.cur:first-child .track-name { justify-self: start; } }

/* Today: the home screen (js/today.js) */
.today { max-width: 920px; }
.today-head h2 { font-size: 28px; font-weight: 600; }
.today-sub { color: var(--muted); font-size: 16px; margin: 6px 0 24px; }
.today-sub strong { color: var(--text); }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 0; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface); }
.today-item.is-urgent { border-color: var(--alert); }
.today-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-md); }
.today-open:hover .today-who { color: var(--gold-text); }
.today-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.today-item.is-urgent .today-dot { background: var(--alert); }
.today-main { display: grid; gap: 3px; min-width: 0; }
.today-who { font-size: 16px; font-weight: 600; }
.today-why { color: var(--muted); font-size: 14px; }
.today-when { margin-left: auto; color: var(--dim); font-size: 13px; white-space: nowrap; }
.today-late { color: var(--alert); font-weight: 600; }
.today-act { flex-shrink: 0; min-width: 104px; min-height: 44px; }
.today-empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--muted); display: grid; justify-items: center; gap: 12px; }
.today-empty-mark { font-size: 32px; color: var(--live); }
@media (max-width: 640px) {
  .today-item { flex-wrap: wrap; padding: 4px 12px 12px 0; }
  .today-open { flex-basis: 100%; }
  .today-act { margin-left: 40px; flex: 1; }
}

/* View switch inside a tab: Cases (List / Board / Won), Reports (Overview / Charts) */
.view-switch { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 999px; }
.view-switch-label { padding: 0 8px 0 10px; font-size: 12px; color: var(--dim); }
.view-switch-btn { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.view-switch-btn[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* First-time welcome (js/welcome.js) */
.ui-dialog-welcome { width: min(520px, calc(100vw - 32px)); }
.welcome-num { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.welcome-title { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.welcome-text { font-size: 16px; line-height: 1.6; color: var(--muted); }
.welcome-dots { display: inline-flex; gap: 6px; margin-right: auto; }
.welcome-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.welcome-dots i.on { background: var(--gold); }
.log-call { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); display: grid; gap: 10px; }

/* ── Call brief (js/call-brief.js): one named part at a time, Call now at the bottom ── */
.brief-steps { list-style: none; display: grid; gap: 8px; margin: 14px 0; }
.brief-steps li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--dim); }
.brief-steps li.is-done { color: var(--text); }
.brief-steps li.is-done::before { content: "✓ "; color: var(--live); }
.brief-steps li.is-now { color: var(--text); border-color: var(--gold-line); }
.brief-steps li.is-now::before { content: "… "; color: var(--gold-text); }
.brief-pick { display: grid; gap: 8px; justify-items: start; }
.brief-pick .btn { text-align: left; white-space: normal; height: auto; min-height: var(--target); }
.brief-alert { padding: 10px 12px; border-radius: var(--radius-md); background: var(--alert-wash); color: var(--text); }
.brief-written { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 10px; }
.brief-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.brief-tab { flex: none; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-full); border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.brief-tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.brief-part { padding-top: 10px; }
.brief-facts { list-style: none; display: grid; gap: 8px; }
.brief-facts li { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-md); }
.brief-missing { color: var(--dim); font-style: italic; }
.brief-src { font-size: 12px; color: var(--dim); margin-top: 3px; overflow-wrap: anywhere; }
.brief-src a { color: var(--dim); }
.brief-problem { padding: 14px; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--gold); border-radius: var(--radius-md); }
.brief-problem h5 { font-family: var(--font-head); font-size: 16px; font-weight: 600; margin: 8px 0 6px; }
.brief-problem ul { margin: 4px 0 0 18px; font-size: 13px; color: var(--muted); }
.brief-ask { margin: 10px 0 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gold-wash); }
.brief-ask b { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); }
.brief-conf-high { border-color: var(--gold-line); color: var(--gold-text); }
.brief-paste { margin: 14px 0 4px; }
.brief-paste textarea { margin: 8px 0; width: 100%; }
.brief-call { display: flex; width: 100%; margin-top: 16px; justify-content: center; }
a.brief-call { position: sticky; bottom: 0; text-decoration: none; }
.card-limits { margin: 6px 0 0 18px; display: grid; gap: 2px; }

/* After the call (js/call-brief.js): one tap per answer */
.after-open { width: 100%; margin-top: 10px; }
.after-call { margin-top: 16px; padding: 14px; border: 1px solid var(--gold-line); border-radius: var(--radius-md); display: grid; gap: 10px; }
.after-call h5 { font-family: var(--font-head); font-size: 16px; font-weight: 600; }
.after-row { border: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.after-row legend { width: 100%; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.after-pick { min-height: 40px; padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.after-pick[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.after-text { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.after-actions { display: flex; gap: 12px; align-items: center; }
.after-done { margin-top: 12px; padding: 12px; border-radius: var(--radius-md); background: var(--live-wash); display: grid; gap: 8px; justify-items: start; }
.brief-news { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--gold-line); background: var(--gold-wash); }
.brief-news ul { list-style: none; margin-top: 6px; display: grid; gap: 6px; }
.next-step { margin-top: 14px; display: grid; gap: 8px; justify-items: start; }
.next-list { margin-left: 18px; display: grid; gap: 10px; }
.next-list li { display: grid; gap: 4px; justify-items: start; }
.dash-brief-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.dash-brief-table th, .dash-brief-table td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.dash-brief-table th[scope="row"], .dash-brief-table thead th:first-child { text-align: left; }

/* ---------- Bell panel: notifications you open, snooze or clear on purpose ---------- */
.notif-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notif-list { display: grid; gap: 2px; margin: 8px 0 20px; }
.notif-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 8px 8px 4px; border-radius: var(--radius-sm); }
.notif-row:hover { background: var(--surface-2); }
.notif-row.is-done .cell-title { color: var(--dim); text-decoration: line-through; }
.notif-main { flex: 1 1 220px; min-width: 0; display: grid; gap: 2px; padding: 6px 8px; border: 0; background: none; color: inherit; text-align: left; border-radius: var(--radius-sm); cursor: default; }
button.notif-main { cursor: pointer; }
button.notif-main:hover .cell-title { color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.notif-actions { display: flex; align-items: center; gap: 6px; }
.notif-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.notif-btn:hover { border-color: var(--gold); }
.notif-done svg { color: var(--live); }
.snooze-menu { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 12px; }
.notif-check { width: 18px; height: 18px; margin-left: 8px; accent-color: var(--gold); cursor: pointer; flex: none; }
.notif-cleared > summary, .notif-add > summary { cursor: pointer; list-style: none; margin: 4px 0; }
.notif-cleared > summary::-webkit-details-marker, .notif-add > summary::-webkit-details-marker { display: none; }
.notif-add { margin: 8px 0 12px; }
.notif-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gold-wash); border: 1px solid var(--gold-line); font-size: 14px; }
