:root {
  /* v4 design tokens — warmer cream-tinted palette via oklch */
  --bg:         oklch(0.984 0.006 90);
  --bg-2:       oklch(0.974 0.008 85);
  --surface:    #ffffff;
  --surface-2:  oklch(0.978 0.006 90);
  --line:       oklch(0.918 0.011 85);
  --line-2:     oklch(0.880 0.014 85);
  --ink:        oklch(0.205 0.020 250);
  --ink-2:      oklch(0.395 0.018 250);
  --ink-3:      oklch(0.555 0.014 250);
  --ink-4:      oklch(0.700 0.010 250);

  /* Primary — slightly warmer indigo */
  --primary:       oklch(0.52 0.155 268);
  --primary-ink:   oklch(0.42 0.165 268);
  --primary-hover: oklch(0.46 0.160 268);
  --primary-soft:  oklch(0.962 0.030 268);
  --primary-line:  oklch(0.880 0.060 268);

  /* Owner-role accent — muted indigo for executive feel */
  --owner:         oklch(0.35 0.07 260);
  --owner-ink:     oklch(0.28 0.06 260);
  --owner-soft:    oklch(0.955 0.015 260);
  --owner-line:    oklch(0.870 0.020 260);

  /* Accent palette — semantic */
  --rose-soft:    oklch(0.955 0.030 22);
  --rose-ink:     oklch(0.555 0.180 22);
  --amber-soft:   oklch(0.962 0.045 80);
  --amber-ink:    oklch(0.595 0.140 75);
  --sky-soft:     oklch(0.960 0.038 230);
  --sky-ink:      oklch(0.535 0.140 230);
  --emerald-soft: oklch(0.960 0.034 165);
  --emerald-ink:  oklch(0.510 0.118 165);
  --violet-soft:  oklch(0.958 0.030 290);
  --violet-ink:   oklch(0.530 0.158 290);
  --indigo-soft:  oklch(0.958 0.030 268);
  --indigo-ink:   oklch(0.495 0.155 268);

  /* Shadows */
  --sh-1: 0 1px 2px rgba(28,25,40,0.04), 0 1px 3px rgba(28,25,40,0.025);
  --sh-2: 0 1px 2px rgba(28,25,40,0.04), 0 8px 24px -10px rgba(28,25,40,0.08);
  --sh-3: 0 2px 4px rgba(28,25,40,0.04), 0 18px 44px -14px rgba(28,25,40,0.10);

  /* Typography */
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-num: "JetBrains Mono", "Roboto Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Row states */
  --row-hover:    oklch(0.974 0.008 85);
  --row-selected: oklch(0.960 0.022 82);
  --row-selected-line: oklch(0.875 0.030 82);
  --warm-selected: oklch(0.960 0.022 82);
  --warm-selected-ink: oklch(0.390 0.055 72);
  --warm-selected-line: oklch(0.790 0.080 78);

  /* Legacy aliases — map old token names onto v4 palette so existing rules keep working */
  --surface-soft: var(--bg-2);
  --border: var(--line);
  --border-strong: var(--line-2);
  --text: var(--ink);
  --muted: var(--ink-3);
  --selected: var(--warm-selected);
  --red: var(--rose-ink);
  --red-soft: var(--rose-soft);
  --yellow: var(--amber-ink);
  --yellow-soft: var(--amber-soft);
  --blue: var(--sky-ink);
  --blue-soft: var(--sky-soft);
  --green: var(--emerald-ink);
  --green-soft: var(--emerald-soft);
  --purple: var(--violet-ink);
  --purple-soft: var(--violet-soft);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
.mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}
button { font-family: inherit; font-size: inherit; }

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.app-hidden {
  display: none;
}
.app.auth-locked {
  display: block;
}
.app.auth-locked .sidebar,
.app.auth-locked .topbar {
  display: none;
}
.app.auth-locked .main {
  min-height: 100vh;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background:
    linear-gradient(180deg, oklch(0.992 0.006 90), var(--bg));
  color: var(--ink);
}
.boot-screen.is-hidden {
  display: none;
}
.boot-mark {
  width: 76px;
  height: 54px;
  position: relative;
  margin-bottom: 4px;
}
.boot-shape {
  position: absolute;
  display: block;
  border: 2px solid var(--primary);
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.boot-shape-square {
  width: 28px;
  height: 28px;
  left: 4px;
  top: 14px;
  border-radius: 8px;
  animation: bootFloatA 1.45s ease-in-out infinite;
}
.boot-shape-diamond {
  width: 24px;
  height: 24px;
  left: 27px;
  top: 5px;
  border-radius: 7px;
  transform: rotate(45deg);
  border-color: var(--emerald-ink);
  animation: bootFloatB 1.45s ease-in-out infinite;
}
.boot-shape-bar {
  width: 34px;
  height: 12px;
  right: 2px;
  bottom: 10px;
  border-radius: 8px;
  border-color: var(--amber-ink);
  animation: bootFloatC 1.45s ease-in-out infinite;
}
.boot-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}
.boot-subtitle {
  color: var(--ink-3);
  font-size: 13px;
}
@keyframes bootFloatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes bootFloatB {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}
@keyframes bootFloatC {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

/* ====== SIDEBAR ====== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(145deg, var(--primary) 0%, oklch(0.45 0.175 275) 100%);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 2px 6px -2px oklch(0.45 0.175 275 / 0.5);
  transition: background 0.3s, box-shadow 0.3s;
}
.app[data-role="owner"] .brand-mark {
  background: linear-gradient(145deg, var(--owner) 0%, oklch(0.22 0.05 260) 100%);
  box-shadow: 0 2px 6px -2px oklch(0.28 0.06 260 / 0.5);
}
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em; }
.brand-role-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
  text-align: left;
  border: 0; background: transparent;
  width: 100%;
  font-family: inherit;
  user-select: none;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.active {
  background: var(--warm-selected);
  color: var(--warm-selected-ink);
  font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--warm-selected-line);
}
.app[data-role="owner"] .nav-item.active {
  background: var(--warm-selected);
  color: var(--warm-selected-ink);
}
.app[data-role="owner"] .nav-item.active::before { background: var(--warm-selected-line); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; opacity: 0.75; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; }
.nav-count {
  margin-left: auto;
  font-size: 11.5px; font-weight: 600;
  background: var(--bg-2); color: var(--ink-3);
  padding: 2px 7px; border-radius: 20px;
  min-width: 20px; text-align: center;
}
.nav-item.active .nav-count { background: #fff; color: var(--warm-selected-ink); }
.app[data-role="owner"] .nav-item.active .nav-count { color: var(--warm-selected-ink); }

.sidebar-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 0;
  padding: 0;
}
.sidebar-update {
  font-size: 12px; color: var(--ink-3);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  border-radius: 10px;
  background: var(--bg-2);
}
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald-ink);
  box-shadow: 0 0 0 3px oklch(0.500 0.115 165 / 0.18);
  flex-shrink: 0;
}
.sync-row { display: flex; align-items: center; gap: 8px; }
.sync-strong { font-weight: 600; color: var(--ink-2); display: block; }
#sync-refresh-icon { cursor: pointer; border-radius: 6px; }
#sync-refresh-icon:hover { color: var(--ink); background: var(--surface); }
.help-card {
  padding: 14px; border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  cursor: pointer;
}
.app[data-role="owner"] .help-card {
  background: var(--owner-soft);
  border-color: var(--owner-line);
}
.help-card-title {
  font-size: 12.5px; font-weight: 600;
  color: var(--primary-ink);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.app[data-role="owner"] .help-card-title { color: var(--owner-ink); }
.help-card-sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

.auth-content {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--sh-2);
}
.auth-brand {
  font-weight: 800;
  color: var(--primary-ink);
  margin-bottom: 12px;
}
.auth-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}
.auth-sub {
  color: var(--ink-3);
  margin: 8px 0 18px;
}
.auth-input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  margin-bottom: 10px;
  background: var(--surface);
}
.auth-input:focus {
  outline: 2px solid var(--primary-line);
  border-color: var(--primary);
}
.auth-error {
  margin: 2px 0 12px;
  color: var(--rose-ink);
  font-weight: 600;
  font-size: 12.5px;
}
.auth-submit {
  width: 100%;
  justify-content: center;
}
.license-banner {
  border: 1px solid oklch(0.84 0.070 65);
  background: oklch(0.970 0.040 80);
  color: oklch(0.38 0.095 55);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.license-banner-title {
  font-weight: 800;
  margin-bottom: 2px;
}
.license-banner-text {
  color: var(--ink-2);
}
.loading-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== MAIN ====== */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: flex-end;
  padding: 22px 32px 14px;
  gap: 18px;
}
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 3px; }
.page-subtitle { color: var(--ink-3); margin-top: 0; font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.demo-role-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--surface), var(--warm-selected) 34%);
  box-shadow: var(--sh-1);
}
.demo-role-option {
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.demo-role-option.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--sh-1);
  font-family: inherit;
}
.chip:hover { border-color: var(--line-2); }
.chip svg { width: 15px; height: 15px; opacity: 0.7; }

.bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--sh-1);
}
.bell svg { width: 16px; height: 16px; color: var(--ink-2); }
.bell-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose-ink);
  box-shadow: 0 0 0 2px var(--surface);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-2);
  transition: all 0.12s;
  text-decoration: none;
}
.btn:hover { background: var(--bg-2); color: var(--ink); }
.btn svg { width: 14px; height: 14px; }
.btn-icon { padding: 8px 10px; }
.btn-compact {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 9px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 8px -2px oklch(0.45 0.155 265 / 0.35);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn-secondary:hover { background: var(--bg-2); color: var(--ink); }

.user-menu-wrap { position: relative; }
.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: var(--sh-1);
  user-select: none;
  font-family: inherit;
}
.user-menu:hover { border-color: var(--line-2); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, oklch(0.82 0.08 35), oklch(0.72 0.10 40));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.avatar-img {
  object-fit: cover;
  padding: 0;
  color: transparent;
  background: var(--surface);
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-name { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.user-role { color: var(--ink-3); font-size: 11px; }
.user-chevron { color: var(--ink-3); margin-left: 2px; display: inline-grid; place-items: center; }
.user-chevron svg { width: 14px; height: 14px; }

.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh-3);
  min-width: 260px;
  padding: 6px;
  display: none;
  z-index: 50;
}
.user-menu-wrap.open .user-pop { display: block; }
.pop-section {
  font-size: 10.5px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 12px 4px;
  font-weight: 700;
}
.pop-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-2);
  font-weight: 500;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.pop-item:hover { background: var(--bg-2); color: var(--ink); }
