/* vc_agent internal dashboard — minimal, functional */

:root {
  --bg:        #0f1117;
  --bg2:       #1a1d27;
  --bg3:       #22263a;
  --border:    #2e3350;
  --text:      #e2e8f0;
  --muted:     #6b7a99;
  --accent:    #4f8ef7;
  --green:     #34d399;
  --yellow:    #fbbf24;
  --red:       #f87171;
  --orange:    #fb923c;
  --purple:    #a78bfa;
  --radius:    6px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:      "JetBrains Mono", "Fira Code", "Courier New", monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg3);
}

/* Main */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.header-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; display: block; margin-bottom: 4px; }
.back-link:hover { color: var(--text); }

/* Section */
.section { margin-bottom: 36px; }
.section h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card.stat-pending { border-color: var(--yellow); }
.stat-number { font-size: 36px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); margin-top: 4px; font-size: 13px; }
.stat-link { color: var(--accent); text-decoration: none; font-size: 12px; display: block; margin-top: 8px; }

/* Decision grid */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.decision-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.decision-card.decision-advance { border-color: var(--green); }
.decision-card.decision-hold    { border-color: var(--yellow); }
.decision-card.decision-reject  { border-color: var(--red); }

/* Action row */
.action-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg3);
  color: var(--muted);
}
.badge-draft    { background: #1e2a3a; color: var(--muted); }
.badge-pending  { background: #2d2510; color: var(--yellow); }
.badge-decided  { background: #0f2318; color: var(--green); }

.badge-rec-advance          { background: #0f2318; color: var(--green); }
.badge-rec-hold             { background: #2d2510; color: var(--yellow); }
.badge-rec-reject           { background: #2d1010; color: var(--red); }
.badge-rec-request-more-info { background: #1a1a2e; color: var(--purple); }

.badge-decision-advance          { background: #0f2318; color: var(--green); }
.badge-decision-hold             { background: #2d2510; color: var(--yellow); }
.badge-decision-reject           { background: #2d1010; color: var(--red); }
.badge-decision-request-more-info { background: #1a1a2e; color: var(--purple); }

.badge-thesis-high   { background: #0f2318; color: var(--green); }
.badge-thesis-medium { background: #2d2510; color: var(--yellow); }
.badge-thesis-low    { background: #2d1010; color: var(--red); }

.badge-draft-type-intro-request     { background: #1a1a2e; color: var(--purple); }
.badge-draft-type-direct-outreach   { background: #1e2a3a; color: var(--accent); }
.badge-draft-type-forwardable-blurb { background: #1e2a1e; color: var(--green); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
}
.alert-success { background: #0f2318; border: 1px solid var(--green); color: var(--green); }
.alert-error   { background: #2d1010; border: 1px solid var(--red); color: var(--red); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm        { padding: 4px 10px; font-size: 12px; }

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg3); }
.row-decided td { color: var(--muted); }
.row-overdue td { background: rgba(248, 113, 113, 0.04); }
.crm-overdue { color: var(--red) !important; font-weight: 600; }

/* Empty state */
.empty-state {
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
.empty-state a { color: var(--accent); }

/* Decision panel */
.decision-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}
.decision-panel h2 { font-size: 14px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.decision-panel.decided { border-left-color: var(--green); color: var(--green); }
.form-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-group-notes { flex: 1; min-width: 200px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.radio-btn input { display: none; }
.radio-btn:hover { border-color: var(--accent); color: var(--accent); }
.radio-advance:has(input:checked)          { background: #0f2318; border-color: var(--green); color: var(--green); }
.radio-hold:has(input:checked)             { background: #2d2510; border-color: var(--yellow); color: var(--yellow); }
.radio-reject:has(input:checked)           { background: #2d1010; border-color: var(--red); color: var(--red); }
.radio-request-more-info:has(input:checked) { background: #1a1a2e; border-color: var(--purple); color: var(--purple); }
.input-notes {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  width: 100%;
}
.input-notes:focus { outline: none; border-color: var(--accent); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Doc body (rendered markdown) */
.doc-body {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  line-height: 1.7;
}
.doc-body h1 { font-size: 20px; margin: 0 0 16px; }
.doc-body h2 { font-size: 16px; margin: 24px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.doc-body h3 { font-size: 14px; margin: 16px 0 8px; }
.doc-body p  { margin: 8px 0; }
.doc-body li { margin: 4px 0 4px 20px; }
.doc-body code { background: var(--bg3); padding: 2px 6px; border-radius: 3px; font-family: var(--mono); font-size: 12px; }
.doc-body pre { background: var(--bg3); padding: 16px; border-radius: var(--radius); overflow-x: auto; font-family: var(--mono); font-size: 12px; margin: 12px 0; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc-body th, .doc-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.doc-body th { background: var(--bg3); color: var(--muted); font-size: 12px; }
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.doc-body strong { color: var(--text); }

/* Profile grid */
.profile-grid {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-key {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  background: var(--bg3);
  border-right: 1px solid var(--border);
}
.profile-value { padding: 10px 14px; word-break: break-word; }
.list-item { padding: 2px 0; }
.list-item::before { content: "• "; color: var(--muted); }

/* Raw record */
.raw-record {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* Networking split layout */
.split-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
.draft-list {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.draft-item {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.draft-item:last-child { border-bottom: none; }
.draft-item:hover, .draft-item.active { background: var(--bg3); }
.draft-name { font-weight: 600; margin-bottom: 6px; }
.draft-meta { display: flex; gap: 8px; align-items: center; }
.draft-detail { }
.draft-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.draft-header h2 { font-size: 18px; }
.draft-notice {
  margin-top: 16px;
  padding: 12px 16px;
  background: #2d2510;
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  color: var(--yellow);
  font-size: 13px;
}

/* Run pipeline */
.run-form { max-width: 600px; }
.input-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
  margin-bottom: 16px;
}
.run-output {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.run-output.error { border-color: var(--red); color: var(--red); }

/* Utilities */
.muted  { color: var(--muted); }
.small  { font-size: 12px; }
code    { background: var(--bg3); padding: 2px 6px; border-radius: 3px; font-family: var(--mono); font-size: 12px; }

/* Level 3: stat-failed card */
.stat-card.stat-failed { border-color: var(--red); }

/* Level 3: classification label badges */
.label-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.label-pitch_candidate  { background: #0f2318; color: var(--green); }
.label-follow_up        { background: #1e2a3a; color: var(--accent); }
.label-newsletter       { background: #1a1a2e; color: var(--purple); }
.label-investor_update  { background: #2d2510; color: var(--yellow); }
.label-irrelevant       { background: #2d1010; color: var(--red); }
.label-unknown          { background: var(--bg3); color: var(--muted); }

/* ── Dashboard control panel ─────────────────────────────────────────────── */

/* Page sub-header */
.page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Stat grid 4-column */
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid-4 { grid-template-columns: 1fr; } }

.stat-sub  { color: var(--muted); font-size: 11px; margin-top: 2px; }
.stat-card.stat-blocked { border-color: var(--red); }

/* Scheduler control panel */
.control-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scheduler-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.scheduler-status-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scheduler-meta  { font-size: 13px; color: var(--muted); }
.scheduler-time  { color: var(--text); font-family: var(--mono); font-size: 12px; }
.scheduler-toggle { flex-shrink: 0; }
.scheduler-error {
  font-size: 12px;
  color: var(--yellow);
  background: #2d2510;
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.scheduler-interval-row { border-top: 1px solid var(--border); padding-top: 14px; }
.interval-form  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.interval-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.input-select-inline {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 5px 10px;
  font-size: 13px;
  width: auto;
}

/* Scheduler badges */
.badge-active   { background: #0f2318; color: var(--green); }
.badge-enabled  { background: #1e2a3a; color: var(--accent); }
.badge-disabled { background: var(--bg3); color: var(--muted); }

/* Action grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  width: 100%;
  text-align: left;
  gap: 2px;
  height: auto;
}
.action-icon  { font-size: 18px; margin-bottom: 4px; }
.action-label { font-size: 13px; font-weight: 600; }
.action-sub   { font-size: 11px; color: var(--muted); font-weight: 400; }
.btn-primary .action-sub  { color: rgba(255,255,255,0.65); }
.btn-secondary .action-sub { color: var(--muted); }
.btn-ghost .action-sub    { color: var(--muted); }

/* Queue panel */
.queue-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.queue-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.queue-stat { text-align: center; min-width: 56px; }
.queue-stat-number { font-size: 28px; font-weight: 700; line-height: 1; }
.queue-stat-label  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.queue-stat-advance .queue-stat-number { color: var(--green); }
.queue-stat-hold    .queue-stat-number { color: var(--yellow); }
.queue-stat-reject  .queue-stat-number { color: var(--red); }
.queue-divider { width: 1px; height: 40px; background: var(--border); }
.queue-cta { position: relative; white-space: nowrap; }
.queue-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Pipeline flow */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  flex-wrap: wrap;
  gap: 4px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  min-width: 100px;
  background: var(--bg3);
}
.flow-step.flow-blocked { background: #2d1010; border: 1px solid var(--red); }
.flow-step.flow-pending { background: #2d2510; border: 1px solid var(--yellow); }
.flow-count { font-size: 32px; font-weight: 700; line-height: 1; }
.flow-name  { font-size: 13px; font-weight: 600; margin-top: 4px; }
.flow-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.flow-connector { font-size: 20px; color: var(--muted); padding: 0 4px; flex-shrink: 0; }

/* Last run card */
.last-run-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.last-run-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg3);
  color: var(--muted);
}
.run-pill-success { background: #0f2318; color: var(--green); }
.run-pill-partial { background: #2d2510; color: var(--yellow); }
.run-pill-failed  { background: #2d1010; color: var(--red); }
.run-gate-note    { font-size: 12px; color: var(--yellow); }

/* ── Outputs memo layout ─────────────────────────────────────────────────── */

.memo-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.memo-section-label {
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.memo-toggle-icon { font-size: 13px; transition: transform 0.15s; }
.memo-expanded .memo-toggle-icon { transform: rotate(90deg); }
.memo-collapsible { display: none; }
.memo-expanded .memo-collapsible { display: block; }

.memo-body { padding: 18px; }
.memo-prose { line-height: 1.7; }

.memo-field-grid { display: flex; flex-direction: column; gap: 10px; }
.memo-field { display: flex; gap: 16px; align-items: baseline; }
.memo-field-key {
  flex-shrink: 0;
  width: 140px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.memo-field-val { flex: 1; }

.memo-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.memo-list li { padding-left: 14px; position: relative; line-height: 1.5; }
.memo-list li::before { content: "·"; position: absolute; left: 0; color: var(--muted); }
.memo-list-risk li::before { content: "⚠"; font-size: 10px; top: 2px; }

.memo-signals { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .memo-signals { grid-template-columns: 1fr; } }
.memo-signals-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.memo-signals-pro { color: var(--green); }
.memo-signals-con { color: var(--red); }

.memo-fit-row { margin-bottom: 10px; }
.memo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.memo-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
}

.memo-section-rec { border-color: var(--accent); }
.memo-rec-row { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.memo-rec-badge { font-size: 13px; padding: 4px 14px; }
.memo-rec-rationale { margin: 0; flex: 1; min-width: 200px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ── Outputs list extras ──────────────────────────────────────────────────── */

.badge-memo-ready       { background: #1e2a3a; color: var(--accent); }
.badge-blocked          { background: #2d1010; color: var(--red); }
.badge-draft-memo       { background: #2d2510; color: var(--yellow); }
.badge-memo-type-final  { background: #1e2a3a; color: var(--accent); }
.badge-thesis-incomplete            { background: var(--bg3); color: var(--muted); }
.badge-thesis-incomplete-confidence { background: var(--bg3); color: var(--muted); }
.badge-thesis-strong                { background: #0f2318; color: var(--green); }
.badge-thesis-moderate              { background: #2d2510; color: var(--yellow); }
.badge-thesis-weak                  { background: #2d1010; color: var(--red); }
/* Part 5: new classification labels */
.badge-thesis-on-thesis             { background: #0f2318; color: var(--green); }
.badge-thesis-borderline            { background: #2d2510; color: var(--yellow); }
.badge-thesis-off-thesis            { background: #2d1010; color: var(--red); }
.thesis-not-scored                  { color: var(--muted); font-size: 12px; }
.row-draft td           { color: var(--muted); }

.row-blocked td { color: var(--muted); }

.outputs-legend {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}
.legend-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Blocked intake preview ───────────────────────────────────────────────── */

/* Draft memo banner */
.draft-memo-banner {
  background: #2d2510;
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.draft-memo-banner-title {
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 6px;
  font-size: 14px;
}
.draft-memo-banner p { color: var(--muted); font-size: 13px; margin: 0; }

/* Draft memo subsection (within memo-body) */
.draft-memo-subsection { margin-bottom: 18px; }
.draft-memo-subsection:last-child { margin-bottom: 0; }
.draft-memo-subsection-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.draft-memo-subsection p { margin: 0; line-height: 1.7; }

/* Next action table */
.next-action-table { width: 100%; border-collapse: collapse; }
.next-action-table tr + tr td { border-top: 1px solid var(--border); }
.next-action-field {
  padding: 9px 14px 9px 0;
  width: 160px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: top;
  white-space: nowrap;
}
.next-action-text {
  padding: 9px 0;
  font-size: 13px;
  line-height: 1.5;
  vertical-align: top;
}

/* Unknown value placeholder */
.unknown-val { color: var(--muted); font-style: italic; font-size: 13px; }

/* Status — need more info section accent */
.memo-section-status-needed { border-color: var(--yellow); }

.blocked-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #2d1010;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.6;
}
.blocked-notice-icon { font-size: 20px; flex-shrink: 0; color: var(--red); padding-top: 1px; }
.blocked-notice p    { color: var(--muted); font-size: 13px; margin-top: 6px; }
.blocked-fields      { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.blocked-field-tag {
  background: #1a0808;
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--red);
}

.stub-preview {
  background: var(--bg3);
  padding: 20px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
}

.blocked-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ── Networking CRM badges ───────────────────────────────────────────────── */

/* Status badges */
.badge-crm-new               { background: var(--bg3); color: var(--muted); }
.badge-crm-researching        { background: #1e2a3a; color: var(--accent); }
.badge-crm-path-found         { background: #1a1a2e; color: var(--purple); }
.badge-crm-intro-requested    { background: #2d2510; color: var(--yellow); }
.badge-crm-intro-made         { background: #2a1a10; color: var(--orange); }
.badge-crm-contacted          { background: #1e2a3a; color: var(--accent); }
.badge-crm-replied            { background: #0f2318; color: var(--green); }
.badge-crm-meeting-scheduled  { background: #0f2318; color: var(--green); }
.badge-crm-inactive           { background: var(--bg3); color: var(--muted); }
.badge-crm-closed             { background: #1a1010; color: var(--muted); }

/* Priority badges */
.badge-priority-strategic { background: #1a0d2e; color: #c084fc; border: 1px solid #9333ea; }
.badge-priority-high   { background: #2d1010; color: var(--red); }
.badge-priority-medium { background: #2d2510; color: var(--yellow); }
.badge-priority-low    { background: var(--bg3); color: var(--muted); }

/* Next-action badges */
.badge-action-request-intro   { background: #1a1a2e; color: var(--purple); }
.badge-action-send-email      { background: #1e2a3a; color: var(--accent); }
.badge-action-send-linkedin   { background: #1e2a3a; color: var(--accent); }
.badge-action-research-contact { background: var(--bg3); color: var(--muted); }

/* Path strength badges */
.badge-path-strong { background: #0f2318; color: var(--green); }
.badge-path-medium { background: #2d2510; color: var(--yellow); }
.badge-path-weak   { background: var(--bg3); color: var(--muted); }

/* Level 3: intake status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg3);
  color: var(--muted);
}
.status-ingested              { background: #1e2a3a; color: var(--accent); }
.status-handoff-created       { background: #2d2510; color: var(--yellow); }
/* Legacy status — kept for backward compat display of old records */
.status-blocked-incomplete    { background: #2d2510; color: var(--yellow); }
.status-ready-for-screening   { background: #0f2318; color: var(--green); }
/* New processing statuses */
.status-processed             { background: #0f2318; color: var(--green); }
.status-processed-incomplete  { background: #2d2510; color: var(--yellow); }
.status-screened              { background: #0f2318; color: var(--green); }
.status-failed                { background: #2d1010; color: var(--red); }
.status-screened              { background: #0f2318; color: var(--green); }

/* ============================================================
   NEW: Fundraising + POC + Calendar + Toast (v2 platform)
   ============================================================ */

/* Thermometer visualization */
.thermometer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.thermometer-tube {
  width: 28px;
  height: 160px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 14px 14px 0 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.thermometer-fill {
  width: 100%;
  background: linear-gradient(to top, var(--green), #6ee7b7);
  border-radius: 0;
  min-height: 0;
  transition: height 0.6s ease;
}
.thermometer-bulb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--border);
  margin-top: -2px;
}

/* Fundraising metric cards */
.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.metric-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

/* Commitment type badges */
.badge-commitment-verbal      { background: #2d1010; color: var(--red); }
.badge-commitment-soft-circle { background: #2d2510; color: var(--yellow); }
.badge-commitment-signed      { background: #0f2318; color: var(--green); }
.badge-commitment-wired       { background: #1e2a3a; color: #60a5fa; }

/* Action buttons in networking table */
.action-direct-email:not([disabled]) { color: var(--accent); }
.action-intro-request:not([disabled]) { color: var(--purple); }
button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Status dots for calendar page */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.status-dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* Card utility */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
  max-width: 360px;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); background: #0f2318; }
.toast-error   { border-color: var(--red);   color: var(--red);   background: #2d1010; }
.toast-warning { border-color: var(--yellow);color: var(--yellow);background: #2d2510; }

/* Page sub-header text */
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Weekly calendar grid */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.cal-grid-wrap { overflow-x: auto; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-width: 700px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-col {
  border-right: 1px solid var(--border);
  min-height: 100px;
}
.cal-col:last-child { border-right: none; }
.cal-col.cal-today { background: rgba(79, 142, 247, 0.05); }
.cal-day-header {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--bg3);
}
.cal-day-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.cal-day-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.cal-today .cal-day-num {
  color: var(--accent);
}
.cal-day-body {
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-event {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.35;
}
.cal-event-title {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 2px;
}
.cal-event-time {
  color: var(--muted);
  font-size: 10px;
}
.cal-event-link {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 10px;
  text-decoration: none;
}
.cal-event-link:hover { text-decoration: underline; }
.cal-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Monthly calendar grid */
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-width: 700px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-month-dow {
  background: var(--bg3);
  padding: 7px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.cal-month-dow:last-child { border-right: none; }
.cal-cell {
  min-height: 110px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-muted { background: var(--bg2); }
.cal-cell-muted .cal-cell-num { color: var(--muted); }
.cal-cell.cal-today { background: rgba(79, 142, 247, 0.06); }
.cal-cell-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 6px 7px 3px;
  line-height: 1;
}
.cal-cell.cal-today .cal-cell-num { color: var(--accent); }

/* ============================================================
   RESPONSIVE — mobile-friendly layout
   Breakpoints: nav collapse ≤900px · tablet ≤768px · mobile ≤480px · tiny ≤360px
   Desktop (>900px) layout is fully unchanged.
   ============================================================ */

/* ── Scrollable table wrapper ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* ── Nav user section: desktop right-align ────────────────────────────────── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Hamburger button: hidden on desktop ──────────────────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.nav-burger:hover { background: var(--bg3); }
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
nav.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
nav.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav collapse (≤900px) ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  nav {
    flex-wrap: wrap;
    height: auto;
    min-height: 52px;
    padding: 0 16px;
    gap: 0;
    align-items: center;
  }
  .nav-brand { padding: 13px 0; flex: 1; min-width: 0; }
  .nav-burger { display: flex; }

  /* Links: hidden until nav-open */
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
    order: 10;
  }
  .nav-links a { padding: 10px 8px; font-size: 14px; width: 100%; box-sizing: border-box; }
  nav.nav-open .nav-links { display: flex; }

  /* User section: hidden until nav-open */
  .nav-user {
    display: none !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    margin-left: 0 !important;
    width: 100%;
    gap: 8px !important;
    padding: 10px 0 14px;
    border-top: 1px solid var(--border);
    order: 11;
  }
  nav.nav-open .nav-user {
    display: flex !important;
  }
  .nav-user .btn { min-width: 120px; }
  .nav-user span[style] { margin-left: 0 !important; }
}

/* ── Tablet layout (≤768px) ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding: 20px 14px; }

  /* Page header: stack title + action */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child { width: 100%; }

  /* Action grid: 2 cols max */
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid form { width: 100%; }
  .action-btn { width: 100%; }

  /* Queue panel: stack */
  .queue-panel { flex-direction: column; align-items: stretch; }
  .queue-divider { display: none; }
  .queue-stats { flex-wrap: wrap; gap: 16px; }
  .queue-cta { align-self: flex-start; }

  /* Pipeline flow: wrap steps, hide connectors */
  .flow-connector { display: none; }
  .flow-step { flex: 1 1 calc(50% - 8px); min-width: 80px; }

  /* Profile grid: stack key above value */
  .profile-row { grid-template-columns: 1fr; }
  .profile-key {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
  }

  /* Split layout (networking drafts): stack sidebar above content */
  .split-layout { grid-template-columns: 1fr; }

  /* Detail grid (networking_detail.html): stack sidebar below */
  .detail-grid { grid-template-columns: 1fr !important; }

  /* Fundraising thermometer section: stack vertically */
  .fundraising-top-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .fundraising-top-grid > div:first-child {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    align-items: center;
  }

  /* Decision panel form: stack fields */
  .form-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .form-group-notes { min-width: 0; width: 100%; }
  .btn-group { flex-wrap: wrap; gap: 6px; }
  .radio-btn { padding: 8px 12px; }

  /* Scheduler interval: wrap + full-width select */
  .interval-form { flex-wrap: wrap; gap: 8px; }
  .input-select-inline { flex: 1; min-width: 140px; }

  /* Input/select: fill available width in forms */
  .form-group .input-notes,
  .form-group .input-select { width: 100%; box-sizing: border-box; }

  /* Touch targets */
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  select, input[type="text"], input[type="email"],
  input[type="date"], input[type="number"] { font-size: 16px; } /* prevent iOS zoom */
}

/* ── Small mobile (≤480px) ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  main { padding: 16px 12px; }

  /* Stat grid: single column */
  .stat-grid { grid-template-columns: 1fr !important; }
  /* stat-grid-4 already has its own 1-col rule at 480px — kept */

  /* Action grid: single column */
  .action-grid { grid-template-columns: 1fr; }

  /* Pipeline flow: single column */
  .flow-step { flex: 1 1 100%; }

  /* Scheduler: stack interval controls */
  .interval-form { flex-direction: column; align-items: stretch; }
  .input-select-inline { width: 100% !important; }
  .interval-label { white-space: normal; }

  /* LP combobox + New LP button: stack vertically */
  .lp-combo-row { flex-direction: column; align-items: stretch !important; }
  .lp-combo-row .btn { align-self: flex-start; }

  /* New LP inner grid: single column */
  .lp-form-grid { grid-template-columns: 1fr !important; }

  /* Commitment form: expand fixed-width inputs */
  #commitment-form .input-notes,
  #commitment-form .input-select { width: 100% !important; min-width: 0 !important; }

  /* Toast: full width on tiny screens */
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: 100%; }

  /* Decision grid: 2-col still fine, but shrink */
  .decision-grid { grid-template-columns: repeat(2, 1fr); }

  /* Header buttons: wrap + fill */
  .page-header .header-badges { width: 100%; }
}

/* ── Extra small (≤360px) ─────────────────────────────────────────────────── */
@media (max-width: 360px) {
  main { padding: 14px 10px; }
  .stat-number { font-size: 28px; }
  .btn { font-size: 12px; padding: 6px 12px; }
  .decision-grid { grid-template-columns: 1fr; }
  .flow-count { font-size: 24px; }
  .profile-key { font-size: 11px; }
}
