/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #07090f;
  --bg-card: rgba(255,255,255,0.035);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #475569;
  --text-faint: #334155;
  --blue: #3b82f6;
  --green: #22c55e;
  --violet: #a78bfa;
  --orange: #fb923c;
  --sky: #60a5fa;
  --indigo: #6366f1;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.16,1,0.3,1);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient Background ── */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  animation: drift 20s ease-in-out infinite alternate;
}
body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  top: -200px; left: -100px;
}
body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(167,139,250,0.06) 0%, transparent 70%);
  bottom: -100px; right: -50px;
  animation-delay: -10s;
}
@keyframes drift {
  from { transform: translate(0,0); }
  to   { transform: translate(30px, 20px); }
}

/* ── Layout Shell ── */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 40px;
}
.header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #64748b, #94a3b8, #64748b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.header-sub {
  font-size: 13px;
  color: var(--text-faint);
}
.header-sub .updated-badge {
  display: inline-block;
  margin-left: 8px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--green);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Navigation ── */
.nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.nav-btn {
  flex: 1;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
}
.nav-btn:hover { color: var(--text-dim); }
.nav-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Tabs ── */
.tab { display: none; }
.tab.active { display: block; }

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  text-align: center;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Overview Top Row ── */
.ov-top-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.ov-system-stats {
  display: flex;
  gap: 16px;
  flex: 1;
}
.ov-system-stats .stat-card { flex: 1; }

/* ── Channel Performance Cards ── */
.channel-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.ch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ch-card:hover { border-color: var(--border-hover); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.ch-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.6;
}
.ch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ch-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.ch-card-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ch-card-target {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ch-card-big {
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #e2e8f0));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ch-card-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ch-card-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.ch-card-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
}
.ch-card-pct {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}
.ch-card-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Schedule Section with Tabs ── */
.schedule-section {
  margin-bottom: 28px;
}
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.sched-tab {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sched-tab:hover { color: var(--text-dim); }
.sched-tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* ── SMM Platform Breakdown ── */
.smm-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.smm-plat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition);
}
.smm-plat-card:hover { border-color: var(--border-hover); }
.smm-plat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.smm-plat-icon {
  font-size: 22px;
}
.smm-plat-name {
  font-size: 13px;
  font-weight: 700;
}
.smm-plat-total {
  margin-left: auto;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--violet);
}
.smm-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.smm-type-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
}
.smm-type-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.smm-type-label {
  color: var(--text-dim);
  font-size: 11px;
}

/* ── Health Ring (SVG-based) ── */
.health-ring-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.health-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}
.health-ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.health-ring-wrap .ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 10;
}
.health-ring-wrap .ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16,1,0.3,1);
}
.health-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.health-pct {
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.health-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}
.health-ring-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ── Schedule Card ── */
.schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.schedule-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 0 0 8px;
}
.schedule-table th:nth-child(3),
.schedule-table th:nth-child(4) { text-align: center; }
.schedule-table th:last-child { text-align: right; }
.schedule-table td {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.schedule-table td:nth-child(3),
.schedule-table td:nth-child(4) { text-align: center; }
.schedule-table td:last-child { text-align: right; }
.sched-day { font-weight: 600; }
.sched-bar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sched-bar-track {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.sched-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--indigo));
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
}
.sched-pct {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.sched-total { background: rgba(255,255,255,0.02); font-weight: 700; }
.type-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}

/* ── Pipeline Flow ── */
.pipeline-section {
  margin-bottom: 28px;
}
.pipeline-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  padding: 16px 0;
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}
.pipeline-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.pipeline-icon:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}
.pipeline-icon .status-pip {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}
.pipeline-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pipeline-role {
  font-size: 9px;
  color: var(--text-faint);
}
.pipeline-arrow {
  font-size: 14px;
  color: rgba(255,255,255,0.12);
  margin: 0 4px;
  padding-bottom: 28px;
}

/* ── Agent Toolbar (search + filters) ── */
.agents-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.agents-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.agents-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.agents-search {
  width: 100%;
  padding: 8px 40px 8px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.agents-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent);
}
.agents-search::placeholder { color: var(--text-faint); }
.agents-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-faint);
  pointer-events: none;
  transition: opacity .2s;
}
.agents-search:focus ~ .agents-search-kbd { opacity: 0; }
.agents-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-btn {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--blue);
  color: var(--text);
}
.filter-btn.active {
  background: color-mix(in srgb, var(--blue) 15%, var(--bg-card));
  border-color: var(--blue);
  color: var(--blue);
}
.filter-count {
  display: inline-block;
  background: color-mix(in srgb, var(--blue) 20%, transparent);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 10px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}
