/* ============================================================
   OJT Dashboard — Design Tokens & Base
   Aesthetic: warm-neutral, calm, modern. Sage-olive accent.
   ============================================================ */

:root {
  /* ---- Pulse Check IQ seller brand (NOT customer-configurable) ---- */
  --pc-blue: oklch(0.58 0.22 258);
  --pc-cyan: oklch(0.78 0.13 195);
  --pc-navy: oklch(0.2 0.05 260);
  --pc-gradient: linear-gradient(90deg, var(--pc-blue) 0%, var(--pc-cyan) 100%);

  /* ---- palette: Sage (default) ---- */
  --bg: oklch(0.975 0.008 75);
  --bg-elevated: oklch(0.99 0.005 75);
  --surface: #ffffff;
  --surface-alt: oklch(0.97 0.008 75);
  --ink: oklch(0.22 0.01 75);
  --ink-strong: oklch(0.16 0.01 75);
  --ink-muted: oklch(0.5 0.01 75);
  --ink-faint: oklch(0.65 0.008 75);
  --border: oklch(0.91 0.008 75);
  --border-strong: oklch(0.85 0.008 75);
  --accent: oklch(0.55 0.085 145);
  --accent-soft: oklch(0.93 0.04 145);
  --accent-ink: oklch(0.32 0.085 145);
  --danger: oklch(0.58 0.16 30);
  --danger-soft: oklch(0.94 0.05 30);
  --warn: oklch(0.7 0.14 75);
  --warn-soft: oklch(0.94 0.06 75);
  --good: oklch(0.6 0.1 155);
  --good-soft: oklch(0.93 0.045 155);

  /* type */
  --font-sans: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: "Geist", system-ui, sans-serif;

  /* sizing */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* density */
  --row-h: 44px;
  --pad-card: 20px;
  --pad-gutter: 24px;
  --gap: 16px;
  --text-base: 14px;
  --text-sm: 12.5px;
  --text-xs: 11.5px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 28px;
  --text-3xl: 40px;

  --shadow-sm: 0 1px 0 oklch(0.85 0.01 75 / 0.5);
  --shadow: 0 1px 2px oklch(0.4 0.02 75 / 0.04), 0 4px 12px oklch(0.4 0.02 75 / 0.05);
  --shadow-lg: 0 1px 2px oklch(0.4 0.02 75 / 0.04), 0 12px 32px oklch(0.4 0.02 75 / 0.08);
}

/* ---- Palette variants ---- */
[data-palette="sage"]   { --accent: oklch(0.55 0.085 145); --accent-soft: oklch(0.93 0.04 145); --accent-ink: oklch(0.32 0.085 145); }
[data-palette="indigo"] { --accent: oklch(0.5 0.13 265);  --accent-soft: oklch(0.94 0.045 265); --accent-ink: oklch(0.32 0.13 265); }
[data-palette="terracotta"] { --accent: oklch(0.6 0.14 40); --accent-soft: oklch(0.95 0.04 40); --accent-ink: oklch(0.4 0.13 40); }
[data-palette="ocean"]  { --accent: oklch(0.55 0.1 230); --accent-soft: oklch(0.94 0.045 230); --accent-ink: oklch(0.34 0.11 230); }
[data-palette="rose"]   { --accent: oklch(0.6 0.13 5);   --accent-soft: oklch(0.95 0.04 5);   --accent-ink: oklch(0.4 0.13 5); }
[data-palette="charcoal"] { --accent: oklch(0.32 0.005 75); --accent-soft: oklch(0.9 0.005 75); --accent-ink: oklch(0.15 0.005 75); }
[data-palette="butter"] { --accent: oklch(0.65 0.13 95); --accent-soft: oklch(0.95 0.05 95); --accent-ink: oklch(0.4 0.13 95); }
[data-palette="plum"]   { --accent: oklch(0.45 0.12 320); --accent-soft: oklch(0.94 0.04 320); --accent-ink: oklch(0.3 0.12 320); }

/* ---- Font pairings ---- */
[data-fonts="modern"]    { --font-sans: "Geist", system-ui, sans-serif; --font-display: "Geist", system-ui, sans-serif; }
[data-fonts="classic"]   { --font-sans: "Manrope", system-ui, sans-serif; --font-display: "Source Serif 4", Georgia, serif; }
[data-fonts="friendly"]  { --font-sans: "Plus Jakarta Sans", system-ui, sans-serif; --font-display: "Plus Jakarta Sans", system-ui, sans-serif; }
[data-fonts="editorial"] { --font-sans: "Manrope", system-ui, sans-serif; --font-display: "DM Serif Display", Georgia, serif; }

