/* ============================================================================
   STIRLING — premium British brand layer ("The Quiet Boardroom")
   Craig 2026-06-07. Loaded AFTER styles.css by the Stirling operational pages
   (index.html ops wall, digital-twin.html, timesheets.html). Pure re-skin:
   no selector that JS creates or queries is renamed; data hooks untouched.

   The voice: a well-run British institution. Ivory paper, forest ink, brass
   used the way a good tailor uses it — sparingly, where your eye should go.
   Serif headlines (Fraunces), humanist body (Manrope), tabular figures.
   Values are part of the chrome: evidence before opinion, honest estimates,
   no personal data. Brand by presence, not repetition.
   ========================================================================== */

:root {
  /* Retire the generic teal — Stirling speaks forest + brass. */
  --accent: #1f4d3c;
  --accent-soft: #e6eedd;
  --bg: #f2efe6;
  --panel: #fffefa;
  --border: #d9d3c4;
  --ink: #16261e;
  --muted: #5b6a61;
  --deep: #123328;
  --shadow: 0 10px 28px rgba(18, 51, 40, 0.07);

  --st-forest: #1f4d3c;
  --st-forest-d: #123328;
  --st-moss: #97bc62;
  --st-moss-ink: #5a7a3a;
  --st-sage: #c8d4ce;
  --st-cream: #f7f4ec;
  --st-brass: #c4993a;
  --st-brass-soft: #f1e6c8;
}

/* ---------- paper ---------- */
body {
  background:
    radial-gradient(1200px 380px at 50% -120px, rgba(31, 77, 60, 0.10), transparent 70%),
    linear-gradient(180deg, #f4f1e8 0%, var(--bg) 240px);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- the hero becomes a forest masthead with a brass keel ---------- */
.hero,
.twin-body .hero-twin {
  background: linear-gradient(160deg, var(--st-forest) 0%, var(--st-forest-d) 100%);
  border: 0;
  border-bottom: 1px solid rgba(196, 153, 58, 0.55);
  box-shadow: 0 18px 40px -22px rgba(18, 51, 40, 0.55);
  position: relative;
}
.hero::after,
.twin-body .hero-twin::after {
  /* the keel: one fine brass line, slightly inset — the signature */
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 153, 58, 0.6) 12%, rgba(196, 153, 58, 0.6) 88%, transparent);
  pointer-events: none;
}
.hero h1,
.twin-body .hero-twin h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stirling-wordmark { font-family: "Fraunces", Georgia, serif; font-weight: 700; }
.eyebrow,
.stamp-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- panels: hairline + air, headline gets the brass tick ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(18, 51, 40, 0.04);
}
.panel-head { border-bottom: 1px solid #e7e2d4; }
.panel-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  color: var(--st-forest-d);
  position: relative;
  padding-left: 0;
}
.panel-head h2::after {
  /* the brass tick — 26px of gold under every headline, nothing more */
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin-top: 8px;
  background: var(--st-brass);
  border-radius: 1px;
}
.panel-head p { color: var(--muted); }

/* ---------- figures are typeset like a ledger ---------- */
.kpi-value,
.metric-value,
.stamp-value,
.twin-appts-kpi strong,
table td {
  font-variant-numeric: tabular-nums;
}
.kpi-value { font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.kpi-label,
.metric-label,
th {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- retire the last of the teal on Stirling surfaces ---------- */
.call-agent-bar-fill { background: linear-gradient(90deg, var(--st-forest), var(--st-moss)); }
.gauge-teal { --gauge-fill: var(--st-forest); }
.mini-sparkline-teal .mini-sparkline-path { stroke: var(--st-forest); }

/* ---------- controls: hairline rests, brass when chosen ---------- */
.sga-period-btn,
.twin-date-step {
  border-color: var(--border);
  color: var(--muted);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.sga-period-btn:hover { border-color: var(--st-brass); color: var(--ink); }
.sga-period-btn.is-active {
  background: var(--st-brass);
  border-color: var(--st-brass);
  color: var(--st-forest-d);
  font-weight: 700;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--st-brass);
  outline-offset: 2px;
}

/* ---------- tables: rules like a printed report ---------- */
table th { color: var(--muted); font-weight: 700; }
.stirling-texts-table th { border-bottom: 1px solid #d9d3c4; }
.stirling-texts-table td { border-bottom: 1px solid #efebe0; }

/* ---------- the values strap: corporate values as chrome ---------- */
.stirling-values {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 22px 24px 30px;
  border-top: 1px solid #ddd6c6;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  color: #6b7a70;
}
.stirling-values .stirling-values-mark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--st-forest);
}
.stirling-values .stirling-values-mark span { color: var(--st-brass); }
.stirling-values em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stirling-values em + em::before {
  content: "·";
  color: var(--st-brass);
  margin-right: 26px;
}
.stirling-values .stirling-values-co {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.04em;
}
@media (max-width: 760px) {
  .stirling-values .stirling-values-co { margin-left: 0; }
}

/* ---------- twin-specific refinements (scoped, JS hooks untouched) ---------- */
.twin-body .stirling-view-toggle { border-color: rgba(196, 153, 58, 0.7); }
.stirling-view-toggle button {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
}
.twin-date-input { font-family: "Manrope", system-ui, sans-serif; }
.twin-body .twin-heatmap-cell { border-radius: 2px; }
.twin-body .usage-chart-summary .metric,
.usage-chart-summary .metric { border-color: #e7e2d4; }

/* attention/alert styling stays semantically red/amber — just warmed */
.metric.is-alert .metric-value { color: #9a3412; }

/* skeleton shimmer in brand tones */
.lds-skeleton {
  background: linear-gradient(90deg, #ece7da 25%, #f6f2e7 37%, #ece7da 63%);
}
