/*
 * Civion Design Tokens (--cv-*)
 * ─────────────────────────────────────────────────────────────────────────
 * Centralised colour palette for Civion surfaces, text hierarchy, forms,
 * tables, badges, alerts, dialogs, and interactive component states.
 *
 * All values are HSL triples (no hsl() wrapper) so they compose naturally
 * with  hsl(var(--cv-*)), Tailwind arbitrary values, and shadcn CSS tokens.
 *
 * Usage rules:
 * - Use dark surfaces (cv-page, cv-card-dark) for the Civion navy app shell.
 * - Use cv-panel-light for white/near-white panels nested inside dark pages.
 * - Pair dark surfaces with cv-text-primary/cv-text-secondary/cv-text-muted-dark.
 * - Pair light panels with cv-text-on-light/cv-text-muted-light.
 * - Do not use text-slate-500/text-gray-500 directly on dark navy backgrounds;
 *   use cv-text-muted-dark or text-muted-foreground instead.
 * - Badges, alerts, tables, dialogs, inputs, placeholders, and disabled states
 *   should define both their surface and foreground colour.
 * ─────────────────────────────────────────────────────────────────────────
 */

:root {
  /* ── Surface layers ─────────────────────────────────────────────────── */
  --cv-surface-main:     214 71% 14%;   /* app/page background               */
  --cv-surface-card:     214 65% 17%;   /* standard dark navy card           */
  --cv-surface-elevated: 214 55% 20%;   /* dialogs, modals, popovers         */
  --cv-surface-soft:     214 48% 21%;   /* nested panels on dark surfaces    */
  --cv-surface-light:      0 0% 100%;   /* white panel inside dark pages     */
  --cv-surface-light-soft: 210 40% 98%; /* subtle light panel/header fill    */

  /* ── Text hierarchy ─────────────────────────────────────────────────── */
  --cv-text-primary:      220 22% 92%;  /* near-white main text on navy      */
  --cv-text-secondary:    220 15% 74%;  /* readable secondary text on navy   */
  --cv-text-muted-dark:   220 15% 72%;  /* metadata/helper text on navy      */
  --cv-text-subtle-dark:  220 13% 64%;  /* lowest contrast allowed on navy   */
  --cv-text-danger-dark:    0 91% 71%;  /* red emphasis readable on navy     */
  --cv-text-selected:       0 0% 100%;  /* selected rows / strong emphasis   */
  --cv-text-on-light:     222 47% 11%;  /* main text on white/light panels   */
  --cv-text-muted-light:  215 16% 35%;  /* metadata/helper text on light     */
  --cv-text-subtle-light: 215 14% 45%;  /* placeholder-ish text on light     */

  /* Backwards-compatible alias used by existing row utilities. */
  --cv-text-muted: var(--cv-text-subtle-dark);

  /* ── Borders ────────────────────────────────────────────────────────── */
  --cv-border-subtle: 214 40% 24%;      /* same as --border                  */
  --cv-border-strong: 214 40% 34%;      /* more visible dividers             */
  --cv-border-light:  214 32% 88%;      /* borders on light panels           */

  /* ── Forms ──────────────────────────────────────────────────────────── */
  --cv-input-bg:              214 48% 16%;
  --cv-input-border:          214 40% 30%;
  --cv-input-foreground:      var(--cv-text-primary);
  --cv-input-placeholder:     220 14% 70%;
  --cv-input-disabled-bg:     214 38% 20%;
  --cv-input-disabled-text:   220 12% 64%;
  --cv-input-light-bg:          0 0% 100%;
  --cv-input-light-text:      var(--cv-text-on-light);
  --cv-input-light-placeholder: var(--cv-text-subtle-light);

  /* ── Interactive row backgrounds ────────────────────────────────────── */
  --cv-row-default:        214 45% 17%;
  --cv-row-hover:          214 45% 22%;
  --cv-row-selected-bg:    212 60% 28%;
  --cv-row-selected-hover: 212 60% 32%;
  --cv-row-active:         212 60% 35%;
  --cv-row-selected-border: 212 78% 60%;

  /* ── Tables ─────────────────────────────────────────────────────────── */
  --cv-table-header-bg:       214 50% 21%;
  --cv-table-header-text:     var(--cv-text-primary);
  --cv-table-cell-text:       var(--cv-text-secondary);
  --cv-table-row-hover:       214 45% 22%;
  --cv-table-light-header-bg:  210 40% 96%;
  --cv-table-light-text:      var(--cv-text-on-light);
  --cv-table-light-muted:     var(--cv-text-muted-light);

  /* ── Semantic status colours (surface + foreground pairs) ───────────── */
  --cv-accent:   212 78% 51%;
  --cv-info-bg:  204 94% 94%;
  --cv-info-fg:  201 96% 22%;
  --cv-info-border: 199 89% 48%;
  --cv-success-bg: 142 76% 94%;
  --cv-success-fg: 143 64% 20%;
  --cv-success-border: 142 71% 45%;
  --cv-warning-bg: 45 97% 90%;
  --cv-warning-fg: 28 73% 26%;
  --cv-warning-border: 38 92% 50%;
  --cv-danger-bg: 0 86% 94%;
  --cv-danger-fg: 0 74% 28%;
  --cv-danger-border: 0 84% 60%;
  --cv-neutral-bg: 215 20% 92%;
  --cv-neutral-fg: 222 47% 18%;
  --cv-neutral-border: 215 16% 72%;

  /* Backwards-compatible semantic aliases. */
  --cv-success: 142 76% 36%;
  --cv-warning: 38 92% 50%;
  --cv-danger: 0 84% 60%;
}
