/* === Analytics App — Editorial design tokens === */

:root {
  --ink: #1a1a1f;
  --ink-mute: #5b5b66;
  --paper: #faf8f3;
  --line: #e8e3d6;
  --petrol: #0f4c5c;
  --clay: #c44536;
  --olive: #6b7f45;
}

/* Smooth fonts on all browsers */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body { font-feature-settings: "ss01", "cv11"; }

/* Display headings get Fraunces with optical sizing */
h1.display, h2.display, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 120;
  letter-spacing: -0.025em;
}

/* Tabular numerals everywhere they matter */
.tnum, .kpi-value, table td.num, table th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Subtle paper texture on body */
body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(15,76,92,0.03) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(196,69,54,0.025) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Eyebrow label — small caps */
.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

/* KPI card */
.kpi {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(26,26,31,0.04), 0 1px 2px rgba(26,26,31,0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover { box-shadow: 0 4px 12px rgba(26,26,31,0.06), 0 1px 3px rgba(26,26,31,0.05); }
.kpi-value {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 6px;
}
.kpi-suffix { font-size: 0.55em; color: var(--ink-mute); margin-left: 2px; font-weight: 400; }

/* Card primitive */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(26,26,31,0.04), 0 1px 2px rgba(26,26,31,0.05);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-weight: 500; letter-spacing: -0.01em; }
.card-body { padding: 18px; }

/* Subtle table */
.t-data { width: 100%; font-size: 14px; border-collapse: separate; border-spacing: 0; }
.t-data th {
  text-align: left;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  padding: 10px 16px;
  background: #fbf9f3;
  border-bottom: 1px solid var(--line);
}
.t-data th.num { text-align: right; }
.t-data td {
  padding: 11px 16px;
  border-bottom: 1px solid #f3eee2;
  font-variant-numeric: tabular-nums;
}
.t-data tr:last-child td { border-bottom: none; }
.t-data tbody tr { transition: background .12s ease; }
.t-data tbody tr:hover { background: #fbf9f3; }
.t-data td.num { text-align: right; }

/* Score chip — color codifica desempeño */
.score {
  display: inline-flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.score--bad   { color: #b8302a; }
.score--low   { color: #c1612a; }
.score--mid   { color: #8a6a1a; }
.score--good  { color: #4f6635; }
.score--none  { color: var(--ink-mute); }

/* Badge / role chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-mute);
}
.chip--petrol { background: #e6eff1; color: #0a3540; border-color: #c4d8dd; }
.chip--clay   { background: #f5e6e3; color: #842c24; border-color: #e6c4be; }
.chip--olive  { background: #eef0e5; color: #4a5930; border-color: #d3d9bd; }

/* Link / hover affordances */
a.link {
  color: var(--petrol);
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
a.link:hover { text-decoration: underline; text-decoration-color: var(--petrol); }

/* Sticky nav glass */
.nav-glass {
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

/* Filter bar — sticky pill that floats below the nav */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-pill:hover { border-color: #c4d8dd; box-shadow: 0 1px 3px rgba(15,76,92,0.08); }
.filter-pill.active {
  background: #e6eff1;
  border-color: #c4d8dd;
}
.filter-pill .close-x {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  color: var(--ink-mute);
  transition: background .12s ease;
}
.filter-pill .close-x:hover { background: rgba(15,76,92,0.12); color: var(--petrol); }

/* Section header style */
.section-h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 144;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.section-h1 em { font-style: italic; font-weight: 400; color: var(--petrol); }
.section-sub { color: var(--ink-mute); margin-top: 6px; font-size: 14px; max-width: 60ch; }

/* Severity rails for the recommendation cards */
.sev-high   { border-left: 3px solid var(--clay); }
.sev-medium { border-left: 3px solid #c98d2e; }
.sev-low    { border-left: 3px solid #c2b06e; }
.sev-tag-high   { color: #842c24; }
.sev-tag-medium { color: #8a5e1f; }
.sev-tag-low    { color: #7a6720; }

/* Inputs */
.input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus {
  outline: none;
  border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15,76,92,0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--petrol);
  color: #fff;
  border: 1px solid var(--petrol);
  transition: background .12s ease, transform .08s ease;
}
.btn:hover { background: #0a3540; }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: #fbf9f3; }
.btn--danger {
  background: transparent;
  color: var(--clay);
  border-color: transparent;
  padding: 6px 8px;
}
.btn--danger:hover { background: #f5e6e3; }

/* Sparkline / chart container */
.chart-h-260 { height: 260px; }
.chart-h-300 { height: 300px; }

/* Decorative rule */
.hr-display {
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  margin: 24px 0;
}

/* Print-friendly */
@media print {
  body { background: #fff; }
  .nav-glass, .filter-bar { display: none; }
}
