/* Dataviz reference palette, light mode — roles defined once, used by class. */
:root {
  --page: #f8f7f4;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --series: #2a78d6;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --critical: #d03b3b;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
}

.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 16px; }

/* header */
.h1 { font-size: 22px; font-weight: 650; margin: 0; }
.header-row { display: flex; align-items: baseline; gap: 12px; }
.freshness { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.window-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge { font-weight: 600; }
.badge-live { color: var(--good-text); }
.badge-cached { color: var(--critical); }
.badge-skipped { color: var(--muted); }   /* cache used on purpose (--no-fetch): informational, not an error */
.badge-stale { color: #8a5a00; }

/* page nav (internal ↔ client) */
.nav { display: flex; gap: 14px; font-size: 13px; padding: 4px 4px 0; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink-2); }
.nav a.nav-active { color: var(--ink); font-weight: 600; }

/* client header (no fetch mechanics, no campaign name) */
.client-head { border-bottom: 1px solid var(--grid); padding-bottom: 12px; }
.client-sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; }

/* cards & tiles */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 980px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 24px; font-weight: 600; margin: 2px 0; } /* proportional figures */
.tile-delta { font-size: 13px; }
.tile-when { color: var(--muted); font-size: 11px; }
.tile-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--critical); }
.delta.neutral { color: var(--ink-2); }

/* chips & pills — status always icon + word, never color alone */
.chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.chip-good { background: rgba(12, 163, 12, 0.12); color: var(--good-text); }
.chip-warn { background: rgba(250, 178, 25, 0.18); color: #8a5a00; }
.chip-crit { background: rgba(208, 59, 59, 0.12); color: var(--critical); }
.chip-neutral { background: rgba(11, 11, 11, 0.06); color: var(--ink-2); }

.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; flex: 1;
}
.pill-label { font-size: 13px; color: var(--ink-2); }
.pill-state { font-size: 13px; font-weight: 650; }
.pill-ok { color: var(--good-text); }
.pill-flag { color: var(--critical); }
.lever-detail { font-size: 12px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }

/* charts */
.charts-row { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 980px) { .charts-row { grid-template-columns: 1fr; } }
.spend-col { display: flex; flex-direction: column; gap: 10px; }
.chart { width: 100%; }
.pacing-slot .tile { width: auto; }

