/* =============================================================================
   GoldenOS design tokens
   =============================================================================

   Extracted, not designed. Every value below is lifted from the existing
   GoldenOS visual language rather than chosen fresh:

     - the :root block of `01 — VENTURES/GoldenOS/tools/GoldenOS Command Center.html`
       and its v2 successor — the paper and dark palettes, the gold ramp, the
       three type families, the shadow pair;
     - `02 — GOLDEN OS/goldenos-final-2026-10-29/DESIGN.md` — the reasoning
       behind the colour and space scales;
     - the Altura OS sub-theme, kept as a scoped override because Mama Loca has
       its own Santorini identity and the platform should not flatten it.

   This file replaces nothing. The dashboards keep working; this is the same
   language stated once so a new surface does not re-invent it.

   What is new here is exactly one component: the BASIS BADGE. It exists because
   the schema now distinguishes actual money from pipeline, forecast and
   illustration, and that distinction has to be visible or the constraint is
   only half-enforced. It is a formalisation of the `.sample` badge the Command
   Center already ships — "All figures are illustrative until live sources are
   connected" — promoted from one hand-placed pill to a token-level rule.
   ========================================================================== */

:root {
  box-sizing: border-box;

  /* ---- type ------------------------------------------------------------- */
  /* Unchanged from the Command Center. Bodoni for display, Bricolage for text,
     Martian Mono for figures that must line up. */
  --gos-serif: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --gos-sans: "Bricolage Grotesque", Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gos-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- paper (light) ---------------------------------------------------- */
  --gos-bg: #F2EFE8;
  --gos-bg-2: #E8E3D8;
  --gos-surface: #FBFAF6;
  --gos-surface-2: #F1EDE3;
  --gos-line: rgba(28, 25, 20, 0.12);
  --gos-text: #1A1814;
  --gos-muted: #6B655A;

  /* ---- gold ------------------------------------------------------------- */
  --gos-gold: #9A7B1E;
  --gos-gold-bright: #C9A646;
  --gos-gold-deep: #7A6118;
  --gos-gold-glow: rgba(201, 166, 70, 0.35);

  /* ---- state ------------------------------------------------------------ */
  --gos-good: #2E7D5B;
  --gos-warn: #B36E12;
  --gos-bad: #B9453F;
  --gos-info: #2F5FA8;

  /* ---- elevation and shape ---------------------------------------------- */
  --gos-shadow: 0 1px 2px rgba(20, 18, 12, 0.06), 0 10px 28px rgba(20, 18, 12, 0.07);
  --gos-radius-sm: 10px;
  --gos-radius: 16px;
  --gos-radius-lg: 20px;
  --gos-radius-xl: 28px;
  --gos-radius-pill: 999px;

  /* ---- space ------------------------------------------------------------
     The existing files use clamp() inline for page padding. Named here so a
     new surface does not invent a seventh spacing value. */
  --gos-space-1: 4px;
  --gos-space-2: 8px;
  --gos-space-3: 12px;
  --gos-space-4: 16px;
  --gos-space-5: 24px;
  --gos-space-6: 32px;
  --gos-space-7: 48px;
  --gos-pad-view: clamp(14px, 3vw, 32px);

  /* ---- basis ------------------------------------------------------------
     One colour per core.value_basis value. The enum and these four tokens are
     the same list; adding a basis to the database without adding a token here
     leaves a figure rendering in the default colour, which is why the mapping
     is asserted in design/tokens.ts. */
  --gos-basis-actual: var(--gos-text);
  --gos-basis-pipeline: var(--gos-info);
  --gos-basis-forecast: var(--gos-warn);
  --gos-basis-simulated: var(--gos-muted);
}

/* ---- dark ---------------------------------------------------------------
   Both the system-preference and the explicit [data-theme] forms, because the
   Command Center supports a manual toggle and the two must not drift. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gos-bg: #0F0E0C;
    --gos-bg-2: #161412;
    --gos-surface: #181613;
    --gos-surface-2: #201D19;
    --gos-line: rgba(212, 175, 55, 0.16);
    --gos-text: #F2EEE6;
    --gos-muted: #A39C8F;
    --gos-gold: #D4AF37;
    --gos-gold-bright: #F1DFA0;
    --gos-gold-deep: #8A6E1F;
    --gos-gold-glow: rgba(212, 175, 55, 0.45);
    --gos-good: #6CC6A6;
    --gos-warn: #E6A653;
    --gos-bad: #E57373;
    --gos-info: #8FB0E8;
    --gos-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 36px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --gos-bg: #0F0E0C;
  --gos-bg-2: #161412;
  --gos-surface: #181613;
  --gos-surface-2: #201D19;
  --gos-line: rgba(212, 175, 55, 0.16);
  --gos-text: #F2EEE6;
  --gos-muted: #A39C8F;
  --gos-gold: #D4AF37;
  --gos-gold-bright: #F1DFA0;
  --gos-gold-deep: #8A6E1F;
  --gos-gold-glow: rgba(212, 175, 55, 0.45);
  --gos-good: #6CC6A6;
  --gos-warn: #E6A653;
  --gos-bad: #E57373;
  --gos-info: #8FB0E8;
  --gos-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* =============================================================================
   Components
   ========================================================================== */

