/* Dashboard — client portal styles for CapitalOS/CAW.
   Extends theme.css tokens. Uses same dark/amber brand identity. */

/* NAV */
.dash-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(12,12,14,0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-nav-link {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.dash-nav-link:hover { color: var(--fg); }
.dash-nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}
.dash-nav-cta:hover { background: rgba(245,158,11,0.2); }

/* HERO */
.dash-hero {
  padding: 140px 40px 60px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dash-hero-inner { max-width: 1200px; margin: 0 auto; }
.dash-eyebrow { margin-bottom: 16px; }
.dash-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 4px 10px;
  border-radius: 4px;
}
.dash-headline {
  font-family: 'Syne', sans-serif;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--fg);
  margin-bottom: 12px;
}
.dash-sub {
  font-size: 16px;
  color: var(--fg-muted);
  font-weight: 300;
}

/* KPI ROW */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}
.kpi-card:last-child { border-right: none; }
.kpi-card:hover { background: var(--bg-2); }
.kpi-icon { font-size: 28px; line-height: 1; opacity: 0.7; }
.kpi-value {
  font-family: 'Syne', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--fg);
}
.kpi-label {
  font-size: 13px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-top: 4px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 4px;
  opacity: 0.7;
}

/* DASHBOARD GRID */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-col { display: flex; flex-direction: column; gap: 1px; background: var(--border); }
.dash-col > .dash-card { background: var(--bg); }

/* CARD */
.dash-card {
  padding: 28px 32px;
  background: var(--bg);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.card-sub {
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.card-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* BAR CHART */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  padding-bottom: 28px;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
}
.bar-wrap {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 100%;
  max-width: 40px;
  height: 100px;
}
.bar {
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: opacity 0.2s;
}
.bar-total { background: rgba(245,158,11,0.6); }
.bar-inbound { background: var(--accent); }
.bar-label { font-size: 11px; color: var(--fg-muted); font-weight: 500; }
.bar-count { font-size: 10px; color: var(--fg-muted); opacity: 0.6; }
.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.legend-item { font-size: 12px; color: var(--fg-muted); }
.legend-total::before { content: ''; display: inline-block; width: 10px; height: 10px; background: rgba(245,158,11,0.6); border-radius: 2px; margin-right: 6px; }
.legend-inbound::before { content: ''; display: inline-block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; margin-right: 6px; }

/* DATA TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 0 8px 10px 0;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--fg);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* BADGES */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-inbound { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-outbound { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-answered { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-missed { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-voicemail { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-up { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-error { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-ok { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-healthy { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-degraded { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-new { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-contacted { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-qualified { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-converted { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-src { background: rgba(255,255,255,0.05); color: var(--fg-muted); border: 1px solid var(--border); }
.badge-status-new { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-status-contacted { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-status-qualified { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-status-converted { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* RESPONSIVE BARS */
.response-bars { display: flex; flex-direction: column; gap: 10px; }
.resp-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.resp-date { width: 60px; color: var(--fg-muted); font-size: 12px; flex-shrink: 0; }
.resp-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.resp-bar { height: 100%; background: var(--accent); border-radius: 3px; min-width: 2px; }
.resp-val { width: 36px; text-align: right; color: var(--fg); font-weight: 500; font-size: 12px; }
.resp-count { width: 60px; text-align: right; color: var(--fg-muted); font-size: 11px; }

/* WORKFLOW LIST */
.workflow-list { display: flex; flex-direction: column; gap: 12px; }
.workflow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.workflow-row:last-child { border-bottom: none; }
.wf-name { font-size: 13px; font-weight: 500; color: var(--fg); flex: 1; }
.wf-stats { display: flex; align-items: center; gap: 8px; }
.wf-run { font-size: 12px; color: var(--fg-muted); }
.wf-live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34d399; animation: pulse 2s infinite; }

/* LEADS */
.lead-name { font-size: 13px; font-weight: 500; color: var(--fg); }
.lead-email { font-size: 11px; color: var(--fg-muted); margin-top: 2px; }

/* UTILITIES */
.mono { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace; font-size: 12px; }
.muted { color: var(--fg-muted) !important; font-size: 12px; }
.empty-state { color: var(--fg-muted); font-size: 13px; font-style: italic; text-align: center; padding: 24px 0; }

/* FOOTER */
.dash-footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  background: var(--bg-2);
}
.dash-footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.dash-footer-brand { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--fg); }
.dash-footer-sep { color: var(--fg-muted); }
.dash-footer-note { font-size: 13px; color: var(--fg-muted); }

/* ANIMATIONS */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* MOBILE */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-card:nth-child(2) { border-right: none; }
  .kpi-card:nth-child(3) { border-right: 1px solid var(--border); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dash-nav { padding: 14px 20px; }
  .dash-hero { padding: 110px 20px 40px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-card { padding: 20px 16px; }
  .kpi-value { font-size: 28px; }
  .dash-grid { gap: 0; }
  .dash-card { padding: 20px 16px; }
  .data-table { font-size: 12px; }
}

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr; }
  .kpi-card { border-right: none; border-bottom: 1px solid var(--border); }
  .kpi-card:last-child { border-bottom: none; }
}