/* Agent Assist portable demo -- theme tokens lifted from the real app's
   frontend/src/index.css (light mode palette only, simplified for a
   single portable file). */
:root {
  --brand: #001E60;
  --accent: #FFC220;
  --bg: #F7FAFF;
  --surface: #FFFFFF;
  --kpi: #F5F7FB;
  --text: #1F2937;
  --muted: #6B7280;
  --card-bd: rgba(0,0,0,.10);
  --bg-filter: #E8EAED;
  --filter-label: #001E60;
  --pill-green: #1E8E3E;
  --pill-green-bg: rgba(30,142,62,.15);
  --pill-red: #C5221F;
  --pill-red-bg: rgba(197,34,31,.15);
  --tab-active-bg: rgba(0,83,226,0.10);
  --tab-active-text: #0053E2;
  --kpi-value: #001E60;
  --blue: #0071CE;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.header {
  background: linear-gradient(135deg, #001E60 0%, #003087 55%, #001E60 100%);
  color: #fff;
  padding: 1.6rem 2rem 1.3rem;
}
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.header h1 { margin: 0 0 0.3rem; font-size: 1.6rem; font-weight: 800; }
.header p { margin: 0; color: rgba(255,255,255,.82); font-size: 0.9rem; }
.demo-badge {
  background: var(--accent); color: #3d2e00; font-weight: 800; font-size: 0.72rem;
  padding: 0.35rem 0.7rem; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; height: fit-content;
}

.filter-bar {
  max-width: 1280px; margin: 0 auto; padding: 0.9rem 2rem;
  display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center;
  background: var(--bg-filter);
}
.filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
.filter-group label { font-size: 0.68rem; font-weight: 700; color: var(--filter-label); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-group select {
  border: 1px solid var(--card-bd); border-radius: 6px; padding: 0.35rem 0.6rem;
  background: #fff; color: var(--filter-label); font-size: 0.82rem; font-weight: 600;
}

.tabs {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  display: flex; gap: 0.3rem; flex-wrap: wrap; border-bottom: 1px solid var(--card-bd);
}
.tab-btn {
  border: none; background: none; cursor: pointer; padding: 0.75rem 1rem;
  font-size: 0.85rem; font-weight: 700; color: var(--muted); border-radius: 8px 8px 0 0;
}
.tab-btn.active { color: var(--tab-active-text); background: var(--tab-active-bg); box-shadow: inset 0 -2px 0 #0053E2; }

.content { max-width: 1280px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem; margin-bottom: 1.4rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--card-bd); border-radius: 12px; padding: 0.95rem 1.1rem; }
.kpi-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.35rem; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--kpi-value); }
.kpi-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.kpi-delta { font-weight: 700; }
.kpi-delta.good { color: var(--pill-green); }
.kpi-delta.bad { color: var(--pill-red); }

.card { background: var(--surface); border: 1px solid var(--card-bd); border-radius: 12px; padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.card h3 { margin: 0 0 0.9rem; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 900px) { .card-grid-2 { grid-template-columns: 1fr; } }

.chart-box { position: relative; height: 300px; }
.chart-box.short { height: 220px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.data-table th { text-align: right; padding: 0.5rem 0.7rem; background: var(--bg-filter); color: var(--filter-label); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--card-bd); text-align: right; white-space: nowrap; }
table.data-table tr:nth-child(even) { background: rgba(0,30,96,.02); }

.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.pill.green { color: var(--pill-green); background: var(--pill-green-bg); }
.pill.red { color: var(--pill-red); background: var(--pill-red-bg); }

.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* Strategic Insights + Metric Readout (shared across all data tabs) */
.insights-card {
  background: linear-gradient(135deg, #fffdf5 0%, #fff 100%);
  border: 1px solid #ffc220;
  border-left: 4px solid #ffc220;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.insights-card h3 { margin: 0 0 0.6rem; font-size: 0.85rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; }
.insights-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.insights-list li { font-size: 0.86rem; line-height: 1.55; color: var(--text); }

.readout-strip { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed rgba(0,0,0,.12); }
.readout-legend { font-size: 0.72rem; font-weight: 700; color: var(--muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.03em; }
.readout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; }
.readout-cell { background: rgba(0,30,96,.03); border-radius: 8px; padding: 0.45rem 0.65rem; }
.readout-label { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.15rem; }
.readout-values { font-size: 0.88rem; font-weight: 700; font-family: 'SF Mono', Consolas, monospace; }
.readout-aa { color: var(--blue); }
.readout-sep { color: var(--muted); font-weight: 500; font-family: inherit; margin: 0 0.3rem; font-size: 0.72rem; }
.readout-naa { color: #b45309; }

/* Metric Definitions tab */
.def-card { background: var(--surface); border: 1px solid var(--card-bd); border-radius: 12px; overflow: hidden; margin-bottom: 1.1rem; max-width: 1100px; }
.def-card-head { padding: 0.85rem 1.2rem; background: #0d1b2a; }
.def-card-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; color: #fff; }
.def-card-body { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.85rem; }
.def-label { margin: 0 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.def-text { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--muted); }
.formula { background: rgba(255,194,32,0.08); border: 1px solid #ffc220; border-radius: 8px; padding: 0.65rem 0.9rem; }
.formula-label { margin: 0 0 3px; font-size: 0.72rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; }
.formula-body { margin: 0; font-family: monospace; font-size: 0.82rem; color: var(--text); line-height: 1.45; }
.callout { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.50); border-radius: 8px; padding: 0.65rem 0.9rem; }
.callout-title { margin: 0 0 3px; font-size: 0.75rem; font-weight: 700; color: #92400e; }
.callout-body { margin: 0; font-size: 0.78rem; line-height: 1.5; color: #78350f; }
.endpoint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .endpoint-grid, .def-card .card-grid-2 { grid-template-columns: 1fr; } }
.endpoint-chip { display: flex; gap: 10px; padding: 10px 12px; background: var(--bg-filter); border: 1px solid var(--card-bd); border-radius: 8px; }
.endpoint-chip .name { margin: 0 0 3px; font-size: 0.82rem; font-weight: 700; }
.endpoint-chip .desc { margin: 0; font-size: 0.79rem; line-height: 1.5; color: var(--muted); }

.footer-note {
  max-width: 1280px; margin: 0 auto; padding: 1rem 2rem 2rem; color: var(--muted); font-size: 0.75rem; line-height: 1.5;
}
