/* ============================================================
   MÁFICO — Design Tokens v1.0
   Source of truth: mafico-landing-mockup.html (lines 12-27)
   Generated: 2026-04-22
   Usage: <link rel="stylesheet" href="design-tokens/tokens.css">
   ============================================================ */

:root {
  /* ─── BRAND · NAVY ──────────────────────────────────────── */
  --navy: #0A1628;
  --navy-l: #162A50;
  --navy-ll: #1D3A6E;

  /* ─── BRAND · GOLD ──────────────────────────────────────── */
  --gold: #C8A84B;
  --gold-l: #E5C97A;
  --gold-d: #9A7B2E;
  --gold-bg: rgba(200, 168, 75, 0.09);
  --gold-b: rgba(200, 168, 75, 0.30);

  /* ─── BRAND · BLUE (info/links) ─────────────────────────── */
  --blue: #1D5FA5;
  --blue-l: #2E7DD4;
  --blue-bg: rgba(29, 95, 165, 0.08);

  /* ─── SURFACES · NEUTRAL ────────────────────────────────── */
  --white: #FFFFFF;
  --offwhite: #F7F8FC;
  --gray-1: #F0F2F7;
  --gray-2: #E2E6EF;
  --gray-3: #C8CEDE;

  /* ─── TEXT ──────────────────────────────────────────────── */
  --text: #0A1628;     /* primary body */
  --text-2: #3D5070;   /* secondary */
  --text-3: #6B82A0;   /* tertiary, labels */
  --text-4: #A8B8CC;   /* quaternary, placeholders */

  /* ─── SEMAPHORE · STATUS ────────────────────────────────── */
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --green-b: #BBF7D0;

  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --amber-b: #FDE68A;

  --red: #DC2626;
  --red-bg: #FEF2F2;
  --red-b: #FECACA;

  /* ─── SHADOWS (navy-tinted, never pure black) ───────────── */
  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.08), 0 1px 2px rgba(10, 22, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 22, 40, 0.10), 0 2px 6px rgba(10, 22, 40, 0.07);
  --shadow-lg: 0 12px 40px rgba(10, 22, 40, 0.12), 0 4px 12px rgba(10, 22, 40, 0.08);
  --shadow-xl: 0 24px 64px rgba(10, 22, 40, 0.14), 0 8px 24px rgba(10, 22, 40, 0.10);

  /* Gold glow — reserved for primary CTAs only */
  --shadow-gold-sm: 0 4px 20px rgba(200, 168, 75, 0.35);
  --shadow-gold-md: 0 8px 28px rgba(200, 168, 75, 0.45);

  /* ─── RADIUS ────────────────────────────────────────────── */
  --r-xs: 4px;
  --r-sm: 8px;
  --r: 12px;       /* default */
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* ─── SPACING (8px grid base) ───────────────────────────── */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* ─── TYPOGRAPHY · FAMILIES ─────────────────────────────── */
  --ff-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-mono: 'DM Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* ─── TYPOGRAPHY · WEIGHTS ──────────────────────────────── */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;

  /* ─── TYPOGRAPHY · SIZES (modular, clamp for fluid) ─────── */
  --fs-hero: clamp(38px, 4.5vw, 62px);      /* H1 editorial */
  --fs-section: clamp(28px, 3.5vw, 44px);   /* H2 section heading */
  --fs-h3: 24px;
  --fs-h4: 20px;
  --fs-lead: 17px;                          /* hero sub */
  --fs-body: 16px;
  --fs-small: 13.5px;
  --fs-xs: 12px;
  --fs-micro: 10px;                         /* ticker, mono labels */

  /* ─── TYPOGRAPHY · LINE HEIGHTS ─────────────────────────── */
  --lh-tight: 1.1;        /* hero h1 */
  --lh-snug: 1.2;         /* section h2 */
  --lh-normal: 1.6;        /* body */
  --lh-relaxed: 1.75;     /* hero sub */

  /* ─── TYPOGRAPHY · LETTER SPACING ───────────────────────── */
  --tr-tight: -0.02em;
  --tr-normal: 0;
  --tr-wide: 0.3px;
  --tr-wider: 0.5px;
  --tr-widest: 1.5px;     /* mono caps */

  /* ─── MOTION ────────────────────────────────────────────── */
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 400ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* ─── LAYOUT ────────────────────────────────────────────── */
  --container-max: 1200px;
  --container-pad: 32px;
  --nav-h: 68px;
  --z-nav: 100;
  --z-ticker: 200;
  --z-modal: 900;
  --z-toast: 1000;
}

