/* Enrol Radar — design tokens layered over Bootstrap 5.
   Palette & type taken verbatim from the Claude Design handoff. */
:root {
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --border: #E4E1D8;
  --ink: #14161A;
  --ink2: #6B6F76;
  --accent: #FF5A36;
  --header-bg: #14161A;
  --header-muted: #B9BCC2;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.font-display { font-family: var(--font-display); }

/* --- Header --- */
.er-header {
  background: var(--header-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.er-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}
.er-subtitle { color: var(--header-muted); font-size: 12.5px; }

/* Segmented pill nav */
.er-nav {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.er-nav .er-nav-link {
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--header-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.er-nav .er-nav-link:hover { color: #fff; }
.er-nav .er-nav-link.active { background: var(--accent); color: #fff; }

/* --- Cards / surfaces --- */
.er-main { flex: 1 0 auto; }
.er-container { max-width: 1360px; }
.er-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.er-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0;
}
.er-eyebrow {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink2);
}

/* KPI cards */
.er-kpi { border-radius: 16px; padding: 20px 22px; border: 1px solid var(--border); }
.er-kpi-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  margin-top: 6px;
  line-height: 1.1;
}
.er-kpi-num .er-kpi-pct { font-size: 16px; font-weight: 600; }

/* Whitespace banner */
.er-banner {
  background: linear-gradient(135deg, #FFE9E2, #FFF3EE);
  border: 1.5px solid #FFC7B4;
  border-radius: 20px;
  padding: 26px 30px;
}
.er-banner-head { font-family: var(--font-display); font-weight: 700; font-size: 22px; }

/* Buttons / pills */
.er-btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: filter 150ms ease-out;
}
.er-btn-accent:hover { color: #fff; filter: brightness(0.94); }
.er-btn-dark {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-block;
}
.er-btn-dark:hover { color: #fff; filter: brightness(1.4); }

/* Status / info pills */
.er-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
  font-size: 12.5px;
  color: #fff;
}
.er-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
}

/* Bars (composition + stacked breakdowns) */
.er-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #EFEDE7;
  overflow: hidden;
}
.er-bar-fill { height: 100%; }
.er-stack {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #EFEDE7;
}
.er-stack-seg { height: 100%; }
.er-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
}

/* Donut (CSS conic-gradient) */
.er-donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.er-donut-hole {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
}
.er-donut-num { font-family: var(--font-display); font-weight: 700; font-size: 26px; }

/* Table */
.er-table { --bs-table-bg: transparent; margin: 0; }
.er-table thead th {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.er-table thead th a { color: inherit; text-decoration: none; }
.er-table thead th a:hover { color: var(--ink); }
.er-table tbody tr { cursor: pointer; }
.er-table tbody tr:hover { background: #FBFAF7; }
.er-table td { vertical-align: middle; font-size: 14px; border-color: var(--border); }
.er-num { font-family: var(--font-display); font-weight: 600; }

/* Detail page */
.er-detail-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.er-callout {
  background: #FBF2E1;
  border: 1px solid #F0DDAE;
  border-radius: 12px;
  padding: 12px 14px;
  color: #8A6414;
  font-size: 13px;
}
.er-stat-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg);
}
.er-stat-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; }

/* Footer */
.er-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  color: var(--ink2);
  font-size: 12.5px;
  background: var(--surface);
}

/* --- Dashboard drill-through interactivity --- */
.er-drill-label { color: var(--ink); text-decoration: none; }
.er-drill-label:hover { color: var(--accent); text-decoration: underline; }
.er-drill-row { border-radius: 8px; margin-left: -8px; margin-right: -8px; padding-left: 8px; padding-right: 8px; transition: background 120ms ease-out; }
.er-drill-row:hover { background: #FBFAF7; }

.er-kpi-link { text-decoration: none; display: block; cursor: pointer; transition: transform 120ms ease-out, box-shadow 120ms ease-out; }
.er-kpi-link:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 22, 26, 0.08); }

.er-legend-link { text-decoration: none; color: inherit; cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; transition: background 120ms ease-out; }
.er-legend-link:hover { background: #FBFAF7; }

.er-bar-link { text-decoration: none; color: inherit; display: block; border-radius: 8px; padding: 4px; margin: -4px; transition: background 120ms ease-out; }
.er-bar-link:hover { background: #FBFAF7; }

/* --- Map --- */
.er-map { height: 460px; border-radius: 12px; overflow: hidden; background: var(--bg); }
.er-map .leaflet-popup-content-wrapper { border-radius: 10px; }
.er-map-legend { font-size: 12.5px; }
