/* Dashboard styles for Belong inclusion monitoring */
:root {
  --bg: #111714;
  --bg-card: #1a201d;
  --bg-card-alt: #1f2723;
  --fg: #e8ebe8;
  --fg-muted: #8a9b8a;
  --accent: #5bba6f;
  --accent-warm: #e8945a;
  --accent-red: #d45454;
  --accent-blue: #5a8ae8;
  --border: #2a352e;
  --border-light: #344039;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Top bar ─────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-logo {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}
.topbar-badge {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  background: rgba(91, 186, 111, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
}
.topbar-actions { display: flex; gap: 8px; }

/* ── Buttons ──────────────────────────── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #111;
}
.btn-primary:hover { background: #4da960; }
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--fg);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Layout ──────────────────────────── */
.dashboard { padding: 32px; max-width: 1280px; margin: 0 auto; }

/* ── Metric cards ────────────────────── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.metric-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.metric-value {
  font-family: 'Fraunces', serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.metric-sub {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* Score ring */
.score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.score-high { background: rgba(91, 186, 111, 0.15); color: var(--accent); border: 2px solid rgba(91, 186, 111, 0.3); }
.score-mid { background: rgba(232, 148, 90, 0.15); color: var(--accent-warm); border: 2px solid rgba(232, 148, 90, 0.3); }
.score-low { background: rgba(212, 84, 84, 0.15); color: var(--accent-red); border: 2px solid rgba(212, 84, 84, 0.3); }

/* ── Sections ─────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ── Grid panels ─────────────────────── */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-body { padding: 0; }

/* ── Team rows ────────────────────────── */
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.team-row:last-child { border-bottom: none; }
.team-row:hover { background: var(--bg-card-alt); }
.team-info { display: flex; flex-direction: column; gap: 2px; }
.team-name { font-weight: 500; font-size: 14px; }
.team-dept { font-size: 12px; color: var(--fg-muted); }
.team-score {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
}

/* ── Signal items ────────────────────── */
.signal-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.signal-item:last-child { border-bottom: none; }
.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.signal-dot.high { background: var(--accent-red); }
.signal-dot.medium { background: var(--accent-warm); }
.signal-dot.low { background: var(--accent-blue); }
.signal-content { flex: 1; min-width: 0; }
.signal-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signal-meta {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}
.signal-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.badge-open { background: rgba(232, 148, 90, 0.15); color: var(--accent-warm); }
.badge-resolved { background: rgba(91, 186, 111, 0.15); color: var(--accent); }

/* ── Nudge items ─────────────────────── */
.nudge-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.nudge-item:last-child { border-bottom: none; }
.nudge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.nudge-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-warm);
}
.nudge-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
}
.nudge-message {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.45;
}
.nudge-team {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  opacity: 0.7;
}

/* ── Breakdown bars ──────────────────── */
.breakdown { margin-top: 24px; }
.breakdown-item { margin-bottom: 16px; }
.breakdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.breakdown-name { color: var(--fg); }
.breakdown-val { color: var(--fg-muted); font-family: 'Fraunces', serif; font-weight: 600; }
.bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── Empty state ──────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-muted);
}
.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  color: var(--fg);
  margin-bottom: 8px;
}
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── Loading ──────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--fg-muted);
  font-size: 14px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.badge-sent {
  background: rgba(90, 138, 232, 0.15);
  color: var(--accent-blue);
}

/* ── Responsive ──────────────────────── */
@media (max-width: 768px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .panels { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .dashboard { padding: 16px; }
}

/* ── Outreach Sequence Editor ─────────────────────────────── */
.seq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.seq-header-left { display: flex; align-items: center; gap: 16px; }
.seq-name-input {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg);
  padding: 4px 0;
  min-width: 200px;
  transition: border-color 0.2s;
}
.seq-name-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.seq-status-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
}
.seq-status-draft { background: rgba(138, 155, 138, 0.15); color: var(--fg-muted); }
.seq-status-active { background: rgba(91, 186, 111, 0.15); color: var(--accent); }
.seq-status-paused { background: rgba(232, 148, 90, 0.15); color: var(--accent-warm); }
.seq-status-completed { background: rgba(90, 138, 232, 0.15); color: var(--accent-blue); }

.seq-editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.seq-steps-panel { min-width: 0; }
.seq-sidebar-panel { position: sticky; top: 80px; }

.seq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.15s;
}
.seq-card:hover { border-color: var(--border-light); background: var(--bg-card-alt); }
.seq-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.seq-card-name { font-weight: 600; font-size: 15px; }
.seq-card-meta { font-size: 12px; color: var(--fg-muted); display: flex; gap: 12px; margin-top: 6px; }

.seq-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--bg-card-alt);
}
.seq-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.seq-step-content { flex: 1; min-width: 0; }
.seq-step-subject { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.seq-step-meta { font-size: 12px; color: var(--fg-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.seq-step-delay-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(90, 138, 232, 0.15);
  color: var(--accent-blue);
}
.seq-step-actions { display: flex; gap: 6px; align-items: center; }

.seq-form { display: flex; flex-direction: column; gap: 16px; }
.seq-field { display: flex; flex-direction: column; gap: 6px; }
.seq-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fg-muted); }
.seq-input, .seq-textarea, .seq-select {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
}
.seq-input:focus, .seq-textarea:focus, .seq-select:focus {
  outline: none;
  border-color: var(--accent);
}
.seq-textarea { resize: vertical; min-height: 80px; }
.seq-select { cursor: pointer; }

.seq-send-summary {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.seq-send-summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--fg-muted); }
.seq-send-summary-row:last-child { margin-bottom: 0; }
.seq-send-summary-row span { color: var(--fg); font-weight: 500; }

.seq-sends-table { width: 100%; border-collapse: collapse; }
.seq-sends-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fg-muted); padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.seq-sends-table td { font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--fg-muted); }
.seq-sends-table tr:last-child td { border-bottom: none; }
.seq-sends-table tr:hover td { background: var(--bg-card-alt); }

.step-add-form {
  background: var(--bg-card-alt);
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}
.step-add-form-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--fg-muted); }
.step-add-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.step-add-form-full { margin-bottom: 10px; }
.step-add-form-actions { display: flex; gap: 8px; justify-content: flex-end; }

.seq-empty-steps {
  text-align: center;
  padding: 32px 24px;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  color: var(--fg-muted);
  font-size: 13px;
}