.agents-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ── Agent Grid ── */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.agent-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.agent-card::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity var(--transition);
}
.agent-card:hover::before { opacity: 1; }

.agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.agent-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.agent-avatar svg { width: 100%; height: 100%; display: block; }
.agent-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}
.agent-name {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}
.agent-role {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}
.agent-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
}
.agent-health-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.agent-health-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.agent-health-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
}
.agent-health-pct {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}
.agent-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.agent-kpi {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.agent-kpi-label {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}
.agent-kpi-val {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi-ok { color: var(--green); }
.kpi-warn { color: var(--orange); }
.kpi-na { color: var(--text-faint); }

/* ── Agent-specific accent colors ── */
.accent-blue    { --accent: var(--blue); }
.accent-green   { --accent: var(--green); }
.accent-sky     { --accent: var(--sky); }
.accent-violet  { --accent: var(--violet); }
.accent-orange  { --accent: var(--orange); }
.accent-cyan    { --accent: var(--cyan); }
.accent-emerald { --accent: var(--emerald); }
.accent-indigo  { --accent: var(--indigo); }

.agent-card::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.agent-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 12%, transparent), 0 12px 32px rgba(0,0,0,0.4); }
.agent-health-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, #000), var(--accent)); }
.agent-badge { background: color-mix(in srgb, var(--accent) 12%, transparent); color: color-mix(in srgb, var(--accent) 70%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.agent-avatar { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 15%, #07090f), color-mix(in srgb, var(--accent) 30%, #07090f)); position: relative; }
.pipeline-icon.pi-blue    { background: linear-gradient(160deg, rgba(59,130,246,0.12), rgba(59,130,246,0.22)); }
.pipeline-icon.pi-green   { background: linear-gradient(160deg, rgba(34,197,94,0.12), rgba(34,197,94,0.22)); }
.pipeline-icon.pi-sky     { background: linear-gradient(160deg, rgba(96,165,250,0.12), rgba(96,165,250,0.22)); }
.pipeline-icon.pi-violet  { background: linear-gradient(160deg, rgba(167,139,250,0.12), rgba(167,139,250,0.22)); }
.pipeline-icon.pi-orange  { background: linear-gradient(160deg, rgba(251,146,60,0.12), rgba(251,146,60,0.22)); }
.pipeline-icon.pi-cyan    { background: linear-gradient(160deg, rgba(6,182,212,0.12), rgba(6,182,212,0.22)); }
.pipeline-icon.pi-emerald { background: linear-gradient(160deg, rgba(16,185,129,0.12), rgba(16,185,129,0.22)); }
.pipeline-icon.pi-indigo  { background: linear-gradient(160deg, rgba(99,102,241,0.12), rgba(99,102,241,0.22)); }

/* ── Detail Drawer ── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  animation: fadeIn 0.15s;
}
.drawer-overlay.open { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 440px;
  height: 100vh;
  background: rgba(10,13,22,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  padding: 32px 28px;
  overflow-y: auto;
  z-index: 100;
  animation: slideIn 0.25s cubic-bezier(0.16,1,0.3,1);
}
.drawer.open { display: block; }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.drawer-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.drawer-close:hover { background: rgba(255,255,255,0.10); color: var(--text); }

.drawer h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f1f5f9;
  margin: 4px 0 6px;
}
.drawer-mission {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.drawer-kpi-table {
  width: 100%;
  border-collapse: collapse;
}
.drawer-kpi-table td {
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.drawer-kpi-table tr:last-child td { border-bottom: none; }
.drawer-kpi-table .dk-metric { color: var(--text-dim); width: 48%; }
.drawer-kpi-table .dk-target { color: var(--text); font-weight: 700; text-align: right; font-size: 11px; }
.drawer-kpi-table .dk-current { text-align: right; padding-left: 10px; font-size: 11px; font-weight: 600; }
.drawer-kpi-table .dk-bar { padding-top: 0; border: none; }
.dk-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.dk-bar-fill {
  height: 100%;
  border-radius: 99px;
}

.skill-chip {
  display: inline-block;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin: 3px;
  letter-spacing: 0.04em;
}
.drawer-mono {
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.7;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Org Chart Tab ── */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-connector {
  width: 2px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25), rgba(255,255,255,0.10));
}
.org-signal {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: -6px 0 2px;
}
.org-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}
.org-pipeline {
  display: flex;
  align-items: flex-start;
  position: relative;
}
.org-pipeline::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50px; right: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent);
}
.org-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  margin: 0 8px;
}
.org-node .org-connector { height: 24px; }
.org-arrow {
  display: flex;
  align-items: center;
  padding-top: 48px;
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 600;
  margin: 0 2px;
}
/* ── Org Teams Grid ── */
.org-teams-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
  margin-top: 8px;
  position: relative;
  /* TL bus overlaps cards, so no extra row for it */
}
/* ── TL labels row ── */
.org-tl-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  width: 100%;
  margin-bottom: 8px;
}
.org-tl-labels .org-team-label {
  text-align: center;
  margin-bottom: 0;
}