/* ============================================================
   BASE RESET + DEFAULTS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.serif { font-family: var(--ff-serif); }
.mono  { font-family: var(--ff-mono); }

/* ============================================================
   COMPONENT TOKENS — minimal set used by examples.html
   Each class is a 1:1 carry-over from mafico-landing-mockup.html
   to guarantee visual parity with the current landing.
   ============================================================ */

/* ─── Buttons ───────────────────────────────────────────── */
.btn-gold {
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: var(--fw-bold);
  padding: 13px 28px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-gold-sm);
  display: inline-block;
}
.btn-gold:hover {
  background: var(--gold-l);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-md);
}

.btn-navy {
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: var(--fw-bold);
  padding: 9px 22px;
  border-radius: var(--r-sm);
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-navy:hover {
  background: var(--navy-ll);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10, 22, 40, 0.3);
}

.btn-outline-navy {
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  padding: 12px 24px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-2);
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  display: inline-block;
}
.btn-outline-navy:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.btn-ghost {
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--gray-2);
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-ghost:hover {
  border-color: var(--gold-b);
  color: var(--navy);
}

/* ─── KPI Card (replica 1:1 del hero-kpi del mockup) ────── */
.hero-kpi {
  background: var(--offwhite);
  border: 1px solid var(--gray-2);
  border-radius: 10px;
  padding: 12px;
}

/* Variant: standout — uses when KPI card is shown on its own
   (e.g. services grid, compliance section, standalone demos).
   Base .hero-kpi stays subtle for use INSIDE the hero-card-main. */
.hero-kpi--standout {
  background: var(--white);
  border-left: 3px solid var(--gray-2);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px 14px 13px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-left-color var(--dur) var(--ease);
  cursor: default;
}
.hero-kpi--standout:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.hero-kpi--standout.is-ok    { border-left-color: var(--green); }
.hero-kpi--standout.is-warn  { border-left-color: var(--amber); }
.hero-kpi--standout.is-alert { border-left-color: var(--red); }
.hk-label {
  font-size: 9px;
  color: var(--text-3);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tr-wider);
  margin-bottom: 4px;
}
.hk-val {
  font-family: var(--ff-mono);
  font-size: 18px;
  font-weight: var(--fw-medium);
  color: var(--navy);
}
.hk-delta { font-size: 10px; font-weight: var(--fw-semibold); margin-top: 2px; }
.up { color: var(--green); }
.dn { color: var(--red); }
.nw { color: var(--amber); }

/* ─── KPI Semaphore (sem-g / sem-a / sem-r) ─────────────── */
.hk-sem {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
  font-family: var(--ff-mono);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: var(--tr-wider);
  font-weight: var(--fw-bold);
}
.sem-g { background: var(--green-bg); color: var(--green); }
.sem-a { background: var(--amber-bg); color: var(--amber); }
.sem-r { background: var(--red-bg); color: var(--red); }

/* ─── Section Tag (chip editorial, mono uppercase) ──────── */
.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-b);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: var(--ff-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--gold-d);
}
.sec-tag-blue { background: var(--blue-bg); border-color: rgba(29, 95, 165, 0.2); color: var(--blue); }
.sec-tag-navy { background: rgba(10, 22, 40, 0.06); border-color: rgba(10, 22, 40, 0.12); color: var(--navy); }

/* ─── Compliance Badge (nuevo patrón — editorial shield) ── */
.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
}
.comp-badge:hover {
  border-color: var(--gold-b);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.comp-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--gold-bg);
  border: 1px solid var(--gold-b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-serif);
  font-weight: var(--fw-black);
  color: var(--gold-d);
  font-size: 16px;
  flex-shrink: 0;
}
.comp-badge-body { display: flex; flex-direction: column; gap: 2px; }
.comp-badge-label {
  font-family: var(--ff-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--text-3);
}
.comp-badge-title {
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--navy);
  line-height: 1.3;
}

