/* ============================================================================
 * elviana - C4X Design Tokens  (web/styles/c4x-tokens.css)
 * ----------------------------------------------------------------------------
 * Canonical design-token layer for the elviana admin console (milestone M5,
 * CLAUDE.md §13). As of T-029 (run R-022) the values below are the REAL C4X
 * Technology Architects design system, taken verbatim from the authoritative
 * skill at ~/.claude/skills/c4x-website-style/SKILL.md ("Design tokens" and
 * "App / admin-tool chrome" sections) - a dark navy/teal/gold palette with
 * soft page-canvas glows and Manrope/Inter typography. The previous
 * light-theme "defensible reconstruction" is retired; see web/STYLE-GUIDE.md.
 *
 * Structure of this file:
 *   1. CANONICAL SKILL TOKENS (--c4x-hero, --c4x-body-bg, --c4x-accent, …)
 *      - exact values from the skill; do not substitute.
 *   2. COMPATIBILITY ALIASES (--c4x-color-*, --c4x-space-*, --c4x-text-*, …)
 *      - the token names the screens' page-local CSS already consumes,
 *        mapped onto the canonical values so no screen can hard-code a raw
 *        hex/px that a token covers (the hard rule from the original guide).
 *
 * WCAG AA on this palette (measured, sRGB, run R-022):
 *   body text #eaf1f7 on #071b2c canvas      15.3:1
 *   body text #eaf1f7 on #0f2c42 panel       12.6:1
 *   muted #9fb4c7 on canvas / panel           8.2 / 6.7:1
 *   accent link #00a4bf on canvas / panel     5.9 / 4.8:1  (hover #00c0ce 7.9:1)
 *   gold #e8b84b text on canvas / panel       9.5 / 7.8:1
 *   danger #ff9c92 on panel                   7.1:1
 *   dark ink #2a1f0a on gold button bg        8.8:1  (gold commit buttons use
 *                                                     dark ink, NEVER white -
 *                                                     white on gold = 1.8:1 FAIL)
 *   dark ink #04222b on accent-fill button    5.6:1  (accent-fill buttons also
 *                                                     use dark ink: white on
 *                                                     #00a4bf = 3.0:1 FAIL)
 *   light field chips: #0e283a on white      15.2:1  (fields are ALWAYS light
 *                                                     chips on the dark chrome -
 *                                                     never the page's own light
 *                                                     body text on a white field)
 *   white / #c7d0e0 on --c4x-hero-deep topbar 13.7 / 8.8:1
 * ========================================================================= */