/* ── TL cards row: 4 cards + 3 segment gaps ── */
.org-tl-cards {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr 24px 1fr;
  align-items: center;
  width: 100%;
}
.org-tl-cards > .org-card { justify-self: center; }

/* ── Data exchange segments between TL cards ── */
.org-tl-seg {
  position: relative;
  height: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Static gradient track */
.org-tl-seg-line {
  position: absolute;
  top: 50%;
  left: -6px;
  right: -6px;
  height: 2px;
  background: linear-gradient(90deg, var(--seg-from), var(--seg-to));
  opacity: 0.35;
  border-radius: 1px;
}
/* Animated glow particle bouncing back and forth */
.org-tl-seg-glow {
  position: absolute;
  top: calc(50% - 3px);
  left: -6px;
  width: 14px;
  height: 8px;
  border-radius: 4px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.8), transparent);
  animation: segGlow 2s ease-in-out infinite;
}
.org-tl-seg:nth-child(5) .org-tl-seg-glow { animation-delay: 0s; }
.org-tl-seg:nth-child(6) .org-tl-seg-glow { animation-delay: 0.7s; }
.org-tl-seg:nth-child(7) .org-tl-seg-glow { animation-delay: 1.4s; }
@keyframes segGlow {
  0%   { left: -6px;                   opacity: 0; }
  10%  { opacity: 1; }
  45%  { left: calc(100% - 8px);       opacity: 1; }
  55%  { left: calc(100% - 8px);       opacity: 1; }
  90%  { left: -6px;                   opacity: 1; }
  100% { left: -6px;                   opacity: 0; }
}
.org-team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-team-col .org-pipeline {
  flex-direction: column;
  align-items: center;
}
.org-team-col .org-pipeline::before { display: none; }
.org-team-col .org-node { margin: 0; }
.org-team-col .org-node .org-connector { display: none; }
.org-team-col .org-arrow {
  padding-top: 4px;
  padding-bottom: 4px;
  transform: rotate(90deg);
}
/* ── Branch connector: LISTHUB → 4 Team Leaders ── */
.org-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
/* Vertical stem from LISTHUB down */
.org-branch-stem {
  width: 2px;
  height: 32px;
  background: rgba(255,255,255,0.20);
  position: relative;
  overflow: visible;
}
.org-branch-stem-short {
  height: 16px;
}
/* Glow flowing down the stem */
.org-branch-stem-glow {
  position: absolute;
  left: -3px;
  top: -6px;
  width: 8px;
  height: 12px;
  border-radius: 4px;
  background: radial-gradient(ellipse, rgba(16,185,129,0.9), transparent);
  animation: stemFlow 3s ease-in-out infinite;
}
.org-branch-stem-glow-2 {
  animation: stemFlow2 3s ease-in-out infinite;
}
@keyframes stemFlow {
  0%   { top: -6px;  opacity: 0; }
  8%   { opacity: 1; }
  25%  { top: 26px;  opacity: 1; }
  35%  { top: 32px;  opacity: 0; }
  100% { opacity: 0; }
}
@keyframes stemFlow2 {
  0%, 30% { top: -6px; opacity: 0; }
  35%  { opacity: 1; }
  50%  { top: 10px;  opacity: 1; }
  60%  { top: 16px;  opacity: 0; }
  100% { opacity: 0; }
}
.org-branch-bar {
  height: 2px;
  background: rgba(255,255,255,0.20);
  width: 100%;
}
.org-branch-drops {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
}
.org-branch-drop {
  display: flex;
  justify-content: center;
  position: relative;
}
.org-branch-drop::after {
  content: '';
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--drop-color, rgba(255,255,255,0.20)), rgba(255,255,255,0.08));
}
/* Glow particle flowing down each drop */
.org-branch-drop::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  width: 6px;
  height: 10px;
  margin-left: -3px;
  border-radius: 3px;
  background: radial-gradient(ellipse, var(--drop-color, rgba(255,255,255,0.6)), transparent);
  animation: dropFlow 2s ease-in-out infinite;
}
.org-branch-drop:nth-child(1)::before { animation-delay: 1.5s; }
.org-branch-drop:nth-child(2)::before { animation-delay: 1.7s; }
.org-branch-drop:nth-child(3)::before { animation-delay: 1.9s; }
.org-branch-drop:nth-child(4)::before { animation-delay: 2.1s; }
@keyframes dropFlow {
  0%   { top: -4px;  opacity: 0; }
  15%  { opacity: 1; }
  70%  { top: 22px;  opacity: 1; }
  100% { top: 28px;  opacity: 0; }
}