/* ---- Density ---- */
[data-density="compact"] {
  --row-h: 36px;
  --pad-card: 14px;
  --pad-gutter: 18px;
  --gap: 12px;
  --text-base: 13px;
  --text-sm: 12px;
  --text-xs: 11px;
  --text-lg: 15px;
  --text-xl: 18px;
  --text-2xl: 24px;
  --text-3xl: 34px;
}

/* ---- Dark mode ---- */
[data-theme="dark"] {
  --bg: oklch(0.16 0.008 75);
  --bg-elevated: oklch(0.2 0.008 75);
  --surface: oklch(0.22 0.008 75);
  --surface-alt: oklch(0.26 0.008 75);
  --ink: oklch(0.95 0.008 75);
  --ink-strong: oklch(0.99 0.005 75);
  --ink-muted: oklch(0.7 0.01 75);
  --ink-faint: oklch(0.55 0.01 75);
  --border: oklch(0.32 0.008 75);
  --border-strong: oklch(0.4 0.008 75);
  --accent-soft: oklch(0.3 0.06 145);
  --accent-ink: oklch(0.85 0.05 145);
  --danger-soft: oklch(0.3 0.08 30);
  --warn-soft: oklch(0.3 0.08 75);
  --good-soft: oklch(0.3 0.06 155);
  --shadow-sm: 0 1px 0 oklch(0 0 0 / 0.3);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 4px 12px oklch(0 0 0 / 0.25);
  --shadow-lg: 0 1px 2px oklch(0 0 0 / 0.3), 0 12px 32px oklch(0 0 0 / 0.4);
}
[data-theme="dark"][data-palette="sage"]   { --accent-ink: oklch(0.85 0.06 145); }
[data-theme="dark"][data-palette="indigo"] { --accent-ink: oklch(0.85 0.08 265); --accent-soft: oklch(0.3 0.08 265); }
[data-theme="dark"][data-palette="terracotta"] { --accent-ink: oklch(0.85 0.08 40); --accent-soft: oklch(0.3 0.08 40); }
[data-theme="dark"][data-palette="ocean"]  { --accent-ink: oklch(0.85 0.07 230); --accent-soft: oklch(0.3 0.08 230); }
[data-theme="dark"][data-palette="rose"]   { --accent-ink: oklch(0.85 0.08 5); --accent-soft: oklch(0.3 0.08 5); }
[data-theme="dark"][data-palette="charcoal"] { --accent: oklch(0.85 0.005 75); --accent-ink: oklch(0.95 0.005 75); --accent-soft: oklch(0.3 0.005 75); }
[data-theme="dark"][data-palette="butter"] { --accent-ink: oklch(0.9 0.1 95); --accent-soft: oklch(0.3 0.08 95); }
[data-theme="dark"][data-palette="plum"]   { --accent-ink: oklch(0.85 0.08 320); --accent-soft: oklch(0.3 0.08 320); }

/* ============================================================
   Base
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Layout shell
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  height: 100vh;
  overflow: hidden;
}
[data-density="compact"] .app { grid-template-columns: 220px 1fr; }
.app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.app-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px var(--pad-gutter) 64px;
}
[data-density="compact"] .app-body { padding: 20px var(--pad-gutter) 48px; }
.app-body-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 18px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  line-height: 1.15;
}
.brand-meta {
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.15;
  margin-top: 2px;
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}
.nav-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  color: var(--ink-faint);
  padding: 12px 10px 4px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-alt); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.active svg { color: var(--accent-ink); }
.nav-item svg { width: 16px; height: 16px; color: var(--ink-faint); flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--ink-muted);
}
.nav-item .nav-badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--pad-gutter);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  min-height: 60px;
}
[data-density="compact"] .topbar { min-height: 52px; padding: 10px var(--pad-gutter); }
.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-muted);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.active { background: var(--accent-soft); color: var(--accent-ink); }

/* ============================================================
   Typography helpers
   ============================================================ */

