/* Full-Funnel Monitoring Dashboard */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f8fafc;
  color: #2c3e50;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Header ── */
.dashboard-header {
  background: #1a365d;
  color: #fff;
  padding: 24px 32px;
}
.dashboard-header h1 { font-size: 20px; font-weight: 600; }
.dashboard-header p { font-size: 12px; opacity: 0.8; margin-top: 4px; }

/* ── Main Content ── */
.dashboard-content { padding: 24px 32px; max-width: 1600px; margin: 0 auto; }

/* ── Tab Bar ── */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0; flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 16px; border: none; background: #e2e8f0;
  cursor: pointer; font-size: 12px; border-radius: 4px 4px 0 0;
  color: #2c3e50; transition: all 0.2s; font-weight: 500;
}
.tab-btn.active { background: #1a365d; color: #fff; }
.tab-btn:hover:not(.active) { background: #cbd5e0; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Section Divider ── */
.section-divider {
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a365d;
}
.section-title {
  font-size: 16px; font-weight: 700; color: #1a365d;
  margin: 0;
}

/* ── Cards ── */
.card {
  background: #fff; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; color: #1a365d; margin-bottom: 12px; font-weight: 600; }
.card.full-width { width: 100%; }

/* ── KPI Grid ── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: #fff; border-radius: 8px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); text-align: center;
}
.kpi-card .kpi-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-card .kpi-value { font-size: 24px; font-weight: 700; color: #1a365d; margin: 8px 0 4px; }
.kpi-card .kpi-sub { font-size: 11px; color: #94a3b8; }

/* ── Segment Grid ── */
.segment-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.segment-cell {
  border: 1px solid #e2e8f0; border-radius: 4px; padding: 12px;
}
.segment-cell h3 { font-size: 12px; color: #64748b; margin-bottom: 8px; font-weight: 500; }
.segment-cell canvas { width: 100% !important; height: 200px !important; }

/* ── Chart Container ── */
.chart-container { position: relative; height: 350px; margin-bottom: 16px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

.chart-row {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 16px;
}

/* ── Placeholder ── */
.placeholder-card {
  background: #f8fafc; border: 2px dashed #e2e8f0;
  border-radius: 8px; padding: 40px; text-align: center;
  color: #94a3b8; font-size: 14px;
}

/* ── Legend (inline) ── */
.series-legend {
  display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap;
}
.series-legend-item {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748b;
}
.series-legend-item .swatch {
  width: 12px; height: 3px; border-radius: 1px;
}

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th {
  background: #f1f5f9; padding: 6px 8px; text-align: left;
  border-bottom: 2px solid #e2e8f0; font-weight: 600; color: #475569;
}
.data-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; }
.data-table tr:hover td { background: #f8fafc; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .segment-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dashboard-content { padding: 16px; }
  .segment-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .tab-btn { font-size: 11px; padding: 6px 10px; }
}
