/* Energie-platform — Apple Health-leunend papier-palet (skill §4). */

:root {
  /* Papier */
  --bg-app:        #f6f3ec;
  --bg-card:       #fbfaf6;
  --bg-card-hover: #f1ede4;
  --bg-elevated:   #ece7db;

  /* Graphite ink */
  --ink:           #1f1c18;
  --ink-soft:      #6a655d;
  --ink-fainter:   #aaa49a;
  --line:          #e2dccd;
  --line-strong:   #c5bdac;

  /* Apple Health-zachte accenten */
  --c-import:      #ad5b2a;
  --c-import-soft: #f0d8c1;
  --c-export:      #5c8769;
  --c-export-soft: #d4e4d7;
  --c-gas:         #934646;
  --c-gas-soft:    #e8cdcd;
  --c-water:       #4a6c8f;
  --c-water-soft:  #cdd9e4;

  --c-good:        #4b7758;
  --c-warn:        #a35e35;
  --c-info:        #635c52;

  --radius-lg: 24px;
  --radius:    20px;
  --radius-sm: 14px;

  --gap:         32px;
  --section-gap: 96px;
  --maxw:        1080px;
  --maxw-wide:   1280px;
}

/* Géén auto-dark-mode — donker modus alleen via expliciete toggle later. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg-app);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Inter", ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.012em; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-import); }

button {
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

/* ---------- Top bar ---------- */
.top {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 40px 40px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}
.top__brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.top__nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.top__nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 200ms cubic-bezier(.2,.8,.2,1), color 200ms;
}
.top__nav a:hover { color: var(--ink); background: var(--bg-elevated); }
.top__nav a.is-active { color: var(--ink); background: var(--bg-elevated); }
.top__peil {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .top { grid-template-columns: 1fr; padding: 28px 24px 0; }
}