/* ─── Typography helpers ────────────────────────────────── */
.h-hero {
  font-family: var(--ff-serif);
  font-size: var(--fs-hero);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  color: var(--navy);
  letter-spacing: var(--tr-tight);
}
.h-hero em { font-style: italic; color: var(--gold); }

.h-section {
  font-family: var(--ff-serif);
  font-size: var(--fs-section);
  font-weight: var(--fw-black);
  line-height: var(--lh-snug);
  color: var(--navy);
}
.h-section em { font-style: italic; color: var(--gold); }

.t-lead {
  font-family: var(--ff-sans);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text-2);
}

.t-micro-mono {
  font-family: var(--ff-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--text-3);
}

/* ============================================================
   PORTAL EXTENSION · v1.1 · 2026-04-23
   Aditivo · NO modifica nada arriba · landing sigue idéntico
   Toggle de surface cálido · tier badges · CFO Copilot · etc.
   ============================================================ */

:root {
  /* ─── PORTAL SURFACE SHIFT (warm vs landing's cool) ─────── */
  --portal-surface: #F4F1EA;       /* bone · reemplaza offwhite en portal */
  --portal-card: #FBF8F1;          /* warm paper · reemplaza white para cards */
  --portal-navy-deep: #050E1A;     /* sidebars + paneles profundos */
  --portal-gold-brass: #B89556;    /* brass cálido para UI · NUNCA logo */
  --portal-border: #E8E2D2;        /* warm gray-2 equivalent */

  /* ─── TIER COLORS ───────────────────────────────────────── */
  --tier-essential: var(--gray-3);
  --tier-essential-bg: var(--gray-1);
  --tier-strategic: var(--blue);
  --tier-strategic-bg: var(--blue-bg);
  --tier-executive: var(--gold);
  --tier-executive-bg: var(--gold-bg);

  /* ─── CHAT BUBBLES (CFO Copilot) ────────────────────────── */
  --bubble-user: var(--portal-card);
  --bubble-user-text: var(--text);
  --bubble-user-border: var(--portal-border);
  --bubble-ai: var(--portal-navy-deep);
  --bubble-ai-text: #FFFFFF;
  --bubble-ai-border: rgba(200, 168, 75, 0.25);
  --bubble-system: var(--gold-bg);
  --bubble-system-text: var(--gold-d);
  --bubble-system-border: var(--gold-b);

  /* ─── INVOICE STATES ────────────────────────────────────── */
  --invoice-paid: var(--green);
  --invoice-paid-bg: var(--green-bg);
  --invoice-pending: var(--amber);
  --invoice-pending-bg: var(--amber-bg);
  --invoice-failed: var(--red);
  --invoice-failed-bg: var(--red-bg);
  --invoice-canceled: var(--text-3);
  --invoice-canceled-bg: var(--gray-1);

  /* ─── SKELETON / LOADING ────────────────────────────────── */
  --skeleton-base: var(--gray-2);
  --skeleton-highlight: var(--gray-1);
}

/* Apply warm portal surface only when explicitly opted-in.
   Use <body class="portal-app"> to flip the room temperature. */
.portal-app {
  background: var(--portal-surface);
}

/* ─── TIER BADGE · 3 variants ─────────────────────────────── */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest); text-transform: uppercase;
  white-space: nowrap;
}
.tier-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.tier-badge--essential {
  background: var(--tier-essential-bg);
  color: var(--text-2);
  border: 1px solid var(--gray-2);
}
.tier-badge--essential::before { background: var(--tier-essential); }
.tier-badge--strategic {
  background: var(--tier-strategic-bg);
  color: var(--tier-strategic);
  border: 1px solid rgba(29, 95, 165, 0.25);
}
.tier-badge--strategic::before { background: var(--tier-strategic); }
.tier-badge--executive {
  background: var(--portal-navy-deep);
  color: var(--gold);
  border: 1px solid var(--gold-b);
}
.tier-badge--executive::before {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.22);
  animation: pulse-gold 2s ease infinite;
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.22); }
  50% { box-shadow: 0 0 0 5px rgba(200, 168, 75, 0.10); }
}