:root {
  /*--------------------------------------------------------------------------
   * CANONICAL SKILL TOKENS - exact values from the c4x-website-style skill.
   * ------------------------------------------------------------------------*/
  --c4x-hero: #004675;        /* hero / header band background */
  --c4x-hero-deep: #00304f;   /* darker navy for gradients / footer */
  --c4x-body-bg: #071b2c;     /* page canvas - dark navy */
  --c4x-panel-bg: #0f2c42;    /* card / panel background - one step lighter than canvas */
  --c4x-body-text: #eaf1f7;   /* light body copy for the dark canvas */
  --c4x-muted: #9fb4c7;       /* muted blue-gray for secondary text */
  --c4x-accent: #00a4bf;      /* primary teal accent - links, in-progress actions */
  --c4x-accent-dark: #00c0ce; /* secondary CTA / hover variant */
  --c4x-gold: #e8b84b;        /* warm accent - the single commit action per form */
  --c4x-gold-dark: #cf9a2f;   /* gold hover (the skill's implied darker stop) */
  --c4x-border: rgba(255,255,255,0.12); /* hairline against the dark canvas */
  --c4x-white: #ffffff;
  --c4x-light-panel-bg: #ffffff;      /* small flyout UI + form fields stay light */
  --c4x-light-panel-text: #0e283a;    /* text ON those light chips */
  --c4x-light-panel-hover-bg: #eef3f8;
  --c4x-glow-cyan: #67e8f9;   /* blurred background glow stops */
  --c4x-glow-teal: #0891b2;
  --font-heading: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Accent/gold/danger treatments that recur across the app-chrome set. */
  --c4x-on-accent: #04222b;   /* dark ink for text on accent-fill buttons/badges (5.6:1) */
  --c4x-on-gold: #2a1f0a;     /* dark ink for text on gold commit buttons (8.8:1) */
  --c4x-topnav-link: #c7d0e0; /* idle nav link on the topbar gradient (8.8:1) */
  --c4x-invalid: #b42318;     /* invalid field border on white chips (AA UI) */
  --c4x-danger: #ff9c92;      /* skill's danger ink/outline (banner, .btn-danger, badge-negative) */
  --c4x-danger-bg: rgba(226, 87, 76, 0.14);   /* badge-negative fill */
  --c4x-danger-border: rgba(226, 87, 76, 0.5);
  --c4x-field-text: var(--c4x-light-panel-text); /* skill's field-text hook */
  --c4x-field-placeholder: #546575;   /* placeholder on white field chips - 6.0:1 (AA) */

  /*--------------------------------------------------------------------------
   * COMPATIBILITY ALIASES - legacy reconstruction names (kept so page-local
   * screen CSS written against them re-skins without a full rewrite), mapped
   * onto the canonical dark values above.
   * ------------------------------------------------------------------------*/

  /* Neutral ramp → navy surface ramp (descending luminance mapped onto the
   * dark scale: what used to be "white canvas" is now the dark canvas, etc.) */
  --c4x-color-neutral-0:   #ffffff;                /* literal white (field chips, flyouts) */
  --c4x-color-neutral-50:  var(--c4x-body-bg);     /* app canvas */
  --c4x-color-neutral-100: rgba(255,255,255,0.05); /* subtle surface / hover fill */
  --c4x-color-neutral-200: var(--c4x-border);      /* hairline dividers */
  --c4x-color-neutral-300: var(--c4x-border);      /* decorative border (hairline only) */
  --c4x-color-neutral-400: #5e7c96;   /* strong control border 3.3:1 vs panel / 4.4:1 vs white (AA 1.4.11) */
  --c4x-color-neutral-500: #8fa9c0;   /* metadata-text floor 5.8:1 vs canvas */
  --c4x-color-neutral-600: var(--c4x-muted);       /* secondary text 8.2:1 vs canvas */
  --c4x-color-neutral-700: #c4d3e2;                /* strong secondary 9.8:1 vs canvas */
  --c4x-color-neutral-800: #dce8f2;
  --c4x-color-neutral-900: var(--c4x-body-text);   /* primary text */

  /* Primary (institutional blue) → C4X teal/navy family. Consumed by the old
   * .c4x-btn default & focus ring; accent family + hero-deep steps preserved. */
  --c4x-color-primary-50:  color-mix(in srgb, var(--c4x-accent) 14%, var(--c4x-panel-bg));
  --c4x-color-primary-100: color-mix(in srgb, var(--c4x-accent) 22%, var(--c4x-panel-bg));
  --c4x-color-primary-200: color-mix(in srgb, var(--c4x-accent) 32%, var(--c4x-panel-bg));
  --c4x-color-primary-300: color-mix(in srgb, var(--c4x-accent) 45%, var(--c4x-white));
  --c4x-color-primary-400: color-mix(in srgb, var(--c4x-accent) 65%, var(--c4x-white));
  --c4x-color-primary-500: var(--c4x-accent-dark);
  --c4x-color-primary-600: var(--c4x-accent);       /* default action accent */
  --c4x-color-primary-700: var(--c4x-accent);       /* link/text accent on canvas */
  --c4x-color-primary-800: var(--c4x-hero);
  --c4x-color-primary-900: var(--c4x-hero-deep);

  /* Semantic status → skill banner/badge treatments (dark-tinted). Each status
   * keeps: solid (border/dot), tint (dark translucent fill), strong-text
   * (AA-verified text on the tint). */
  --c4x-color-success-solid: #5fd38b;
  --c4x-color-success-tint:  rgba(46, 160, 90, 0.16);
  --c4x-color-success-strong-text: #8ce4b1; /* 8.6:1 on tint-over-panel */

  --c4x-color-warning-solid: var(--c4x-gold);
  --c4x-color-warning-tint:  color-mix(in srgb, var(--c4x-gold) 12%, transparent);
  --c4x-color-warning-strong-text: var(--c4x-gold);

  --c4x-color-danger-solid: #ff8f84;
  --c4x-color-danger-tint:  var(--c4x-danger-bg);
  --c4x-color-danger-strong-text: var(--c4x-danger); /* 6.5:1 on tint-over-panel */

  --c4x-color-info-solid: var(--c4x-accent-dark);
  --c4x-color-info-tint:  rgba(255, 255, 255, 0.05); /* skill status-banner-info fill */
  --c4x-color-info-strong-text: var(--c4x-accent-dark);

  --c4x-color-statusneutral-solid: var(--c4x-muted);
  --c4x-color-statusneutral-tint:  rgba(255, 255, 255, 0.05);
  --c4x-color-statusneutral-strong-text: #ccd9e6;

  /* Role aliases */
  --c4x-color-text-primary:   var(--c4x-body-text);
  --c4x-color-text-secondary: var(--c4x-muted);
  --c4x-color-text-muted:     var(--c4x-color-neutral-500);
  --c4x-color-text-inverse:   #04222b;              /* dark ink on bright fills */
  --c4x-color-text-link:      var(--c4x-accent);
  --c4x-color-text-link-hover: var(--c4x-accent-dark);

  --c4x-color-bg-canvas:  var(--c4x-body-bg);
  --c4x-color-bg-surface: var(--c4x-panel-bg);        /* cards, tables */
  --c4x-color-bg-subtle:  rgba(255, 255, 255, 0.05);  /* zebra / hover */
  --c4x-color-bg-overlay: rgba(3, 12, 20, 0.6);       /* modal scrim, darker navy */

  --c4x-color-border:        var(--c4x-border);
  --c4x-color-border-strong: var(--c4x-color-neutral-400);
  --c4x-color-border-focus:  var(--c4x-accent);

  /* Accent focus ring: #00a4bf measures 4.8:1 vs the panel surface and 5.9:1
   * vs the canvas (AA non-text ≥3:1); the pale-cyan halo keeps it legible
   * where the accent sits on a light field chip. */
  --c4x-focus-ring-color: var(--c4x-accent);
  --c4x-focus-ring-width: 2px;
  --c4x-focus-ring-offset: 2px;

  /* Typography - skill font stacks (with full offline fallbacks) */
  --c4x-font-family-base: var(--font-body);
  --c4x-font-family-heading: var(--font-heading);
  --c4x-font-family-mono:
    ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;

  --c4x-text-xs:   0.75rem;   /* 12px - badge labels, table meta */
  --c4x-text-sm:   0.8125rem; /* 13px - dense table body, secondary labels */
  --c4x-text-md:   1rem;      /* 16px - body, form inputs (never below for inputs) */
  --c4x-text-lg:   1.25rem;   /* 20px - section titles */
  --c4x-text-xl:   1.5rem;    /* 24px - page titles */
  --c4x-text-2xl:  1.875rem;  /* 30px - login feature title only */

  --c4x-line-tight:  1.25;
  --c4x-line-normal: 1.6;     /* skill body line-height */
  --c4x-line-dense:  1.4;

  --c4x-font-weight-regular: 400;
  --c4x-font-weight-medium:  500;
  --c4x-font-weight-semibold:600;
  --c4x-font-weight-bold:    700;

  --c4x-letterspacing-label: 0.01em;

  /* Spacing - unchanged 4px scale */
  --c4x-space-3xs: 0.25rem;
  --c4x-space-2xs: 0.5rem;
  --c4x-space-xs:  0.75rem;
  --c4x-space-sm:  1rem;
  --c4x-space-md:  1.5rem;
  --c4x-space-lg:  2rem;
  --c4x-space-xl:  3rem;
  --c4x-space-2xl: 4rem;

  /* Radius - the skill's app chrome uses 6px buttons/fields, 10px panels,
   * 999px badges as-is; the legacy md/lg steps are snapped onto those. */
  --c4x-radius-sm:   2px;
  --c4x-radius-md:   6px;
  --c4x-radius-lg:   10px;
  --c4x-radius-pill: 999px;

  /* Elevation - the skill's panel shadow (dark, soft) + floating layers */
  --c4x-shadow-none: none;
  --c4x-shadow-sm: 0 10px 28px rgba(0, 8, 16, 0.35);  /* skill .panel shadow */
  --c4x-shadow-md: 0 12px 32px rgba(0, 8, 16, 0.45);  /* popover/toast */
  --c4x-shadow-lg: 0 24px 60px rgba(0, 20, 40, 0.32); /* hero/modal depth */
  --c4x-shadow-focus: 0 0 0 var(--c4x-focus-ring-width) var(--c4x-focus-ring-color);

  /* Z-index rungs - unchanged */
  --c4x-z-base:      0;
  --c4x-z-sticky:    100;
  --c4x-z-dropdown:  200;
  --c4x-z-overlay:   300;
  --c4x-z-modal:     400;
  --c4x-z-toast:     500;
  --c4x-z-skip:      600;

  /* Motion */
  --c4x-motion-fast:   120ms ease-out;
  --c4x-motion-normal: 200ms ease-out;

  /* Component-level aliases */
  --c4x-control-height:      2.5rem;   /* 40px (matches skill's 40px field/select height) */
  --c4x-control-height-sm:   2rem;     /* 32px compact - table toolbars/row actions */
  --c4x-control-border-width: 1px;
  --c4x-table-row-height:    3rem;
  --c4x-badge-dot-size:      0.5rem;
}

/* ----------------------------------------------------------------------------
 * Forced-colors safety is handled in base.css; tokens stay untouched so
 * authors keep one mental model (meaning never rides on tint/shadow alone).
 * ------------------------------------------------------------------------*/