/* ---------- Filterbar ---------- */
.filterbar {
  max-width: var(--maxw-wide);
  margin: 28px auto 0;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.filterbar__presets {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 0;
}
.filterbar__presets button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 7px 16px;
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-weight: 500;
  border-radius: 999px;
  transition: background 200ms, color 200ms;
}
.filterbar__presets button:hover { color: var(--ink); }
.filterbar__presets button.is-active { color: var(--ink); background: var(--bg-elevated); }
.filterbar__nav {
  display: inline-flex;
  gap: 4px;
}
.filterbar__nav button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  font-size: 1rem;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 200ms, background 200ms;
}
.filterbar__nav button:hover:not(:disabled) { color: var(--ink); background: var(--bg-elevated); }
.filterbar__nav button:disabled { opacity: 0.3; cursor: not-allowed; }
.filterbar__year {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.filterbar__year select {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--ink);
  padding: 4px 18px 4px 6px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.filterbar__label {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- App layout ---------- */
.app {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 56px 40px 96px;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  animation: fadein 280ms cubic-bezier(.2,.8,.2,1);
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.loading {
  text-align: center;
  color: var(--ink-soft);
  padding: 120px 0;
}

/* Page-title strip */
.pagehead {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 60ch;
}
.pagehead__title { font-size: 1.625rem; font-weight: 600; letter-spacing: -0.012em; }
.pagehead__lead {
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- Hero — één dominant cijfer, geen 4-KPI-strook ---------- */
.hero-mono {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 0;
}
.hero-mono__number {
  font-size: 4.5rem;
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-mono__number .unit {
  font-size: 1.25rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 12px;
  letter-spacing: 0;
}
.hero-mono__caption {
  font-size: 1.0625rem;
  color: var(--ink);
  max-width: 60ch;
  line-height: 1.55;
  font-weight: 400;
}
.hero-mono__sub {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.55;
}

/* Editorial alinea */
.editorial {
  max-width: 65ch;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
}
.editorial h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 12px;
  font-weight: 600;
}
.editorial p { margin: 0 0 14px; }
.editorial p:last-child { margin-bottom: 0; }
.editorial em { font-style: normal; color: var(--ink); font-weight: 500; }
.editorial .num {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.editorial .spark {
  display: inline-block;
  width: 80px;
  height: 18px;
  vertical-align: middle;
  margin: 0 4px;
}

/* Asymmetrische supporting tiles — niet 4 op een rij */
.tiles {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: background 200ms;
}
.tile:hover { background: var(--bg-card-hover); }
.tile__label {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.tile__number {
  font-size: 2.25rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.022em;
  margin-top: 12px;
}
.tile__number .unit {
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 6px;
}
.tile__caption {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.5;
}

/* Bredere asymmetrische blokken — voor één big + 2 kleine */
.tile--wide { grid-column: span 1; }
.tile--feature .tile__number { font-size: 3rem; font-weight: 200; }

/* ---------- Compatibiliteit oude .hero (4 KPI) ---------- */
/* We laten 'm bestaan voor incidentele situaties; default niet meer in overzicht. */
.hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 1024px) { .hero { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .hero { grid-template-columns: 1fr; } }

.kpi {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: background 200ms;
}
.kpi:hover { background: var(--bg-card-hover); }
.kpi__label { font-size: 0.75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi__value {
  font-size: 2.25rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.022em;
  margin-top: 8px;
}
.kpi__unit {
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 6px;
  letter-spacing: 0;
}
.kpi__sub { font-size: 0.9375rem; color: var(--ink-soft); margin-top: 10px; line-height: 1.5; }
.kpi__delta {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 4px;
}
.kpi__delta--up   { color: var(--c-import); }
.kpi__delta--down { color: var(--c-export); }
.kpi__delta--flat { color: var(--ink-soft); }
.kpi__net--export { color: var(--c-export); }

.kpi--elektra, .kpi--export, .kpi--gas, .kpi--water, .kpi--neutral { /* géén border-accent meer */ }

.kpi__spark { position: absolute; right: 18px; bottom: 16px; width: 96px; height: 36px; opacity: 0.5; }

/* Insight-zin (Julius-pattern) */
.insight {
  font-size: 1.0625rem;
  color: var(--ink);
  max-width: 65ch;
  line-height: 1.55;
}

/* Banners — alleen voor échte alerts. NIET voor reguliere insights. */
.alert {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 65ch;
}

/* ---------- Cards rondom charts ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
}
.card__head {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.card__title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.005em; }
.card__sub   { font-size: 0.9375rem; color: var(--ink-soft); margin: 4px 0 0; max-width: 60ch; line-height: 1.5; }
.card__figure { margin: 0; }
.card__figure svg { max-width: 100%; height: auto; display: block; }
.card__export {
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 200ms;
  letter-spacing: 0.03em;
}
.card__export:hover { color: var(--c-import); }
.card .insight { margin: 0 0 16px 0; font-size: 1rem; }

.row { display: grid; gap: var(--gap); }
.row--2 { grid-template-columns: 1fr 1fr; }
.row--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .row--2, .row--3 { grid-template-columns: 1fr; }
}

/* Tabel */
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.table th:first-child, .table td:first-child { text-align: left; }
.table th {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-card-hover); }

.card--notes ul { margin: 0; padding: 0; list-style: none; }
.card--notes li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  display: flex; justify-content: space-between; gap: 16px;
}
.card--notes li:last-child { border-bottom: 0; }
.card--notes .note__what { color: var(--ink); }
.card--notes .note__when { color: var(--ink-soft); white-space: nowrap; }

/* Charts */
.chart { width: 100%; height: 380px; }
.chart--md  { height: 320px; }
.chart--sm  { height: 240px; }
.chart--lg  { height: 460px; }
.chart--ribbon { height: 160px; }

/* Year-ribbon — hero-visualisatie voor Overzicht */
.ribbon {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.ribbon__title {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  font-weight: 600;
}

/* ---------- Bottom ---------- */
.bottom {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 32px 40px 56px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
  gap: 24px;
  flex-wrap: wrap;
}

/* Weather chip */
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--ink-soft);
  background: var(--bg-card);
  font-variant-numeric: tabular-nums;
}