.org-team-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.org-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  width: 180px;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(12px);
}
.org-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.org-card.org-main {
  width: 220px;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1.5px solid rgba(255,255,255,0.14);
  box-shadow: 0 0 20px rgba(99,102,241,0.08), 0 4px 16px rgba(0,0,0,0.3);
}
.org-card.org-main:hover {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 0 28px rgba(99,102,241,0.14), 0 8px 24px rgba(0,0,0,0.35);
}
.org-card.org-main .org-card-name {
  font-weight: 800;
  letter-spacing: -0.01em;
}
/* Team-specific leader accents */
.org-card.org-lead-blog {
  border-color: rgba(59,130,246,0.3);
  background: linear-gradient(160deg, rgba(59,130,246,0.1), rgba(59,130,246,0.03));
  box-shadow: 0 0 20px rgba(59,130,246,0.1), 0 4px 16px rgba(0,0,0,0.3);
}
.org-card.org-lead-blog:hover { border-color: rgba(59,130,246,0.45); box-shadow: 0 0 28px rgba(59,130,246,0.18), 0 8px 24px rgba(0,0,0,0.35); }

.org-card.org-lead-smm {
  border-color: rgba(167,139,250,0.3);
  background: linear-gradient(160deg, rgba(167,139,250,0.1), rgba(167,139,250,0.03));
  box-shadow: 0 0 20px rgba(167,139,250,0.1), 0 4px 16px rgba(0,0,0,0.3);
}
.org-card.org-lead-smm:hover { border-color: rgba(167,139,250,0.45); box-shadow: 0 0 28px rgba(167,139,250,0.18), 0 8px 24px rgba(0,0,0,0.35); }

.org-card.org-lead-ads {
  border-color: rgba(251,146,60,0.3);
  background: linear-gradient(160deg, rgba(251,146,60,0.1), rgba(251,146,60,0.03));
  box-shadow: 0 0 20px rgba(251,146,60,0.1), 0 4px 16px rgba(0,0,0,0.3);
}
.org-card.org-lead-ads:hover { border-color: rgba(251,146,60,0.45); box-shadow: 0 0 28px rgba(251,146,60,0.18), 0 8px 24px rgba(0,0,0,0.35); }

.org-card.org-lead-email {
  border-color: rgba(16,185,129,0.3);
  background: linear-gradient(160deg, rgba(16,185,129,0.1), rgba(16,185,129,0.03));
  box-shadow: 0 0 20px rgba(16,185,129,0.1), 0 4px 16px rgba(0,0,0,0.3);
}
.org-card.org-lead-email:hover { border-color: rgba(16,185,129,0.45); box-shadow: 0 0 28px rgba(16,185,129,0.18), 0 8px 24px rgba(0,0,0,0.35); }
.org-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.org-card-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.org-card-avatar svg { width: 100%; height: 100%; display: block; }
.org-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}
.org-card-role {
  font-size: 10px;
  color: var(--text-dim);
}
.org-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.org-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(34,197,94,0.7);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.org-status-text {
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ── Live Running Indicator ── */
.live-badge {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.18);
  border-radius: 8px;
  animation: fadeInBadge 0.3s ease;
}
.live-badge.active { display: inline-flex; }
@keyframes fadeInBadge {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,0.8);
  animation: livePulse 1.2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.5; }
}
.live-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.03em;
}
.live-skill {
  font-size: 9px;
  font-weight: 700;
  color: rgba(34,197,94,0.7);
  letter-spacing: 0.06em;
}