*, *::before, *::after { box-sizing: inherit; }

body.gos {
  margin: 0;
  background: var(--gos-bg);
  color: var(--gos-text);
  font-family: var(--gos-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.gos h1, .gos h2, .gos .display {
  font-family: var(--gos-serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0;
}

.gos :focus-visible {
  outline: 2px solid var(--gos-gold-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- panel ------------------------------------------------------------- */
.gos-panel {
  background: var(--gos-surface);
  border: 1px solid var(--gos-line);
  border-radius: var(--gos-radius-lg);
  padding: var(--gos-space-4) var(--gos-space-5);
  min-width: 0;
  box-shadow: var(--gos-shadow);
}

.gos-panel > h3 { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.gos-panel > .sub { margin: 0 0 var(--gos-space-3); font-size: 13px; color: var(--gos-muted); }

/* ---- kpi --------------------------------------------------------------- */
.gos-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gos-space-3);
}

.gos-kpi {
  background: var(--gos-surface);
  border: 1px solid var(--gos-line);
  border-radius: var(--gos-radius);
  padding: 14px 16px;
}

.gos-kpi .k { font-size: 12.5px; color: var(--gos-muted); }

.gos-kpi .v {
  /* Tabular figures, because a column of money that does not line up reads as
     carelessness and invites mistrust of the number itself. */
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2px 0;
}

.gos-kpi .why {
  font-size: 12.5px;
  color: var(--gos-muted);
  border-top: 1px dashed var(--gos-line);
  margin-top: var(--gos-space-2);
  padding-top: var(--gos-space-2);
}

.gos-up { color: var(--gos-good); }
.gos-down { color: var(--gos-bad); }
.gos-flat { color: var(--gos-muted); }

/* =============================================================================
   THE BASIS BADGE
   -----------------------------------------------------------------------------
   The one genuinely new component, and the rule it encodes:

     A figure whose basis is not 'actual' MUST carry a badge, and its value MUST
     be rendered in that basis's colour.

   `.gos-figure` without a `data-basis` attribute inherits the actual styling,
   which is the only default that is safe to get wrong in the other direction:
   if a developer forgets the attribute on a real figure, it renders normally;
   if they forget it on a simulated one, the [data-basis] selectors below do
   nothing and the figure looks real — so the API never returns a figure without
   its basis, and the component takes it as a required attribute.
   ========================================================================== */

.gos-figure {
  font-variant-numeric: tabular-nums;
  font-family: var(--gos-mono);
  color: var(--gos-basis-actual);
}

.gos-figure[data-basis="pipeline"]  { color: var(--gos-basis-pipeline); }
.gos-figure[data-basis="forecast"]  { color: var(--gos-basis-forecast); }
.gos-figure[data-basis="simulated"] { color: var(--gos-basis-simulated); font-style: italic; }

.gos-basis {
  display: inline-block;
  font-family: var(--gos-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--gos-radius-pill);
  border: 1px solid currentColor;
  vertical-align: 2px;
  margin-left: 6px;
  white-space: nowrap;
}

/* 'actual' gets no badge. Labelling real money "ACTUAL" everywhere trains the
   eye to ignore the badge, which is the one thing it must not do. */
.gos-basis[data-basis="actual"] { display: none; }
.gos-basis[data-basis="pipeline"]  { color: var(--gos-basis-pipeline); }
.gos-basis[data-basis="forecast"]  { color: var(--gos-basis-forecast); }
.gos-basis[data-basis="simulated"] {
  color: var(--gos-basis-simulated);
  border-style: dashed;
}

/* The panel-level version of the Command Center's `.sample` pill, for a whole
   card whose contents are illustrative. */
.gos-panel[data-basis="simulated"] {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--gos-muted) 55%, transparent);
}

.gos-panel[data-basis="simulated"]::before {
  content: "Illustrative — no live source connected";
  display: block;
  font-size: 12px;
  color: var(--gos-warn);
  margin-bottom: var(--gos-space-2);
}

/* ---- empty state -------------------------------------------------------
   Used where a module has no data because its integration has no credentials.
   An honest empty state, rather than a zero that looks like a measurement. */
.gos-empty {
  border: 1px dashed var(--gos-line);
  border-radius: var(--gos-radius);
  padding: var(--gos-space-5);
  text-align: center;
  color: var(--gos-muted);
  font-size: 13.5px;
}

.gos-empty b { display: block; color: var(--gos-text); margin-bottom: 4px; }

/* ---- pill / status ------------------------------------------------------ */
.gos-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--gos-radius-pill);
  border: 1px solid currentColor;
}