/* tables */
.tables-row { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .tables-row { grid-template-columns: 1fr; } }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); padding: 6px 8px;
  border-bottom: 1px solid var(--grid);
}
.data-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.waste-line { font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.note { padding: 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------------------------------------------------------- fleet view */
.fleet-table td { vertical-align: top; padding: 10px 8px; }
.fleet-row-broken td { background: rgba(208, 59, 59, 0.05); }
.fleet-alert { font-size: 12px; color: var(--critical); line-height: 1.5; white-space: nowrap; }
.fleet-links { white-space: nowrap; font-size: 13px; }
.fleet-links a { color: var(--series); text-decoration: none; }
.fleet-links a:hover { text-decoration: underline; }

/* ============================================================= *
 *  Client weekly report (/client) — Marban redesign             *
 *  Monochrome foundation + one brand accent. Fully scoped under  *
 *  .wr so it never touches the internal dashboard pages. Accent  *
 *  + ramp arrive as inline CSS custom properties on .wr-sheet.   *
 * ============================================================= */
.wr {
  --paper: #eceae4; --sheet: #ffffff;
  --ink: #1a1a1a; --ink-2: #4a4a48; --muted: #6b6b6b;
  --line: #e5e4df; --line-2: #f2f1ec; --neutral-bg: rgba(26,26,26,.06);
  --good: #0d6655; --good-bg: rgba(13,102,85,.12);
  --bad: #b1503f; --bad-bg: rgba(177,80,63,.12);
  /* Pine Lines brand. Values read from the live pinelines.eu computed styles,
     not from the repo source (which still carries a stale lime palette).
       teal  #0d6655 = the CTA fill        ink   #1a1a1a
       muted #6b6b6b                        page  #f8f7f4
       line  #e5e4df                        type  Poppins + Source Serif 4
     The logo SVG is #006551, a hair off this teal; the difference is not
     perceptible side by side, so the brand asset is used unmodified. */
  --accent: #0d6655; --alte: #eceae4;
  --a1: #0d6655; --a2: #3f8878; --a3: #74ab9e; --a4: #a9cdc4; --a5: #d7e6e1;
  --hero-bg: #eef4f2; --hero-border: #d7e6e1;
  --display: "Poppins", "Century Gothic", system-ui, sans-serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  background: var(--paper); padding: 40px 20px 72px;
  font-family: var(--sans); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.wr-sheet {
  max-width: 840px; margin: 0 auto; background: var(--sheet);
  border-radius: 2px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 24px 60px -30px rgba(0,0,0,.35);
}
.wr-accentbar { height: 5px; background: var(--accent); }
.wr-pad { padding: 52px 56px; }

.wr-kpi-val, .wr-prod-val, .wr-period-b, .wr-hero-num,
.wr-figtable, .wr-rt-bar { font-variant-numeric: tabular-nums; }

/* agency lockup */
.wr-logo { display: inline-flex; align-items: stretch; font-family: var(--display); font-size: 15px; line-height: 1; }
.wr-logo-word { font-weight: 400; letter-spacing: .20em; color: var(--ink); padding: 5px 11px 5px 2px; display: flex; align-items: center; }
.wr-logo-block { background: var(--ink); color: #fff; font-weight: 400; letter-spacing: .20em; padding: 5px 11px; display: flex; align-items: center; }
.wr-logo.sm { font-size: 12px; }
.wr-logo.sm .wr-logo-word { letter-spacing: .18em; padding: 4px 9px 4px 2px; }
.wr-logo.sm .wr-logo-block { letter-spacing: .18em; padding: 4px 9px; }
.wr-logo-img { max-height: 34px; max-width: 190px; object-fit: contain; }
.wr-logo-img.sm { max-height: 24px; max-width: 150px; }

.wr-cap { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-top: 12px; max-width: 70ch; }
.wr-lead { font-size: 13px; line-height: 1.55; color: var(--muted); margin: -4px 0 18px; max-width: 70ch; }

/* masthead */
.wr-mast-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.wr-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); padding-top: 6px; }
.wr-client { font-family: var(--display); font-weight: 500; font-size: 48px; line-height: 1.02; letter-spacing: .02em; text-transform: uppercase; margin: 26px 0 0; }
.wr-period { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.wr-period-b { font-weight: 600; color: var(--ink); }
.wr-period-vs { color: var(--muted); }
.wr-mast-rule { height: 2px; margin-top: 22px; background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 30%, var(--line) 30%, var(--line) 100%); }

/* section scaffolding */
.wr-sec { margin-top: 46px; }
.wr-sec:first-child { margin-top: 0; }
.wr-sec-label { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); margin-bottom: 16px; display: flex; align-items: center; }
.wr-sec-label::before { content: ""; width: 7px; height: 7px; background: var(--accent); margin-right: 11px; flex: none; }
.wr-sec-sub { margin-left: 10px; letter-spacing: .02em; text-transform: none; font-weight: 400; color: var(--muted); }

/* verdict hero */
.wr-hero { margin-top: 34px; display: grid; grid-template-columns: 1fr 300px; gap: 34px; align-items: center; background: var(--hero-bg); border: 1px solid var(--hero-border); color: var(--ink); border-radius: 3px; padding: 34px 36px; }
.wr-hero-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.wr-hero-head { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.22; letter-spacing: .005em; color: var(--ink); }
.wr-hero-sub { margin-top: 15px; font-size: 14.5px; line-height: 1.58; color: var(--ink-2); max-width: 42ch; }
.wr-hero-fig { text-align: center; }
.wr-hero-fig-label { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wr-hero-num { font-family: var(--display); font-weight: 400; font-size: 84px; line-height: .9; letter-spacing: .005em; color: var(--accent); margin: 8px 0 20px; }
.wr-seal { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.wr-seal.over { color: var(--good); background: var(--good-bg); }
.wr-seal.under { color: #8a5a00; background: rgba(250,178,25,.16); }
.wr-hero-bullet { margin-top: 16px; }
.wr-bullet { width: 100%; height: 40px; }
.wr-hero-cap { font-size: 11px; line-height: 1.5; color: var(--muted); margin-top: 12px; }

/* KPI grid */
.wr-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.wr-kpi { border: 1px solid var(--line); border-radius: 3px; padding: 16px 18px; min-height: 150px; display: flex; flex-direction: column; }
.wr-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wr-kpi-val { font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1; margin: 12px 0 0; color: var(--ink); }
.wr-kpi-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.wr-kpi-prior { font-size: 12px; color: var(--muted); }
.wr-kpi-def { font-size: 11px; line-height: 1.45; color: var(--muted); margin-top: auto; padding-top: 12px; }

/* chips */
.wr-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.wr-chip.good { color: var(--good); background: var(--good-bg); }
.wr-chip.bad { color: var(--bad); background: var(--bad-bg); }
.wr-chip.neutral { color: var(--ink-2); background: var(--neutral-bg); }
.wr-chip.sm { font-size: 11px; padding: 1px 7px; }

/* money story */
.wr-money-stmt { font-family: var(--display); font-size: 24px; font-weight: 400; line-height: 1.32; color: var(--ink); margin-bottom: 22px; }
.wr-money-stmt b { font-weight: 600; color: var(--accent); }
.wr-rt-bar { position: relative; height: 52px; border-radius: 3px; overflow: hidden; background: var(--accent); display: flex; align-items: center; }
.wr-rt-invested { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bad); border-right: 2px solid var(--sheet); }
.wr-rt-tag { position: absolute; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: #fff; }
.wr-rt-tag.inv { left: 14px; }
.wr-rt-tag.gen { right: 18px; }
.wr-rt-legend { display: flex; gap: 26px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.wr-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.wr-sw.bad { background: var(--bad); }
.wr-sw.accent { background: var(--accent); }
.wr-rt-legend b { color: var(--ink); font-weight: 600; }

/* prose */
.wr-prose { font-size: 15.5px; line-height: 1.68; color: var(--ink-2); max-width: 64ch; }
.wr-prose p { margin: 0 0 14px; }
.wr-prose p:last-child { margin-bottom: 0; }
.wr-prose strong { color: var(--ink); font-weight: 600; }

/* products: donut + list */
.wr-prod-top { display: grid; grid-template-columns: 190px 1fr; gap: 30px; align-items: center; margin-bottom: 22px; }
.wr-donut { width: 190px; height: 190px; }
.wr-prod-context-big { font-family: var(--display); font-size: 22px; font-weight: 400; color: var(--ink); line-height: 1.28; }
.wr-prod-context .wr-cap { margin-top: 10px; }
.wr-prod { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
.wr-prod:last-child { border-bottom: none; }
.wr-prod-rank { width: 26px; height: 26px; border-radius: 2px; font-family: var(--display); font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: center; color: #fff; }
.wr-prod-rank.rk1 { background: var(--a1); } .wr-prod-rank.rk2 { background: var(--a2); } .wr-prod-rank.rk3 { background: var(--a3); }
.wr-prod-rank.rk4 { background: var(--a4); color: var(--ink); } .wr-prod-rank.rk5 { background: var(--a5); color: var(--ink); }
.wr-prod-main { min-width: 0; }
.wr-prod-name { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-prod-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.wr-prod-val { font-family: var(--display); font-size: 17px; font-weight: 500; color: var(--ink); min-width: 84px; text-align: right; }

/* plan (Ce urmează) */
.wr-done-block { background: rgba(63,122,99,.06); border: 1px solid rgba(63,122,99,.20); border-radius: 3px; padding: 15px 18px; margin-bottom: 16px; }
.wr-done-title { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--good); margin-bottom: 11px; }
.wr-done-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wr-done-list li { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; }
.wr-done-list .ck { color: var(--good); font-weight: 700; flex: none; }
.wr-recs { display: flex; flex-direction: column; gap: 14px; }
.wr-rec { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 3px; padding: 16px 18px; }
.wr-rec-n { font-family: var(--display); font-size: 24px; font-weight: 400; color: var(--accent); line-height: 1; }
.wr-rec-b { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.wr-rec-b p { margin: 0; }
.wr-rec-b strong { color: var(--ink); font-weight: 600; }

/* complete figures table */
.wr-figtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wr-figtable th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--ink); }
.wr-figtable td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.wr-figtable tr:last-child td { border-bottom: none; }
.wr-figtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.wr-figtable .prior { color: var(--muted); }
.wr-figtable .g { color: var(--good); font-weight: 600; }
.wr-figtable .b { color: var(--bad); font-weight: 600; }
.wr-figtable .n { color: var(--ink-2); font-weight: 600; }

/* colophon */
.wr-colophon { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.wr-colophon-line { font-size: 13px; color: var(--ink-2); }
.wr-colophon-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* responsive */
@media (max-width: 820px) {
  .wr-pad { padding: 34px 24px; }
  .wr-hero { grid-template-columns: 1fr; }
  .wr-kpis { grid-template-columns: repeat(2,1fr); }
  .wr-prod-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .wr-client { font-size: 38px; }
}
@media print {
  .wr { background: #fff; padding: 0; }
  .wr-sheet { box-shadow: none; max-width: 100%; }
  .wr-sec, .wr-hero, .wr-prod, .wr-rec { break-inside: avoid; }
}

/* --- Pine Lines: serif for narrative prose, per the live site's pairing --- */
.wr .wr-lead, .wr .wr-hero-sub, .wr .wr-prose, .wr .wr-cap {
  font-family: var(--serif);
}
.wr .wr-lead { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.wr .wr-cap { font-size: 12.5px; line-height: 1.55; }
.wr .wr-hero-sub { font-size: 15px; }
/* the masthead lockup is now a real logo, not a type treatment */
.wr .wr-logo-img { height: 30px; width: auto; display: block; }
