/* Executive KPIs — a PrimeLayer Solutions build.
   "Boardroom scorecard" theme: warm ivory, deep navy ink, gold rules, serif headings.
   Sample data shown for confidentiality. */

@font-face{font-family:"Playfair Display";src:url("/assets/fonts/playfair-latin.woff2") format("woff2");font-weight:100 900;font-display:swap;}
@font-face{font-family:"Inter";src:url("/assets/fonts/inter-latin.woff2") format("woff2");font-weight:100 900;font-display:swap;}

:root {
  /* --- surfaces --- */
  --surface-1: #ffffff;
  --page: #f7f4ec;
  --text-primary: #14233b;
  --text-secondary: #47526a;
  --muted: #6b7688;
  --gridline: #ece6d8;
  --baseline: #cdc5b2;
  --border: #e7e1d3;
  --hairline: #e7e1d3;
  --shadow: 0 1px 2px rgba(20,35,59,.05), 0 10px 30px -12px rgba(20,35,59,.14);
  --shadow-lift: 0 2px 4px rgba(20,35,59,.06), 0 22px 46px -18px rgba(20,35,59,.22);

  --good: #0f766e;
  --bad: #b91c1c;

  /* gold accent */
  --gold: #b08d3c;
  --gold-bright: #cda94e;
  --navy: #14233b;

  /* --- chart series (navy / teal / gold family) --- */
  --s1: #14233b;  /* navy — primary line, donut Enterprise, default bar */
  --s2: #0f766e;  /* teal — positive / New MRR / spark up */
  --s3: #b08d3c;  /* gold — donut SMB */
  --s4: #3a5a7d;  /* steel blue */
  --s5: #4c6b8a;  /* muted steel — customers line */
  --s6: #b91c1c;  /* red — churn / spark down */
  --s7: #8a6d3b;  /* bronze */
  --s8: #52607a;  /* slate */

  /* --- goal-tracker status colors --- */
  --st-good: #0f766e; --st-warn: #b08d3c; --st-serious: #c2682d; --st-crit: #b91c1c;

  --radius: 6px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* ---- Top bar (removed at runtime by showcase-nav; styled for graceful fallback) ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-1);
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 6px;
  display: grid; place-items: center; color: var(--gold-bright); font-weight: 800; font-size: 15px;
  background: var(--navy);
}
.brand .sub { color: var(--muted); font-weight: 500; font-size: 13px; font-family: var(--font); }
.topbar .spacer { flex: 1; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--text-secondary); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
}
.nav a:hover { color: var(--text-primary); }
.nav a.active { color: var(--navy); border-bottom: 2px solid var(--gold); border-radius: 0; }
.updated { color: var(--muted); font-size: 12.5px; }

/* ---- Layout ---- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 40px 30px 72px; }

.page-head {
  margin: 4px 0 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 72px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}
.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05;
  color: var(--navy);
}
.page-head p { margin: 12px 0 0; color: var(--text-secondary); font-size: 15px; max-width: 60ch; }

.grid { display: grid; gap: 22px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 880px) { .cards-2, .cards-3 { grid-template-columns: 1fr; } }

/* ---- Cards ---- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease;
  animation: pl-rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card h3 {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 19px; font-weight: 700; letter-spacing: -.005em; color: var(--navy);
}
.card .hint { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.card.span-2 { grid-column: span 2; }
@media (max-width: 880px) { .card.span-2 { grid-column: span 1; } }

/* gentle staggered entrance */
.kpis .card:nth-child(1){animation-delay:.02s}
.kpis .card:nth-child(2){animation-delay:.06s}
.kpis .card:nth-child(3){animation-delay:.10s}
.kpis .card:nth-child(4){animation-delay:.14s}
.kpis .card:nth-child(5){animation-delay:.18s}
.kpis .card:nth-child(6){animation-delay:.22s}
@keyframes pl-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

/* ---- KPI tile ---- */
.kpi { display: flex; flex-direction: column; gap: 5px; }
.kpi::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent 80%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi .label {
  color: var(--muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
}
.kpi .value {
  font-family: var(--serif);
  font-size: 38px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  margin: 2px 0 1px;
}
.kpi .foot { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.delta { font-weight: 600; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.kpi .spark { margin-top: 6px; }

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--hairline); }
th {
  color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--navy);
}
td strong { font-weight: 600; color: var(--navy); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbf9f3; }

/* ---- Pills / status ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--hairline);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---- Chart chrome ---- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { fill: var(--muted); font-size: 11px; }
.axis line, .grid line { stroke: var(--gridline); stroke-width: 1; }
.baseline { stroke: var(--baseline); stroke-width: 1; }
.bar-val { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.legend .swatch { width: 11px; height: 11px; border-radius: 2px; }

/* tooltip */
.viz-tip {
  position: fixed; pointer-events: none; z-index: 50;
  background: var(--navy); color: #f4f0e6;
  border: 1px solid rgba(205,169,78,.35); border-radius: 8px;
  box-shadow: 0 16px 40px -12px rgba(20,35,59,.45); padding: 10px 12px; font-size: 12.5px;
  min-width: 120px; opacity: 0; transform: translateY(2px); transition: opacity .1s;
}
.viz-tip .t-title { font-family: var(--serif); font-weight: 700; margin-bottom: 6px; color: var(--gold-bright); }
.viz-tip .t-row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.viz-tip .t-row .k { display: inline-flex; align-items: center; gap: 6px; color: #c7cfda; }
.viz-tip .t-row .v { font-variant-numeric: tabular-nums; font-weight: 600; color: #f4f0e6; }
.viz-tip .swatch { width: 9px; height: 9px; border-radius: 2px; }

.foot-note {
  color: var(--muted); font-size: 12px; margin-top: 40px;
  padding-top: 20px; border-top: 1px solid var(--hairline);
  text-align: center; letter-spacing: .01em;
}