.h1, .h2, .h3 { font-family: var(--font-display); color: var(--ink-strong); letter-spacing: -0.02em; }
.h1 { font-size: var(--text-3xl); font-weight: 600; line-height: 1.1; }
.h2 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.15; }
.h3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 500; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--ink-strong); color: var(--bg); border-color: var(--ink-strong); }
.btn.primary:hover { background: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: white; }
.btn.accent:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn.ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn.danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn.lg { padding: 11px 18px; font-size: 14px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--pad-card);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.card-header .h3 { margin: 0; }
.card-header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px; }

/* ============================================================
   Inputs
   ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}
.field-hint { font-size: 12px; color: var(--ink-faint); }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink-strong);
  transition: border-color .12s, background .12s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  width: 32px;
  height: 18px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-thumb { transform: translateX(14px); }
.toggle.sm .toggle-track { width: 28px; height: 16px; }
.toggle.sm .toggle-thumb { width: 12px; height: 12px; }
.toggle.sm.on .toggle-thumb { transform: translateX(12px); }

/* checkbox */
.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--surface);
  transition: background .12s, border-color .12s;
}
.checkbox.checked { background: var(--accent); border-color: var(--accent); }
.checkbox.checked::after { content: ""; width: 8px; height: 5px; border: 1.5px solid white; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.checkbox.lg { width: 20px; height: 20px; }

/* radio */
.radio {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--surface);
}
.radio.checked { border-color: var(--accent); }
.radio.checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   Badges & chips
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: oklch(0.45 0.1 75); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.solid { background: var(--ink-strong); color: var(--bg); border-color: transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s;
}
.chip:hover { background: var(--surface-alt); }
.chip.active { background: var(--ink-strong); color: var(--bg); border-color: var(--ink-strong); }
.chip.outline-accent { border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   Tables
   ============================================================ */

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  white-space: nowrap;
}
.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-alt); }
[data-density="compact"] .tbl td { padding: 8px 10px; font-size: 12.5px; }
[data-density="compact"] .tbl th { padding: 8px 10px; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }

/* ============================================================
   Progress
   ============================================================ */
.bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}
.bar.thick { height: 10px; }
.bar.danger .bar-fill { background: var(--danger); }
.bar.warn .bar-fill { background: var(--warn); }

/* ============================================================
   Stars rating (for scorecards)
   ============================================================ */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; color: var(--border-strong); }
.stars svg.filled { color: var(--accent); }
.stars.lg svg { width: 18px; height: 18px; }

/* ============================================================
   Layout utilities
   ============================================================ */

.row { display: flex; align-items: center; gap: var(--gap); }
.col { display: flex; flex-direction: column; gap: var(--gap); }
.between { justify-content: space-between; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.full { width: 100%; }

/* ============================================================
   Page header
   ============================================================ */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-header .subtitle {
  color: var(--ink-muted);
  font-size: 13.5px;
  margin-top: 6px;
}
.page-header-actions { display: flex; gap: 8px; }

/* ============================================================
   Setup Wizard
   ============================================================ */
.wizard {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.wizard-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
.wizard-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}
.wizard-step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
  font-weight: 500;
}
.wizard-step-dot .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--ink-faint);
}
.wizard-step-dot.active .dot { background: var(--accent); border-color: var(--accent); color: white; }
.wizard-step-dot.done .dot { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.wizard-step-dot.active, .wizard-step-dot.done { color: var(--ink); }
.wizard-step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.wizard-step-line.done { background: var(--accent); }
.wizard-body {
  overflow-y: auto;
  padding: 48px 32px;
}
.wizard-body-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.wizard-body.wide .wizard-body-inner { max-width: 960px; }
.wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ============================================================
   Misc
   ============================================================ */
.hr { height: 1px; background: var(--border); border: 0; margin: 16px 0; }
.divider { height: 1px; background: var(--border); }
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--ink-faint);
}
.kv { display: flex; gap: 4px; flex-direction: column; }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 500; }
.kv .v { font-size: 14px; color: var(--ink); }

/* Tour overlay */
.tour-backdrop {
  position: fixed; inset: 0;
  background: oklch(0.1 0.01 75 / 0.55);
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tour-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: tourpop .25s ease;
}
@keyframes tourpop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tour-img {
  height: 140px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-alt));
  border-radius: 12px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
}

