:root {
  --ink: #0b0f1a;
  --ink-soft: #1a2130;
  --mist: rgba(255, 255, 255, 0.78);
  --fog: rgba(255, 255, 255, 0.6);
  --glow: #f2c47e;
  --accent: #65d1b6;
  --accent-2: #f07b5a;
  --surface: rgba(14, 21, 33, 0.82);
  --surface-strong: rgba(16, 26, 40, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(8, 12, 20, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Karla', system-ui, sans-serif;
  background: radial-gradient(circle at top right, #1c2738 0%, #0a101d 45%, #080c14 100%);
  color: var(--mist);
  min-height: 100vh;
  padding: 48px clamp(20px, 4vw, 56px) 40px;
  position: relative;
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="140" height="140" filter="url(%23n)" opacity="0.18"/%3E%3C/svg%3E');
  mix-blend-mode: soft-light;
  opacity: 0.3;
}

.glow {
  position: fixed;
  inset: -30% -10% auto auto;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(242, 196, 126, 0.35), transparent 70%);
  filter: blur(0px);
  opacity: 0.6;
  pointer-events: none;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 36px;
  animation: fadeUp 0.9s ease-out both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: var(--fog);
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(101, 209, 182, 0.7);
}

.hero-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 4vw, 56px);
  color: #fff4e6;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  max-width: 520px;
  margin-top: 10px;
  color: var(--fog);
  font-size: 15px;
  line-height: 1.5;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(101, 209, 182, 0.12);
  border: 1px solid rgba(101, 209, 182, 0.35);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pill.warn {
  background: rgba(242, 196, 126, 0.15);
  border-color: rgba(242, 196, 126, 0.4);
  color: var(--glow);
}

.pill.alert {
  background: rgba(240, 123, 90, 0.18);
  border-color: rgba(240, 123, 90, 0.5);
  color: var(--accent-2);
}

.timestamp {
  font-size: 12px;
  color: var(--fog);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: fadeUp 0.9s ease-out both;
}

.panel.wide {
  grid-column: span 2;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f6efe4;
}

.panel-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.kpi-label {
  font-size: 12px;
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-value {
  font-size: 22px;
  font-weight: 600;
  color: #fff8f1;
  margin-top: 6px;
}

.sparkline-card {
  background: var(--surface-strong);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sparkline-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sparkline-caption {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
}

#sparkline {
  width: 60%;
  height: 80px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fog);
}

.metric-value {
  font-size: 18px;
  font-weight: 600;
  color: #fef2df;
  margin-top: 4px;
}

.metric-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--glow));
  border-radius: 999px;
  transition: width 0.6s ease;
}

.fairness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.fairness-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px;
}

.panel-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--fog);
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.report-item strong {
  color: #fff;
  font-weight: 600;
}

.footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .panel.wide {
    grid-column: span 1;
  }

  .sparkline-card {
    flex-direction: column;
    align-items: flex-start;
  }

  #sparkline {
    width: 100%;
  }
}