/* ─── CHAT BUBBLES · user / ai / system ───────────────────── */
.bubble {
  display: block;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: var(--lh-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.bubble--user {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border: 1px solid var(--bubble-user-border);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.bubble--ai {
  background: var(--bubble-ai);
  color: var(--bubble-ai-text);
  border: 1px solid var(--bubble-ai-border);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
.bubble--ai b { color: var(--gold-l); font-weight: var(--fw-bold); }
.bubble--system {
  background: var(--bubble-system);
  color: var(--bubble-system-text);
  border: 1px solid var(--bubble-system-border);
  margin: 0 auto;
  max-width: 95%;
  font-family: var(--ff-mono);
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
  font-weight: var(--fw-bold);
}
.bubble-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-family: var(--ff-mono); font-size: 10px;
  color: var(--text-3); letter-spacing: 0.3px;
}
.bubble--ai .bubble-meta { color: rgba(255, 255, 255, 0.5); }

/* Citation pill (reference to signed report) */
.cite-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-full);
  background: rgba(200, 168, 75, 0.12);
  border: 1px solid rgba(200, 168, 75, 0.3);
  color: var(--gold-l);
  font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-bold);
  text-decoration: none;
}
.cite-pill:hover { background: rgba(200, 168, 75, 0.2); }

/* ─── INVOICE ROW · 4 states ──────────────────────────────── */
.invoice-row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 16px; align-items: center;
  padding: 14px 18px;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--r);
  font-family: var(--ff-sans); font-size: 14px;
  transition: all var(--dur) var(--ease);
}
.invoice-row + .invoice-row { margin-top: 8px; }
.invoice-row:hover { box-shadow: var(--shadow-sm); }
.invoice-row .inv-period { font-family: var(--ff-mono); font-weight: var(--fw-bold); color: var(--navy); }
.invoice-row .inv-amount { font-family: var(--ff-mono); font-weight: var(--fw-medium); color: var(--navy); }

.invoice-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest); text-transform: uppercase;
}
.invoice-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.invoice-status--paid { background: var(--invoice-paid-bg); color: var(--invoice-paid); }
.invoice-status--paid::before { background: var(--invoice-paid); }
.invoice-status--pending { background: var(--invoice-pending-bg); color: var(--invoice-pending); }
.invoice-status--pending::before { background: var(--invoice-pending); animation: pulse-dot 1.5s ease infinite; }
.invoice-status--failed { background: var(--invoice-failed-bg); color: var(--invoice-failed); }
.invoice-status--failed::before { background: var(--invoice-failed); }
.invoice-status--canceled { background: var(--invoice-canceled-bg); color: var(--invoice-canceled); }
.invoice-status--canceled::before { background: var(--invoice-canceled); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ─── TIER UPGRADE CARD ───────────────────────────────────── */
.upgrade-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--r-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.upgrade-card--featured {
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(200, 168, 75, 0.15);
}
.upgrade-card--featured::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-l));
}
.upgrade-card-tag {
  font-family: var(--ff-mono); font-size: 10.5px; font-weight: var(--fw-bold);
  color: var(--gold-d); letter-spacing: var(--tr-widest); text-transform: uppercase;
  margin-bottom: 8px;
}
.upgrade-card-title {
  font-family: var(--ff-serif); font-size: 26px; font-weight: var(--fw-black);
  color: var(--navy); line-height: 1.15; margin-bottom: 6px;
}
.upgrade-card-price {
  font-family: var(--ff-mono); font-size: 18px; font-weight: var(--fw-medium);
  color: var(--navy); margin-bottom: 18px;
}
.upgrade-card-price small {
  font-size: 12px; color: var(--text-3); font-weight: var(--fw-regular); margin-left: 2px;
}
.upgrade-card-list { list-style: none; padding: 0; margin: 0 0 22px; }
.upgrade-card-list li {
  position: relative; padding-left: 22px; margin-bottom: 10px;
  font-size: 14.5px; line-height: 1.4; color: var(--text);
}
.upgrade-card-list li::before {
  content: "+"; position: absolute; left: 0; top: 0;
  width: 16px; height: 16px;
  background: var(--gold-bg); border: 1px solid var(--gold-b);
  border-radius: 50%; color: var(--gold-d);
  font-family: var(--ff-mono); font-weight: var(--fw-bold); font-size: 12px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ─── ALERT ROW (formal version) ──────────────────────────── */
.alert-row-v2 {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px; align-items: start;
  padding: 16px 20px;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-left-width: 3px;
  border-radius: var(--r);
  font-size: 14px; line-height: 1.5;
}
.alert-row-v2--critical { border-left-color: var(--red); }
.alert-row-v2--high { border-left-color: var(--amber); }
.alert-row-v2--info { border-left-color: var(--blue); }
.alert-row-v2 .alert-sev {
  font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: var(--tr-widest); text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-sm); text-align: center;
}
.alert-row-v2--critical .alert-sev { background: var(--red-bg); color: var(--red); }
.alert-row-v2--high .alert-sev { background: var(--amber-bg); color: var(--amber); }
.alert-row-v2--info .alert-sev { background: var(--blue-bg); color: var(--blue); }
.alert-row-v2 .alert-msg b { color: var(--navy); font-weight: var(--fw-bold); }
.alert-row-v2 .alert-time {
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--text-3);
  letter-spacing: 0.3px; white-space: nowrap;
}