/* Pipeline icon live state */
.pipeline-icon.is-running {
  animation: iconGlow 1.5s ease-in-out infinite;
}
@keyframes iconGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(34,197,94,0); }
  50%      { box-shadow: 0 0 16px rgba(34,197,94,0.4); }
}

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .ov-top-row { flex-direction: column; }
  .ov-system-stats { width: 100%; }
  .channel-cards { grid-template-columns: repeat(2, 1fr); }
  .agents-grid { grid-template-columns: 1fr; }
  .nav { max-width: 360px; }
}

/* ── Mobile (≤ 720px) ── */
@media (max-width: 720px) {
  .shell { padding: 24px 14px 60px; }

  /* Header */
  .header { margin-bottom: 28px; }
  .header-title { font-size: 22px; }
  .header-sub { font-size: 12px; }
  .header-sub .updated-badge { display: block; margin: 8px auto 0; width: fit-content; }

  /* Nav */
  .nav { max-width: 100%; margin-bottom: 24px; }
  .nav-btn { padding: 8px 10px; font-size: 11px; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 9px; }

  /* Overview top row */
  .ov-top-row { flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .ov-system-stats { flex-wrap: wrap; gap: 10px; }
  .ov-system-stats .stat-card { min-width: 0; }
  .channel-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ch-card { padding: 14px; }
  .ch-card-big { font-size: 28px; }
  .schedule-header { flex-direction: column; align-items: flex-start; }
  .smm-platforms { grid-template-columns: 1fr; }

  /* Health ring */
  .health-ring-card { padding: 20px 16px; }
  .health-ring-wrap { width: 130px; height: 130px; }
  .health-pct { font-size: 28px; }

  /* Schedule table — horizontal scroll */
  .schedule-card { padding: 16px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .schedule-table { min-width: 480px; font-size: 12px; }
  .sched-bar-track { width: 60px; }

  /* Pipeline flow — horizontal scroll */
  .pipeline-flow { justify-content: flex-start; padding: 12px 0; -webkit-overflow-scrolling: touch; }
  .pipeline-step { min-width: 90px; }
  .pipeline-icon { width: 42px; height: 42px; font-size: 18px; }
  .pipeline-name { font-size: 9px; }

  /* Agent toolbar */
  .agents-toolbar { flex-direction: column; align-items: stretch; }
  .agents-search-wrap { max-width: 100%; }
  .agents-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }

  /* Agent cards */
  .agents-grid { gap: 12px; margin-bottom: 20px; }
  .agent-card { padding: 16px; }
  .agent-kpis { grid-template-columns: 1fr; }
  .agent-avatar { width: 36px; height: 36px; }
  .agent-name { font-size: 13px; }

  /* Drawer — full screen */
  .drawer { width: 100vw; border-left: none; padding: 24px 18px; }
  .drawer h2 { font-size: 18px; }

  /* Org chart */
  .org-branch-bar { display: none; }
  .org-branch-drops { grid-template-columns: 1fr; }
  .org-tl-labels { grid-template-columns: 1fr 1fr; gap: 12px; }
  .org-tl-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .org-tl-seg { display: none; }
  .org-branch-drop::after { height: 16px; }
  .org-teams-grid { grid-template-columns: 1fr; gap: 32px; }
  .org-pipeline { flex-direction: column; align-items: center; }
  .org-pipeline::before { display: none; }
  .org-arrow { display: none; }
  .org-node { margin: 0; }
  .org-node .org-connector { height: 20px; }
  .org-card, .org-card.org-main { width: min(360px, 90vw); }
  .org-card-head { gap: 8px; }
  .org-card-avatar { width: 32px; height: 32px; }

  /* Live badge */
  .live-badge { padding: 5px 8px; }
}

/* ── Small phones (≤ 400px) ── */
@media (max-width: 400px) {
  .shell { padding: 20px 10px 50px; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 22px; }
  .health-ring-wrap { width: 110px; height: 110px; }
  .health-pct { font-size: 24px; }
  .nav-btn { font-size: 10px; padding: 7px 8px; }
  .agent-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .agent-badge { align-self: flex-start; }
  .org-card, .org-card.org-main { width: 92vw; }
  .drawer { padding: 20px 14px; }
  .schedule-table { min-width: 420px; }
  .fn-stage-row { flex-direction: column; gap: 4px; }
  .fn-stage-label { min-width: unset; width: 100%; }
  .fn-stage-meta { justify-content: flex-start; }
  .fn-cac-grid { grid-template-columns: repeat(2, 1fr); }
  .fn-insight-bar { flex-wrap: wrap; gap: 6px; }
  .fn-attr-table { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* FUNNELS TAB                                                            */
/* ═══════════════════════════════════════════════════════════════════════ */

/* ── Funnel top bar ── */
.funnel-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Funnel sub-nav ── */
.funnel-nav {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

/* ── Date range selector ── */
.funnel-date-nav {
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.funnel-date-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.funnel-date-btn:hover { color: var(--text-dim); }
.funnel-date-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.funnel-nav-btn {
  flex: 1;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.funnel-nav-btn:hover { color: var(--text-dim); }
.funnel-nav-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Funnel card ── */
.fn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition);
}
.fn-card:hover { border-color: var(--border-hover); }

.fn-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.fn-icon { font-size: 28px; }
.fn-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.fn-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.fn-date-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--blue);
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Funnel stages (bar chart) ── */
.fn-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fn-stage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.fn-stage-label {
  min-width: 160px;
  flex-shrink: 0;
}
.fn-stage-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.fn-stage-metric {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.fn-bar-wrap {
  flex: 1;
  height: 36px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.fn-bar {
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
  min-width: 60px;
  opacity: 0.85;
}
.fn-bar:hover { opacity: 1; }
.fn-bar-value {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.fn-stage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  justify-content: flex-end;
}

/* ── Trend indicators ── */
.fn-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.fn-trend-up {
  color: var(--green);
  background: rgba(34,197,94,0.1);
}
.fn-trend-down {
  color: var(--red);
  background: rgba(239,68,68,0.1);
}
.fn-trend-flat {
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}
.fn-trend-na {
  color: var(--text-faint);
}

.fn-conv-rate {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 40px;
  text-align: right;
}

/* ── Drop-off between stages ── */
.fn-dropoff {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 2px 160px;
  margin-left: 14px;
}
.fn-dropoff-line {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.08);
}
.fn-dropoff-label {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ── Overall conversion ── */
.fn-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fn-overall-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.fn-overall-value {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fn-overall-detail {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: auto;
}

/* ── Section title ── */
.fn-section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--text);
}

/* ── Channel attribution table ── */
.fn-attr-table {
  width: 100%;
  border-collapse: collapse;
}
.fn-attr-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 12px 10px 0;
  text-align: right;
}
.fn-attr-table th:first-child { text-align: left; }
.fn-attr-table td {
  padding: 8px 12px 8px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  text-align: right;
  font-size: 13px;
}
.fn-attr-table td:first-child { text-align: left; }
.fn-ch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.fn-ch-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── CAC grid ── */
.fn-cac-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.fn-cac-item {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}
.fn-cac-item.fn-cac-main {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.fn-cac-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 4px;
}
.fn-cac-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── Empty state ── */
.fn-empty-state {
  text-align: center;
  padding: 48px 20px;
}
.fn-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.fn-empty-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.fn-empty-sub {
  font-size: 12px;
  color: var(--text-faint);
}
.fn-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ── INSIGHT status bar ── */
.fn-insight-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 18px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.fn-insight-icon { font-size: 16px; }
.fn-insight-label {
  font-weight: 700;
  color: var(--indigo);
}
.fn-insight-sep {
  color: rgba(255,255,255,0.1);
}
.fn-insight-item {
  color: var(--text-dim);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   CRON PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Setup Banner */
.cron-setup-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.cron-setup-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cron-setup-icon {
  font-size: 28px;
  line-height: 1;
  opacity: 0.7;
}
.cron-setup-inner code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Summary cards (reuse stat-card from overview) */
.cron-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

/* Timeline */
.cron-timeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 48px;
  margin-bottom: 32px;
  overflow: visible;
}
.tl-track {
  position: relative;
  height: 60px;
}
.tl-line {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}
.tl-hour {
  position: absolute;
  top: 36px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tl-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
  position: relative;
  top: 14px;
  z-index: 2;
}
.tl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  margin-top: -6px;
}
.tl-now {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  z-index: 3;
}
.tl-now-line {
  width: 2px;
  height: 32px;
  background: var(--red);
  margin: 0 auto;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(239,68,68,0.4);
}
.tl-now-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-align: center;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Job Cards */
.cron-jobs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}
.cron-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.cron-card:hover {
  border-color: var(--border-hover);
}
.cron-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cron-card-icon {
  font-size: 24px;
  line-height: 1;
}
.cron-card-info {
  flex: 1;
}
.cron-card-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cron-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.cron-card-body {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.cron-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cron-detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.cron-detail-value {
  font-size: 13px;
  color: var(--text);
}
.cron-detail-value code {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Agent tags */
.cron-agent-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59,130,246,0.12);
  color: var(--blue);
  margin-right: 4px;
}

/* Type badges */
.cron-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cron-type-gh {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.cron-type-cloud {
  background: rgba(96,165,250,0.12);
  color: var(--sky);
}

/* Buttons */
.cron-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.cron-btn-run {
  background: rgba(34,197,94,0.12);
  color: var(--green);
}
.cron-btn-run:hover {
  background: rgba(34,197,94,0.22);
}
.cron-btn-save {
  background: var(--blue);
  color: #fff;
}
.cron-btn-save:hover {
  opacity: 0.85;
}

/* Status */
.cron-status {
  font-weight: 600;
}

/* Recent Runs Table */
.cron-runs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.cron-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cron-table thead {
  background: rgba(255,255,255,0.02);
}
.cron-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.cron-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-dim);
}
.cron-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