.pop-item svg { width: 15px; height: 15px; opacity: 0.7; flex-shrink: 0; }
.pop-item.checked, .pop-item.current {
  background: var(--warm-selected);
  color: var(--warm-selected-ink);
  font-weight: 600;
}
.pop-item.checked svg, .pop-item.current svg { opacity: 1; }
.pop-item.checked::after {
  content: "✓"; margin-left: auto; color: var(--warm-selected-ink); font-weight: 600;
}
.app[data-role="owner"] .pop-item.current { background: var(--warm-selected); color: var(--warm-selected-ink); }
.pop-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* ====== CONTENT GRID ====== */
.content {
  padding: 20px 28px 40px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  min-width: 0;
}
.content.narrow { grid-template-columns: 1fr; }
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ====== KPI ====== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.kpi-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 14px;
}
.kpi-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px;
}
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-icon.yellow { background: var(--yellow-soft); color: var(--yellow); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-num {
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1;
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px;
  background: var(--green-soft);
  color: var(--green);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-left: 10px;
  vertical-align: middle;
  font-weight: 500;
}
.kpi-delta.down { background: var(--red-soft); color: var(--red); }
.kpi-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ====== CARD ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.card-title {
  font-weight: 600; font-size: 15px;
  display: flex; align-items: center; gap: 10px;
}
.muted-count { color: var(--muted); font-weight: 400; font-size: 13px; }
.tabs {
  display: flex; gap: 2px;
  background: #f3f4f6;
  padding: 3px;
  border-radius: var(--radius-sm);
}
.tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}
.tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* ====== QUEUE TABLE ====== */
.queue-table { width: 100%; border-collapse: collapse; }
.queue-table thead th {
  text-align: left;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted);
  padding: 12px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.queue-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}
.queue-table tbody tr { cursor: pointer; }
.queue-table tbody tr:hover { background: var(--row-hover); }
.queue-table tbody tr.selected { background: var(--row-selected); }
.queue-table tbody tr.selected td { border-bottom-color: var(--row-selected-line); }
.queue-table tbody tr:last-child td { border-bottom: none; }
.deal-name { font-weight: 500; }
.deal-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.decision-cell { min-width: 150px; }
.decision-cell-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.row-actions {
  display: grid;
  gap: 6px;
  min-width: 132px;
}
.row-actions .btn {
  justify-content: center;
  width: 100%;
}
.mgr-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mgr-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.signal-cell { max-width: 200px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.pill::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.yellow { color: var(--yellow); background: var(--yellow-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.green { color: var(--green); background: var(--green-soft); }
.due-overdue { color: var(--red); font-weight: 500; }

.card-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
.process-list { display: grid; gap: 10px; padding: 16px 20px; }
.process-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-soft);
}
.process-row.clickable { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s, background 0.12s; }
.process-row.selected {
  border-color: var(--primary-line);
  background: var(--warm-selected);
  box-shadow: var(--sh-1);
}
.process-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.process-title { font-weight: 600; font-size: 13px; }
.process-desc { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
.process-count { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.drilldown-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.drilldown-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.drilldown-sub { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 4px; }
.drilldown-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.drilldown-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}
.drilldown-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}
.drilldown-stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.drilldown-stat-label { color: var(--muted); font-size: 12px; margin-top: 3px; }
.drilldown-row-actions { display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
.drilldown-muted { color: var(--muted); font-size: 12px; line-height: 1.45; }
.process-row.clickable:hover,
.drilldown-link-row:hover {
  border-color: var(--primary-line);
  box-shadow: var(--sh-1);
  transform: translateY(-1px);
}
.drilldown-link-row { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.action-journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.action-journal-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding: 2px 4px 2px 0;
}
.action-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
}
.action-detail.empty {
  min-height: 220px;
  align-content: center;
}
.action-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.action-detail-kicker {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.action-detail-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.action-detail-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}
.action-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.action-detail-actions .btn {
  justify-content: center;
}
.action-detail-grid,
.action-detail-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.action-detail-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
}
.action-detail-label {
  color: var(--muted);
}
.action-detail-value {
  color: var(--ink);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.action-detail-section-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.action-detail-task-title {
  font-size: 13px;
  font-weight: 700;
}
.action-detail-task-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 180px;
  overflow: auto;
}
.daily-loop {
  padding: 18px 20px;
  display: grid;
  gap: 16px;
}
.daily-loop-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.daily-loop-title { font-weight: 700; font-size: 16px; }
.daily-loop-sub { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 4px; }
.loop-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.loop-badge.stable { color: var(--green); background: var(--green-soft); }
.loop-badge.tight { color: var(--yellow); background: var(--yellow-soft); }
.loop-badge.overloaded { color: var(--red); background: var(--red-soft); }
.loop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.loop-metric {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px;
}
.loop-metric-value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.loop-metric-label { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.loop-manager-list { display: grid; gap: 8px; }
.loop-manager-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 90px 90px;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 13px;
}
.loop-manager-name { font-weight: 650; }
.loop-manager-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.loop-num { font-weight: 700; text-align: right; }
.loop-num.red { color: var(--red); }
.loop-num.yellow { color: var(--yellow); }
.empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.error-state {
  padding: 16px 20px;
  color: var(--red);
  background: var(--red-soft);
  border-top: 1px solid rgba(220, 38, 38, 0.12);
}
.link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }

/* ====== DECISION PANEL ====== */
.decision {
  align-self: flex-start;
  position: sticky; top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.decision-head { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.decision-head-row {
  display: flex; justify-content: space-between; align-items: center;
}
.decision-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px 6px;
  font-size: 16px; line-height: 1;
}
.decision-close:hover { color: var(--text); }
.decision-title { font-size: 16px; font-weight: 600; margin: 12px 0 14px; line-height: 1.35; }
.decision-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.meta-label { font-size: 12px; color: var(--muted); }
.meta-value { font-size: 14px; font-weight: 500; margin-top: 2px; }

.decision-body { padding: 4px 0 8px; }
.decision-section { display: flex; gap: 12px; padding: 14px 20px; }
.decision-section + .decision-section { border-top: 1px solid #f0f1f4; }
.section-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0; font-size: 14px;
}
.section-icon.red { background: var(--red-soft); color: var(--red); }
.section-icon.blue { background: var(--blue-soft); color: var(--blue); }
.section-icon.purple { background: var(--purple-soft); color: var(--purple); }
.section-icon.green { background: var(--green-soft); color: var(--green); }
.section-icon.yellow { background: var(--yellow-soft); color: var(--yellow); }
.section-icon.gray { background: #f3f4f6; color: var(--muted); }
.section-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.section-text { font-size: 13px; color: #374151; line-height: 1.55; }

.decision-foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
.decision-foot .btn { justify-content: center; }

/* ====== STUB ====== */
.stub {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
}
.stub-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.stub-hint { font-size: 13px; max-width: 420px; margin: 0 auto; line-height: 1.5; }

/* ====== FILTER BAR ====== */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-input {
  flex: 1; min-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-soft);
}
.search-input:focus { outline: none; border-color: var(--primary); background: white; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fpill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  user-select: none;
}
.fpill.active {
  background: var(--selected);
  border-color: var(--warm-selected-line);
  color: var(--warm-selected-ink);
}
.fpill:hover:not(.active) { color: var(--text); }
.select {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7280' d='M5 6 0 0h10z'/></svg>") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
}

/* ====== STAT ROW ====== */
.stat-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-mini.clickable {
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.05s;
}
.stat-mini.clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.stat-mini.clickable:active { transform: scale(0.997); }
.stat-mini.active {
  border-color: var(--warm-selected-line);
  box-shadow: 0 0 0 3px var(--warm-selected);
}
.stat-mini-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.stat-mini-dot { width: 8px; height: 8px; border-radius: 50%; }
.stat-mini-dot.red { background: var(--red); }
.stat-mini-dot.yellow { background: var(--yellow); }
.stat-mini-dot.blue { background: var(--blue); }
.stat-mini-dot.green { background: var(--green); }
.stat-mini-dot.gray { background: var(--muted); }
.stat-mini-num { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.stat-mini-foot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.info-icon {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--muted);
  font-size: 10px; font-weight: 600;
  margin-left: 4px;
  cursor: help;
  vertical-align: middle;
}
.info-icon:hover { background: var(--muted); color: white; }

/* ====== FUNNEL PAGE ====== */
.funnel-totals {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.funnel-total {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.funnel-total-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.funnel-total-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.funnel-total-foot { font-size: 12px; color: var(--muted); margin-top: 8px; }

.stage-list {
  display: flex; flex-direction: column; gap: 10px;
}
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.stage-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.stage-name { font-weight: 600; font-size: 15px; }
.stage-meta { color: var(--muted); font-size: 12px; }
.stage-meta strong { color: var(--text); font-weight: 500; }
.dist-bar {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: #f3f4f6;
  margin-bottom: 10px;
}
.dist-seg { height: 100%; }
.dist-seg.red { background: var(--red); }
.dist-seg.yellow { background: var(--yellow); }
.dist-seg.blue { background: var(--blue); }
.dist-seg.green { background: var(--green); }
.stage-counts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; }
.stage-card.clickable, .mgr-card.clickable {
  cursor: pointer;
  transition: border-color 0.12s, transform 0.05s;
}
.stage-card.clickable:hover, .mgr-card.clickable:hover {
  border-color: var(--primary);
}
.stage-card.clickable:active, .mgr-card.clickable:active { transform: scale(0.997); }
.stage-count { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stage-count strong { color: var(--text); font-weight: 600; font-size: 13px; }

/* ====== TEAM PAGE ====== */
.team-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.team-summary-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.team-summary-title { font-size: 15px; font-weight: 600; }
.team-summary-meta { color: var(--muted); font-size: 13px; }
.team-call-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.team-call-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.team-call-panel-title { font-size: 15px; font-weight: 600; }
.team-call-panel-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.team-call-panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.team-call-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.team-call-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px 14px;
  min-width: 0;
}
.team-call-kpi.good {
  border-color: rgba(5, 150, 105, 0.18);
  background: var(--green-soft);
}
.team-call-kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.team-call-kpi-value {
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
.team-call-kpi-detail {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.team-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.mgr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.mgr-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.mgr-card-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.mgr-card-avatar.avatar-img {
  display: block;
  object-fit: cover;
}
.mgr-card-name { font-weight: 600; font-size: 14px; }
.mgr-card-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.mgr-score {
  margin-left: auto;
  text-align: right;
}
.mgr-score-num { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.mgr-score-label { font-size: 11px; color: var(--muted); }
.mgr-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mgr-metric-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.mgr-metric-value { font-size: 13px; font-weight: 500; }
.mgr-metric-value.bad { color: var(--red); }
.mgr-metric-value.good { color: var(--green); }
.mgr-call-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.mgr-call-box {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 10px 11px;
}
.mgr-call-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mgr-call-value {
  margin-top: 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}
.mgr-call-note {
  min-height: 30px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.mgr-call-foot {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .team-call-kpis,
  .team-grid,
  .mgr-call-strip {
    grid-template-columns: 1fr;
  }
  .team-call-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ====== RAW SIGNALS PAGE ====== */
.raw-funnel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.raw-funnel-title { font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.funnel-steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; }
.funnel-step {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.funnel-step.primary { background: var(--selected); border-color: rgba(37,99,235,0.25); }
.funnel-step.danger { background: var(--red-soft); border-color: rgba(220,38,38,0.18); }
.fstep-num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.fstep-label { font-size: 12px; color: var(--muted); margin-top: 8px; }
.fstep-conv { font-size: 11px; color: var(--muted); margin-top: 4px; }
.funnel-arrow {
  display: flex; flex-direction: column; align-items: center;
  color: var(--muted);
}
.funnel-arrow-pct { font-size: 12px; font-weight: 600; color: var(--text); }
.funnel-arrow-svg { font-size: 18px; line-height: 1; }

.rules-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rule-row { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: none; }
.rule-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.rule-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text);
  background: #f3f4f6;
  padding: 2px 8px; border-radius: 6px;
}
.rule-desc { color: var(--muted); font-size: 12px; margin-top: 6px; margin-bottom: 12px; }
.rule-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #f3f4f6; margin-bottom: 8px; }
.rule-bar-seg.verified { background: var(--red); }
.rule-bar-seg.selected { background: var(--blue); }
.rule-bar-seg.filtered { background: #d1d5db; }
.rule-counts { display: flex; gap: 18px; font-size: 12px; }
.rule-count { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.rule-count strong { color: var(--text); font-weight: 600; }

/* ====== OWNER ====== */
.kpi-strip-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.kpi-bignum {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.kpi-bignum-label { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.kpi-bignum-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.kpi-bignum-value.red { color: var(--red); }
.kpi-bignum-value.green { color: var(--green); }
.kpi-bignum-foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.kpi-bignum-foot.up { color: var(--green); }

.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.intro-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.intro-text { font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 720px; }

.effect-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.effect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.effect-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px;
  margin-bottom: 12px;
}
.effect-num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.effect-label { font-size: 13px; color: var(--text); margin-top: 6px; font-weight: 500; }
.effect-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.value-center-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}
.value-grid { grid-template-columns: repeat(3, 1fr); }
.value-card.good { border-color: rgba(5, 150, 105, 0.2); background: linear-gradient(180deg, #ffffff 0%, #f8fffb 100%); }
.value-card.warn { border-color: rgba(217, 119, 6, 0.24); background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%); }
.value-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.value-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 14px 16px;
}
.value-panel-title {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}
.value-kv {
  display: grid;
  gap: 8px;
}
.value-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.value-kv strong {
  color: var(--text);
  font-weight: 650;
  text-align: right;
}
.value-warning-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.value-warning {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: var(--yellow-soft);
  color: #92400e;
  font-size: 12px;
}
.value-warning strong { font-size: 14px; color: #78350f; }
.value-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}
.value-cases-col {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 14px;
}
.value-cases-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}
.value-cases-title small {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.value-cases-list {
  display: grid;
  gap: 8px;
}
.value-case {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.value-case.clickable {
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.05s;
}
.value-case.clickable:hover,
.value-case.clickable:focus-visible {
  border-color: var(--primary-line);
  box-shadow: var(--sh-1);
  transform: translateY(-1px);
  outline: none;
}
.value-case.clickable:active { transform: translateY(0); }
.value-case.positive { border-color: rgba(5, 150, 105, 0.2); }
.value-case.attention { border-color: rgba(217, 119, 6, 0.22); }
.value-case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.value-case-title {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}
.value-case-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.value-case-effect {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}
.empty-state.compact {
  padding: 14px;
  font-size: 12px;
}
.quality-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 16px 16px 0;
}
.quality-status {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 14px 16px;
}
.quality-status.green { border-color: rgba(5, 150, 105, 0.22); background: #f8fffb; }
.quality-status.yellow { border-color: rgba(217, 119, 6, 0.24); background: #fffaf0; }
.quality-status.red { border-color: rgba(220, 38, 38, 0.22); background: #fff7f7; }
.quality-status.blue { border-color: rgba(37, 99, 235, 0.18); background: var(--blue-soft); }
.quality-status-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.quality-status-value {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}
.quality-status-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.quality-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}
.quality-metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
}
.quality-metric.go { border-color: rgba(5, 150, 105, 0.2); }
.quality-metric.warn { border-color: rgba(217, 119, 6, 0.22); }
.quality-metric.no_go { border-color: rgba(220, 38, 38, 0.22); background: #fffafa; }
.quality-metric.unknown { border-color: rgba(37, 99, 235, 0.18); }
.quality-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.quality-metric-title {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}
.quality-metric-desc {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}
.quality-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}
.quality-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}
@media (max-width: 900px) {
  .value-grid,
  .value-split,
  .value-cases-grid,
  .quality-cases-grid,
  .quality-summary,
  .quality-metrics,
  .readiness-summary,
  .readiness-counts,
  .readiness-coverage,
  .action-journal-layout {
    grid-template-columns: 1fr;
  }
  .action-detail { position: static; }
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tl-row {
  display: grid; grid-template-columns: 100px 1fr auto;
  gap: 16px; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.tl-row:last-child { border-bottom: none; }
.tl-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-deal { font-size: 13px; }
.tl-deal-name { font-weight: 500; }
.tl-deal-effect { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ====== TRUST ====== */
.trust-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.trust-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 8px;
}
.trust-name { font-size: 14px; font-weight: 600; }
.trust-status {
  font-size: 11px; font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.trust-status.good { color: var(--green); background: var(--green-soft); }
.trust-status.warn { color: var(--yellow); background: var(--yellow-soft); }
.trust-status.bad { color: var(--red); background: var(--red-soft); }
.trust-desc { font-size: 12px; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.trust-value-row {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.trust-value { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.trust-value.good { color: var(--green); }
.trust-value.warn { color: var(--yellow); }
.trust-value.bad { color: var(--red); }
.trust-target { font-size: 12px; color: var(--muted); }
.trust-target strong { color: var(--text); font-weight: 500; }
.sparkline-row { display: flex; align-items: flex-end; gap: 8px; }
.sparkline-row svg { display: block; }
.spark-label { font-size: 11px; color: var(--muted); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.chart-title { font-size: 15px; font-weight: 600; }
.chart-meta { font-size: 12px; color: var(--muted); }

/* ====== SETTINGS ====== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.settings-card-desc { font-size: 12px; color: var(--muted); line-height: 1.55; max-width: 720px; }
.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f1f4;
}
.settings-row.full { grid-template-columns: 1fr; }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; font-weight: 500; }
.settings-row-sub { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }

.toggle {
  width: 36px; height: 20px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(16px); }

.radio-group {
  display: flex; flex-direction: column; gap: 8px;
}
.radio-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface-soft);
}
.radio-option.selected {
  border-color: var(--warm-selected-line);
  background: var(--selected);
}
.radio-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  background: white;
}
.radio-option.selected .radio-dot {
  border-color: var(--warm-selected-line);
  box-shadow: inset 0 0 0 4px var(--warm-selected-line);
}
.radio-name { font-weight: 500; font-size: 13px; margin-bottom: 3px; }
.radio-sub { color: var(--muted); font-size: 12px; line-height: 1.5; }

.connection-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
}
.connection-status::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}

.readiness-card { border-color: #d7e4f7; }
.readiness-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.2fr);
  gap: 12px;
  padding: 16px 20px 12px;
}
.readiness-overall {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-soft);
}
.readiness-overall.go { background: var(--green-soft); border-color: #bbf7d0; color: #14532d; }
.readiness-overall.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.readiness-overall.no_go { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.readiness-overall.unknown { background: #f8fafc; color: #475569; }
.readiness-overall-label { font-size: 20px; font-weight: 650; letter-spacing: 0; }
.readiness-overall-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.readiness-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.readiness-count {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--surface);
  min-width: 0;
}
.readiness-count strong { display: block; font-size: 20px; line-height: 1.1; }
.readiness-count span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.readiness-count.go { border-color: #bbf7d0; }
.readiness-count.warn,
.readiness-count.unknown { border-color: #fde68a; }
.readiness-count.no_go { border-color: #fecaca; }
.readiness-coverage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 20px 16px;
}
.readiness-coverage > div {
  border: 1px solid #f0f1f4;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-soft);
}
.readiness-coverage strong { display: block; font-size: 17px; }
.readiness-coverage span { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.readiness-list {
  display: grid;
  gap: 8px;
  padding: 0 20px 16px;
}
.readiness-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--surface);
}
.readiness-row.go { border-color: #dcfce7; }
.readiness-row.warn,
.readiness-row.unknown { border-color: #fde68a; background: #fffbeb; }
.readiness-row.no_go { border-color: #fecaca; background: #fef2f2; }
.readiness-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.readiness-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.readiness-ack-btn {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}
.readiness-row-title { font-size: 13px; font-weight: 600; }
.readiness-row-sub { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.readiness-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
}
.readiness-pill.go { background: var(--green-soft); color: var(--green); }
.readiness-pill.warn { background: #fef3c7; color: #92400e; }
.readiness-pill.no_go { background: #fee2e2; color: #991b1b; }
.readiness-pill.unknown { background: #f1f5f9; color: #475569; }
.readiness-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.readiness-metrics span {
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 11.5px;
}
.readiness-verify {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: #475569;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.readiness-command {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.readiness-command-row { border-top: 1px solid #f0f1f4; }

.member-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f1f4;
}
.member-row:last-child { border-bottom: none; }
.tenant-meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.tenant-meta strong { color: var(--text); font-weight: 500; }

/* ====== DEAL CARD ====== */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
}
.back-link:hover { color: var(--text); }
.deal-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
}
.deal-page-grid.narrow { grid-template-columns: 1fr; }
.deal-col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.deal-col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.deal-meta-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.deal-meta-cell { font-size: 13px; }
.deal-meta-cell .meta-label { font-size: 11px; }
.deal-meta-cell .meta-value { font-size: 13px; font-weight: 500; }

.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 14px; padding: 10px 20px;
  font-size: 13px;
  border-bottom: 1px solid #f0f1f4;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--muted); }
.kv-val { color: var(--text); word-break: break-word; }

.struct-block {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 14px 20px;
}
.struct-row {
  border-left: 3px solid var(--blue);
  padding: 4px 0 4px 12px;
}
.struct-row.next { border-color: var(--green); }
.struct-row .meta-label { font-size: 11px; }
.struct-row .meta-value { font-size: 13px; line-height: 1.45; }

.control-focus-body {
  display: grid;
  gap: 12px;
  padding: 14px 20px 16px;
}
.control-focus-primary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px 14px;
}
.control-focus-primary.good {
  border-color: rgba(5, 150, 105, 0.22);
  background: var(--green-soft);
}
.control-focus-primary.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: var(--red-soft);
}
.control-focus-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.16);
}
.control-focus-primary.good .control-focus-icon {
  color: var(--green);
  border-color: rgba(5, 150, 105, 0.18);
}
.control-focus-primary.danger .control-focus-icon {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.18);
}
.control-focus-main { min-width: 0; }
.control-focus-label,
.control-focus-fact-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.control-focus-value {
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.control-focus-meta {
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.control-focus-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.control-focus-fact {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
}
.control-focus-fact.good { border-color: rgba(5, 150, 105, 0.18); }
.control-focus-fact.warn { border-color: rgba(217, 119, 6, 0.22); background: var(--yellow-soft); }
.control-focus-fact.danger { border-color: rgba(220, 38, 38, 0.2); background: var(--red-soft); }
.control-focus-fact-value {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.control-focus-fact-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .control-focus-facts {
    grid-template-columns: 1fr;
  }
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; }
.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #f3f4f6;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tag.red { background: var(--red-soft); color: var(--red); }

/* Timeline interventions */
.tl-card { display: flex; flex-direction: column; }
.tl-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f1f4;
}
.tl-item:last-child { border-bottom: none; }
.tl-item-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 8px;
}
.tl-item-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-item-action { font-weight: 600; font-size: 13px; }
.tl-pill {
  font-size: 11px; font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tl-pill.green { background: var(--green-soft); color: var(--green); }
.tl-pill.red { background: var(--red-soft); color: var(--red); }
.tl-pill.yellow { background: var(--yellow-soft); color: var(--yellow); }
.tl-pill.gray { background: #f3f4f6; color: var(--muted); }
.tl-states {
  display: grid; grid-template-columns: 1fr 24px 1fr;
  gap: 10px; align-items: center;
  margin: 8px 0;
}
.tl-state {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.tl-state.before { opacity: 0.7; }
.tl-state-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.tl-state-value { font-size: 12px; line-height: 1.4; }
.tl-arrow {
  text-align: center; color: var(--muted); font-size: 14px;
}
.tl-note {
  font-size: 12px; color: #374151; line-height: 1.5;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}
.call-transcript {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.call-transcript-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  list-style: none;
}
.call-transcript-summary::-webkit-details-marker { display: none; }
.call-transcript-plus {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  line-height: 1;
}
.call-transcript[open] .call-transcript-plus { font-size: 0; }
.call-transcript[open] .call-transcript-plus::before {
  content: "-";
  font-size: 13px;
}
.call-transcript-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.call-transcript-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px 38px;
}
.call-transcript-brief,
.call-transcript-text {
  font-size: 12px;
  line-height: 1.55;
  color: #374151;
}
.call-transcript-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.call-transcript-text {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.call-evidence {
  margin-top: 8px;
  border: 1px solid var(--blue-soft);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  padding: 9px 10px;
}
.call-evidence-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}
.call-evidence-confidence {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.call-evidence-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.call-evidence-item {
  display: grid;
  gap: 4px;
}
.call-evidence-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.call-evidence-text {
  color: #374151;
  font-size: 12px;
  line-height: 1.45;
}
.call-evidence-quotes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.call-evidence-quotes.global {
  margin-top: 8px;
}
.call-evidence-quotes span {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.72);
  color: #1f2937;
  font-size: 11px;
  line-height: 1.35;
}
.tl-foot {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
  margin-top: 8px;
}

.audit-list { display: flex; flex-direction: column; padding: 4px 0; }
.audit-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #f0f1f4;
}
.audit-item:first-child { border-top: none; }
.audit-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.audit-dot.success { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.audit-dot.warning { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-soft); }
.audit-dot.danger { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.audit-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.audit-title { font-size: 13px; font-weight: 650; color: var(--text); }
.audit-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.audit-desc { font-size: 12px; color: #374151; line-height: 1.5; margin-top: 4px; }
.audit-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.audit-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #475569;
  font-size: 11px;
  line-height: 1.25;
}
.audit-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
}

.deal-actions { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; }
.deal-actions .btn { justify-content: center; }
.cooldown-active-note {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(5, 150, 105, 0.18);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}
.cooldown-active-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}
.cooldown-active-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cooldown-action {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.cooldown-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.cooldown-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.cooldown-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: white;
}
.action-error {
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}
.action-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--surface-soft);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.48);
  backdrop-filter: blur(2px);
}
.modal-card {
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-subtitle { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 5px; }
.modal-close {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--muted);
}
.modal-body { display: grid; gap: 14px; padding: 18px 24px 22px; }
.form-row { display: grid; gap: 7px; }
.form-label { font-size: 12px; font-weight: 650; color: var(--text); }
.form-hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
.form-input,
.form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: white;
}
.form-textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.modal-actions .btn[disabled],
.deal-actions .btn[disabled] {
  opacity: 0.55;
  cursor: wait;
}
.modal-summary {
  border: 1px solid var(--blue-soft);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.5;
}

/* ====== KPI MINI — v4 home strip ====== */
.home-strip {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: stretch;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 13px;
  box-shadow: var(--sh-1);
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.16s, border-color 0.16s;
  position: relative;
  overflow: hidden;
  text-align: left; border: 1px solid var(--line); font-family: inherit;
}
.kpi-mini::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--kpi-accent, transparent);
}
.kpi-rose    { --kpi-accent: var(--rose-ink); }
.kpi-amber   { --kpi-accent: var(--amber-ink); }
.kpi-sky     { --kpi-accent: var(--sky-ink); }
.kpi-emerald { --kpi-accent: var(--emerald-ink); }
.kpi-mini:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.kpi-mini.active {
  border-color: var(--warm-selected-line);
  box-shadow: 0 0 0 3px var(--warm-selected), var(--sh-1);
}
.kpi-mini.active:hover {
  box-shadow: 0 0 0 3px var(--warm-selected), var(--sh-2);
}
.kpi-glyph {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 1px 0 rgba(15,23,42,0.02);
}
.kpi-glyph svg { width: 19px; height: 19px; }
.kpi-mini-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.kpi-mini-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 5px;
}
.kpi-mini-row { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.kpi-mini-val {
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--ink); line-height: 1;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.kpi-mini-delta {
  font-size: 11.5px; font-weight: 700;
  font-feature-settings: "tnum";
  display: inline-flex; align-items: center; gap: 2px;
}
.kpi-mini-delta.up   { color: var(--emerald-ink); }
.kpi-mini-delta.down { color: var(--rose-ink); }
.kpi-mini-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ====== FUNNEL MINI-CARD ====== */
.funnel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 13px;
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 10px;
}
.funnel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.funnel-title { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.32; }
.funnel-period {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  background: var(--bg-2); padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.funnel-bars { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
  display: grid;
  grid-template-columns: 100px 1fr 36px 36px;
  align-items: center; gap: 8px;
  font-size: 11.5px;
}
.funnel-row-label { color: var(--ink-2); font-weight: 500; }
.funnel-row-bar {
  height: 18px; background: var(--bg-2);
  border-radius: 5px; overflow: hidden;
}
.funnel-bar-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.5s cubic-bezier(.2,.8,.2,1);
}
.funnel-fill-ink     { background: oklch(0.78 0.012 250); }
.funnel-fill-sky     { background: var(--sky-ink); opacity: 0.85; }
.funnel-fill-rose    { background: var(--rose-ink); }
.funnel-row-val,
.funnel-row-pct {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.funnel-row-val { color: var(--ink); font-weight: 600; text-align: right; }
.funnel-row-pct { color: var(--ink-3); font-weight: 600; text-align: right; }
.funnel-row.highlight .funnel-row-label { color: var(--rose-ink); font-weight: 700; }
.funnel-row.highlight .funnel-row-val   { color: var(--rose-ink); }
.funnel-row.highlight .funnel-row-pct   { color: var(--rose-ink); }

/* ====== STATUS PILL v4 ====== */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.status-pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; background: currentColor;
}
.s-verified  { color: var(--rose-ink);    background: var(--rose-soft); }
.s-clarify   { color: var(--amber-ink);   background: var(--amber-soft); }
.s-monitored { color: var(--sky-ink);     background: var(--sky-soft); }
.s-positive  { color: var(--emerald-ink); background: var(--emerald-soft); }

/* ====== QUEUE CARD v4 ====== */
.queue-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.queue-head {
  padding: 18px 20px 14px;
  display: flex; align-items: center; gap: 10px;
}
.queue-title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
.queue-count { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.queue-segments {
  margin-left: auto; display: flex; gap: 4px;
  background: var(--bg-2); padding: 3px; border-radius: 9px;
}
.queue-seg {
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; border: 0; background: transparent; font-family: inherit;
}
.queue-seg.active {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1); font-weight: 600;
}
.queue-tbl { width: 100%; border-collapse: collapse; }
.queue-tbl thead th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 12px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.queue-tbl thead th:first-child { padding-left: 20px; }
.queue-tbl tbody tr {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
}
.queue-tbl tbody tr:hover { background: var(--row-hover); }
.queue-tbl tbody tr.selected { background: var(--row-selected); }
.queue-tbl td { padding: 13px 12px; font-size: 13px; vertical-align: middle; }
.queue-tbl td:first-child { padding-left: 20px; }
.queue-tbl td:last-child { padding-right: 20px; }
.queue-tbl tbody tr:last-child td { border-bottom: none; }
.radio-cell {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: #fff;
  flex-shrink: 0; display: block;
}
.queue-tbl tr.selected .radio-cell {
  border-color: var(--amber-ink); border-width: 5px;
}
.deal-cell { display: flex; flex-direction: column; gap: 2px; }
.deal-cell-title { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.25; }
.deal-cell-sub { font-size: 12px; color: var(--ink-3); }
.mgr-name-text { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.queue-foot {
  padding: 12px 20px;
  display: flex; align-items: center;
  font-size: 12.5px; color: var(--ink-3);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.queue-foot-link {
  margin-left: auto;
  color: var(--primary-ink); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; border: 0; background: none; font-family: inherit; font-size: 12.5px;
}
.queue-foot-link:hover { text-decoration: underline; }

/* ====== DEAL PANEL + LADDER v4 ====== */
.deal-panel {
  align-self: flex-start; position: sticky; top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; overflow: hidden;
}
.deal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.deal-head-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.deal-close {
  margin-left: auto;
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--ink-3); cursor: pointer;
  background: transparent; border: 0; padding: 0;
}
.deal-close:hover { background: var(--bg-2); }
.deal-title {
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em;
  margin: 0 0 10px; line-height: 1.3; color: var(--ink);
}
.deal-meta { display: flex; gap: 20px; font-size: 12px; color: var(--ink-3); }
.deal-meta-item { display: flex; flex-direction: column; gap: 1px; }
.deal-meta-lbl { font-size: 11px; }
.deal-meta-val {
  font-size: 15px; color: var(--ink); font-weight: 800;
  letter-spacing: -0.035em;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.deal-ladder {
  padding: 6px 20px 20px;
  display: flex; flex-direction: column;
  overflow-y: auto; max-height: calc(100vh - 280px);
}
.ladder-step {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.ladder-step:last-child { border-bottom: none; }
.ladder-glyph {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.ladder-glyph svg { width: 17px; height: 17px; }
.ladder-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ladder-title { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em; }
.ladder-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.deal-foot {
  padding: 16px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.audit-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--sh-1);
}
.audit-summary-card.good { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 18%, var(--line)); }
.audit-summary-card.warn { background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow) 20%, var(--line)); }
.audit-summary-card.bad { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 18%, var(--line)); }
.audit-summary-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
}
.audit-summary-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.audit-summary-detail {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
}
.action-audit-table th:nth-child(1) { width: 122px; }
.action-audit-table th:nth-child(6) { width: 118px; }
.action-audit-table th:nth-child(7) { width: 128px; text-align: right; }
.action-audit-table td:nth-child(7) { text-align: right; }
.owner-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.owner-kv-list {
  padding: 16px 20px;
}
.owner-kv-list > div {
  align-items: flex-start;
  gap: 12px;
}
.owner-kv-list small {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 11.5px;
}
.owner-effect-grid {
  padding: 16px;
}
.owner-tech-details {
  padding: 0 16px 16px;
}
.pill.bad { color: var(--red); background: var(--red-soft); }
.pill.warn { color: var(--yellow); background: var(--yellow-soft); }
.pill.good { color: var(--green); background: var(--green-soft); }

@media (max-width: 1100px) {
  .audit-summary-grid,
  .owner-two-col {
    grid-template-columns: 1fr;
  }
}