/* ─── SKELETON LOADER ─────────────────────────────────────── */
.skel {
  background: var(--skeleton-base);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: var(--skeleton-shimmer, linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent));
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.6s linear infinite;
}
.skel--line { height: 12px; margin-bottom: 8px; }
.skel--line-sm { height: 8px; width: 40%; margin-bottom: 6px; }
.skel--card { height: 100px; border-radius: var(--r); }
.skel--circle { width: 40px; height: 40px; border-radius: 50%; }
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── MAGIC LINK INPUT (login alt path) ───────────────────── */
.magic-link {
  display: flex; gap: 8px; align-items: stretch;
  max-width: 480px;
}
.magic-link input[type="email"] {
  flex: 1;
  font-family: var(--ff-sans); font-size: 16px;
  padding: 0 16px; height: 48px;
  border: 1.5px solid var(--gray-2); border-radius: 10px;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--dur) var(--ease);
}
.magic-link input[type="email"]:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg);
}
.magic-link button {
  font-family: var(--ff-sans); font-size: 14px; font-weight: var(--fw-bold);
  padding: 0 22px; height: 48px;
  background: var(--navy); color: white;
  border: none; border-radius: 10px;
  cursor: pointer; transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.magic-link button:hover { background: var(--navy-ll); }

/* ─── TERM TOOLTIP · "What does this mean?" ───────────────── */
.term {
  position: relative;
  border-bottom: 1px dotted var(--gold-d);
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.term--first::after {
  content: "◦";
  margin-left: 2px;
  color: var(--gold);
  font-size: 0.85em;
}
.term:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}
.term-tip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--portal-navy-deep);
  color: white;
  padding: 12px 14px;
  border-radius: var(--r);
  width: 280px;
  font-size: 12.5px; line-height: 1.45;
  font-family: var(--ff-sans);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.term-tip strong { color: var(--gold-l); display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.term-tip a { color: var(--gold-l); font-size: 11px; display: inline-block; margin-top: 8px; }
.term:hover .term-tip,
.term:focus-visible .term-tip {
  visibility: visible; opacity: 1;
}

/* ─── CFO COPILOT SIDEBAR (Executive only) ────────────────── */
.copilot-sidebar {
  width: 380px;
  height: calc(100vh - var(--nav-h));
  position: fixed; top: var(--nav-h); right: 0;
  background: var(--portal-navy-deep);
  border-left: 1px solid rgba(200, 168, 75, 0.15);
  display: flex; flex-direction: column;
  color: white;
  font-family: var(--ff-sans);
  transition: width var(--dur) var(--ease);
  z-index: 50;
}
.copilot-sidebar--collapsed { width: 56px; }

.copilot-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; gap: 10px;
}
.copilot-header-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.25);
  animation: pulse-gold 2s ease infinite;
  flex-shrink: 0;
}
.copilot-header-title {
  font-family: var(--ff-serif); font-size: 16px; font-weight: var(--fw-bold);
  color: white; letter-spacing: 0.3px;
}
.copilot-header-title em { color: var(--gold); font-style: italic; font-weight: var(--fw-regular); }