.gos-pill[data-tone="good"] { color: var(--gos-good); }
.gos-pill[data-tone="warn"] { color: var(--gos-warn); }
.gos-pill[data-tone="bad"] { color: var(--gos-bad); }
.gos-pill[data-tone="info"] { color: var(--gos-info); }
.gos-pill[data-tone="muted"] { color: var(--gos-muted); }

/* ---- the Golden callout ------------------------------------------------- */
.gos-golden {
  display: flex;
  gap: var(--gos-space-3);
  align-items: flex-start;
  background: color-mix(in srgb, var(--gos-gold) 9%, var(--gos-surface));
  border: 1px solid color-mix(in srgb, var(--gos-gold) 40%, transparent);
  border-radius: var(--gos-radius-lg);
  padding: 14px 16px;
}

.gos-golden .orb {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gos-gold-bright), var(--gos-gold) 60%);
  box-shadow: 0 0 14px var(--gos-gold-glow);
  margin-top: 2px;
}

.gos-golden b { display: block; font-size: 13px; color: var(--gos-gold); }

/* ---- approval card ----------------------------------------------------- */
.gos-approval {
  background: var(--gos-surface);
  border: 1px solid var(--gos-line);
  border-radius: var(--gos-radius-lg);
  padding: var(--gos-space-4);
}

.gos-approval .from {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gos-muted);
  margin-bottom: 6px;
}

.gos-approval h3 { font-size: 16px; margin: 0 0 4px; }
.gos-approval p { margin: 0 0 var(--gos-space-3); font-size: 13.5px; color: var(--gos-muted); }

.gos-approval .impact { display: flex; gap: var(--gos-space-4); flex-wrap: wrap; font-size: 12.5px; }
.gos-approval .impact b { font-variant-numeric: tabular-nums; }

.gos-approval[data-state="approved"] { border-color: color-mix(in srgb, var(--gos-good) 50%, transparent); }
.gos-approval[data-state="held"] { border-color: color-mix(in srgb, var(--gos-warn) 50%, transparent); }

.gos-btn {
  font: inherit;
  border: 1px solid var(--gos-line);
  background: var(--gos-surface-2);
  color: inherit;
  border-radius: var(--gos-radius-pill);
  padding: 8px 16px;
  cursor: pointer;
}

.gos-btn:hover { border-color: var(--gos-gold); }

.gos-btn[data-variant="primary"] {
  background: var(--gos-gold);
  border-color: var(--gos-gold);
  color: #1A1405;
  font-weight: 700;
}

/* ---- domain marker -----------------------------------------------------
   A life-domain surface is visibly different from a business one. Not
   decoration: the point is that a person glancing at a screen can tell which
   OS they are in, because the two must never be read as one dashboard. */
.gos[data-domain="life"] {
  --gos-gold: var(--gos-info);
  --gos-gold-bright: color-mix(in srgb, var(--gos-info) 70%, white);
  --gos-gold-glow: color-mix(in srgb, var(--gos-info) 35%, transparent);
}

.gos[data-domain="life"] .gos-domain-rule {
  border-top: 2px solid var(--gos-info);
}

/* =============================================================================
   Altura OS — Mama Loca's Santorini sub-theme
   -----------------------------------------------------------------------------
   Carried over from the Command Center's `.altura` block verbatim. Scoped, so
   it applies only inside an Altura surface and does not leak into the platform
   chrome. Mama Loca has its own identity and the platform's job is to host it,
   not to overwrite it.
   ========================================================================== */

.gos-altura {
  --gos-bg: #F7F4EE;
  --gos-surface: #FFFFFF;
  --gos-surface-2: #F1EDE4;
  --gos-line: #DED7C9;
  --gos-text: #162234;
  --gos-muted: #4A5568;
  --gos-gold: #B98B4B;
  --gos-info: #2481A2;
  --gos-bad: #8E2338;
  --altura-navy: #162234;
  --altura-sand: #C9A87C;
  font-family: "Jost", var(--gos-sans);
}

.gos-altura h1, .gos-altura h2, .gos-altura h3 {
  font-family: "Cormorant Garamond", var(--gos-serif);
  font-weight: 600;
}