/* Red flag callout */
.flag-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--danger-soft);
  background: var(--danger-soft);
  border-radius: 10px;
  align-items: flex-start;
}
.flag-card.warn { background: var(--warn-soft); border-color: var(--warn-soft); }
.flag-card svg { color: var(--danger); width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.flag-card.warn svg { color: oklch(0.55 0.13 75); }

/* Trend arrow */
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; }
.trend.up { color: var(--good); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--ink-faint); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink-strong); border-color: var(--accent); }

/* AI Summary panel */
.ai-card {
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.ai-prose {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  max-height: 480px;
  overflow-y: auto;
}
.ai-prose h4 { font-family: var(--font-display); margin: 16px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.ai-prose h4:first-child { margin-top: 0; }
.ai-prose p { margin: 0 0 10px; }
.ai-prose ul { margin: 0 0 12px; padding-left: 18px; }
.ai-prose li { margin-bottom: 4px; }

/* Chart bits */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 8px 0;
}
.chart-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 10.5px;
  color: white;
  font-weight: 600;
  padding-bottom: 4px;
}
.chart-bar.muted { background: var(--surface-alt); color: var(--ink-faint); }
.chart-labels { display: flex; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--ink-faint); }
.chart-labels > span { flex: 1; text-align: center; }

/* Tweaks Panel skin (provided by tweaks-panel.jsx) overrides */
.tp-panel {
  font-family: var(--font-sans) !important;
}

/* small util */
.scroll { overflow-y: auto; }
.shrink-0 { flex-shrink: 0; }
.pointer { cursor: pointer; }

/* ============================================================
   Pulse Check IQ seller branding
   ============================================================ */

/* Demo banner — top of every page when in sample data mode */
.demo-banner {
  background: var(--pc-gradient);
  color: white;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
}
.demo-banner .pc-logo-text {
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.demo-banner .pc-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.35);
}
.demo-banner .demo-cta {
  margin-left: auto;
  background: white;
  color: var(--pc-navy);
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .12s;
}
.demo-banner .demo-cta:hover { transform: translateY(-1px); }
.demo-banner .demo-dismiss {
  background: transparent;
  color: white;
  opacity: 0.7;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
}
.demo-banner .demo-dismiss:hover { opacity: 1; }

/* Pulse Check IQ splash (welcome modal for setup, also for connect sheet) */
.pc-splash {
  position: fixed;
  inset: 0;
  background: oklch(0.1 0.02 250 / 0.72);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.pc-splash-card {
  background: white;
  border-radius: 24px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.3);
  display: grid;
  grid-template-columns: 280px 1fr;
  animation: tourpop .25s ease;
}
.pc-splash-card.solo { grid-template-columns: 1fr; }
.pc-splash-side {
  background: var(--pc-gradient);
  color: white;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border-radius: 24px 0 0 24px;
}
.pc-splash-logo {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  display: inline-block;
  width: max-content;
}
.pc-splash-logo img {
  display: block;
  height: 28px;
  width: auto;
}
.pc-splash-content {
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pc-splash-content h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--pc-navy);
  line-height: 1.1;
}
.pc-splash-content p {
  font-size: 14.5px;
  line-height: 1.55;
  color: oklch(0.35 0.02 250);
  margin: 0;
}
.pc-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: oklch(0.25 0.02 250);
}
.pc-feature-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--pc-blue);
  width: 14px;
  height: 14px;
}
.pc-cta-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.pc-btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .1s, filter .1s;
}
.pc-btn-primary {
  background: var(--pc-navy);
  color: white;
}
.pc-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.15); }
.pc-btn-secondary {
  background: oklch(0.96 0.005 250);
  color: var(--pc-navy);
  border: 1px solid oklch(0.88 0.005 250);
}
.pc-btn-secondary:hover { background: oklch(0.93 0.005 250); }
.pc-btn-gradient {
  background: var(--pc-gradient);
  color: white;
}
.pc-btn-gradient:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* Powered-by footer */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 4px 8px;
}
.powered-by img { height: 14px; opacity: 0.7; }

/* Connect Sheet step list */
.cs-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  margin-bottom: 10px;
}
.cs-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--pc-gradient);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.cs-step.done .cs-step-num { background: var(--good); }
.cs-step-body { min-width: 0; }
.cs-step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--ink-strong); }
.cs-step-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.cs-step-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast (top-right) */
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  background: var(--ink-strong);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 360px;
  animation: tourpop .25s ease;
}
.toast.good { background: var(--good); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