.copilot-body {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.copilot-suggestions {
  padding: 12px 20px 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.suggestion-chip {
  font-family: var(--ff-sans); font-size: 12px;
  padding: 6px 12px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 168, 75, 0.2);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: left;
}
.suggestion-chip:hover {
  background: rgba(200, 168, 75, 0.12);
  border-color: var(--gold);
  color: var(--gold-l);
}

.copilot-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}
.copilot-input {
  display: flex; gap: 8px; align-items: stretch;
  margin-bottom: 8px;
}
.copilot-input textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 10px 14px;
  font-family: var(--ff-sans); font-size: 14px; line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: white;
}
.copilot-input textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.copilot-input textarea:focus {
  outline: none; border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}
.copilot-send {
  background: var(--gold); color: var(--navy);
  border: none; border-radius: 10px;
  padding: 0 16px; min-height: 44px;
  font-family: var(--ff-sans); font-size: 13px; font-weight: var(--fw-bold);
  cursor: pointer; transition: background var(--dur) var(--ease);
}
.copilot-send:hover { background: var(--gold-l); }

.copilot-disclaimer {
  font-family: var(--ff-mono); font-size: 9.5px;
  color: rgba(255, 255, 255, 0.4); letter-spacing: 0.3px;
  text-align: center; line-height: 1.4;
}

/* Typing indicator (3 dots pulsing gold) */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; height: 14px; padding: 0 4px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: typing 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Escalation banner inside Copilot */
.escalate-banner {
  background: rgba(200, 168, 75, 0.08);
  border: 1px solid rgba(200, 168, 75, 0.3);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px; color: rgba(255, 255, 255, 0.85); line-height: 1.4;
  display: flex; align-items: flex-start; gap: 10px;
}
.escalate-banner-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-bg); border: 1px solid var(--gold-b);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.escalate-banner a {
  color: var(--gold-l); font-weight: var(--fw-bold);
  text-decoration: none; display: inline-block; margin-top: 6px;
}

/* ─── BIG CTA (no-tech audience) ──────────────────────────── */
.btn-big {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--ff-sans);
  font-size: 16px; font-weight: var(--fw-bold);
  padding: 16px 32px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--navy);
  border: none; cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-gold-sm);
  transition: all var(--dur) var(--ease);
  letter-spacing: 0.2px;
}
.btn-big:hover {
  background: var(--gold-l);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-md);
}
.btn-big--quiet {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-2);
  box-shadow: none;
}
.btn-big--quiet:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
  transform: none;
}

/* ─── INLINE HINT · "What does this mean?" trigger ────────── */
.hint-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--gold-d);
  font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-bold);
  margin-left: 4px;
  vertical-align: middle;
  cursor: help;
  border: 1px solid var(--gold-b);
}
.hint-q:hover, .hint-q:focus-visible {
  background: var(--gold);
  color: var(--navy);
}

/* ─── PLAIN-LANGUAGE INFO CARD (no-tech) ──────────────────── */
.plain-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  max-width: 580px;
}
.plain-card h3 {
  font-family: var(--ff-serif);
  font-size: 20px; font-weight: var(--fw-bold);
  color: var(--navy); line-height: 1.25;
  margin-bottom: 10px;
}
.plain-card h3 em { font-style: italic; color: var(--gold); }
.plain-card p {
  font-family: var(--ff-sans);
  font-size: 15px; line-height: 1.6;
  color: var(--text-2);
}
.plain-card p + p { margin-top: 10px; }

/* ─── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .skel::after,
  .typing-dots span,
  .tier-badge--executive::before,
  .copilot-header-pulse {
    animation: none !important;
  }
  .invoice-status::before {
    animation: none !important;
  }
}

/* ─── MOBILE (≤640px) ─────────────────────────────────────── */
@media (max-width: 640px) {
  .copilot-sidebar {
    width: 100%; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    height: 100vh;
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease);
    z-index: var(--z-modal);
  }
  .copilot-sidebar--open { transform: translateX(0); }
  .invoice-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .invoice-row > * { min-width: 0; }
  .alert-row-v2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .alert-row-v2 .alert-time { text-align: left; }
  .magic-link { flex-direction: column; }
  .magic-link button { width: 100%; }
  .term-tip { width: min(280px, calc(100vw - 32px)); }
}

/* ─── PORTAL-SCOPED OVERRIDES (when body.portal-app) ──────── */
.portal-app section,
.portal-app .card-warm {
  background: var(--portal-card);
  border-color: var(--portal-border);
}