/* Responsive */
@media (max-width: 768px) {
  .cron-summary { grid-template-columns: repeat(3, 1fr); }
  .cron-card-body { grid-template-columns: 1fr; }
  .cron-card-header { flex-wrap: wrap; }
  .tl-track { overflow-x: auto; min-width: 600px; }
}

/* ═══════════════════════════════════════════════════════════════
   DRAWER TABS (Info / Feedback)
   ═══════════════════════════════════════════════════════════════ */
.drawer-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 3px;
}
.drawer-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.drawer-tab:hover { color: var(--text-dim); }
.drawer-tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.drawer-tab-content { display: none; }
.drawer-tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK FORM (inside drawer + standalone page)
   ═══════════════════════════════════════════════════════════════ */
.fb-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.fb-input, .fb-textarea, .fb-select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.fb-input:focus, .fb-textarea:focus, .fb-select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.2);
}
.fb-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}
.fb-select {
  appearance: none;
  cursor: pointer;
}

/* Type radio chips */
.fb-type-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fb-type-option input { display: none; }
.fb-type-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  transition: all 0.15s;
}
.fb-type-option input:checked + .fb-type-praise {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3);
  color: var(--green);
}
.fb-type-option input:checked + .fb-type-issue {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: var(--rose);
}
.fb-type-option input:checked + .fb-type-suggestion {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.3);
  color: var(--indigo);
}
.fb-type-option input:checked + .fb-type-task {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: #fbbf24;
}

/* Star rating */
.fb-stars {
  display: flex;
  gap: 4px;
}
.fb-star {
  font-size: 20px;
  color: rgba(255,255,255,0.12);
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
  user-select: none;
}
.fb-star:hover { transform: scale(1.15); }
.fb-star.active { color: #fbbf24; }

/* Submit button */
.fb-submit {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.fb-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.fb-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Status messages */
.fb-status {
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
}
.fb-status-ok { color: var(--green); }
.fb-status-err { color: var(--rose); }

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK PAGE (standalone)
   ═══════════════════════════════════════════════════════════════ */
.fb-page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  margin: 0 auto;
}
.fb-page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.fb-page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}
.fb-agent-select-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fb-agent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  color: var(--text-muted);
}
.fb-agent-option:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}
.fb-agent-option.selected {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
  color: var(--text);
}
.fb-agent-option input { display: none; }
.fb-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}
.fb-recent-item {
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 12px;
}
.fb-recent-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 10px;
}
.fb-recent-msg {
  color: var(--text-dim);
  line-height: 1.5;
}

/* Amber accent for SUPPORT agent */
:root {
  --amber: #f59e0b;
}
