/* ========================================
   Theme — Eligtas (Emergency Management)
   Command center meets Pacific resilience
   ======================================== */

:root {
  /* Primary — Deep blue (authority, trust) */
  --color-primary: 30, 64, 175;          /* #1e40af */
  --color-primary-light: 96, 165, 250;   /* #60a5fa */
  --color-primary-dark: 30, 58, 138;     /* #1e3a8a */

  /* Secondary — Teal (safety, resilience) */
  --color-secondary: 13, 148, 136;       /* #0d9488 */
  --color-secondary-light: 45, 212, 191; /* #2dd4bf */
  --color-secondary-dark: 15, 118, 110;  /* #0f766e */

  /* Alert level palette — 8-tier taxonomy post JOB-AUS1-00017H.
     Hex matches alert_levels.reference_data->>'color' in the DB so
     server-rendered SVG and these tokens stay in lockstep. New
     namespace --color-alert-level-* per memory
     feedback_taxonomy_token_rename_trap — do NOT reuse the
     pre-existing --color-alert-* names (now retired) with the new
     colours; UI status colours live in --color-status-* below. */
  --color-alert-level-none:     158, 158, 158;   /* #9E9E9E — Not Classified */
  --color-alert-level-normal:     1,  92,  88;   /* #015C58 — No Threat */
  --color-alert-level-advisory: 212, 153,   5;   /* #D49905 — Caution */
  --color-alert-level-alert:    242,  97,   3;   /* #F26103 — Prepare */
  --color-alert-level-warning:  186,  12,   5;   /* #BA0C05 — Act Now (shared by dfa) */
  --color-alert-level-ics:        0, 102, 204;   /* #0066CC — Tactical Response */
  --color-alert-level-major:     91,  45, 149;   /* #5B2D95 — Escalated */
  --color-alert-level-unknown:  107, 114, 128;   /* #6b7280 — fallback */

  /* Incident severity palette — EMS START triage taxonomy.
     Separate namespace from --color-alert-level-* per memory
     feedback_taxonomy_token_rename_trap; rows in alert_levels with
     level_type='incident' resolve here, level_type='alert' resolve
     to the alert namespace above. */
  --color-incident-level-untriaged: 158, 158, 158;  /* #9E9E9E — Untriaged */
  --color-incident-level-minor:      76, 175,  80;  /* #4CAF50 — Minor (walking wounded) */
  --color-incident-level-delayed:   255, 193,   7;  /* #FFC107 — Delayed (urgent, can wait) */
  --color-incident-level-immediate: 244,  67,  54;  /* #F44336 — Immediate (life-threatening) */
  --color-incident-level-expectant: 106,  27, 154;  /* #6A1B9A — Expectant (palliative) */

  /* Incident status palette — CAD-style lifecycle taxonomy.
     Backs the `incident_statuses` table (13 active rows, status_type
     ='incident'). One token per *colour bucket* (grey/blue/teal/green
     /red) not per status_name — multiple statuses share a bucket. Rows
     in components/incident-statuses.css route each status_name to its
     bucket token. Separate namespace from --color-alert-level-* and
     --color-incident-level-* per memory feedback_taxonomy_token_rename_trap. */
  --color-incident-status-grey:  158, 158, 158;  /* #9E9E9E — intake (new) */
  --color-incident-status-blue:   30, 136, 229;  /* #1E88E5 — intake/approval/dispatch */
  --color-incident-status-teal:   38, 166, 154;  /* #26A69A — engaged */
  --color-incident-status-green:  67, 160,  71;  /* #43A047 — on_scene / closed */
  --color-incident-status-red:   229,  57,  53;  /* #E53935 — exception (cancelled) */

  /* UI status palette — pill chips, toasts, dashboard accents.
     Separate axis from the alert-level taxonomy above: status is
     "what state is THIS row in" (error/warning/info/success/muted),
     not "how urgent is the underlying alert". Same hex values as the
     pre-existing --color-alert-* tokens that this namespace
     replaces. */
  --color-status-error:        220,  38,  38;   /* #dc2626 */
  --color-status-warning:      251, 191,  36;   /* #fbbf24 */
  --color-status-info:          59, 130, 246;   /* #3b82f6 */
  --color-status-success:       34, 197,  94;   /* #22c55e */
  --color-status-muted:        100, 116, 139;   /* #64748b */
  --color-status-acknowledged: 168,  85, 247;   /* #a855f7 */

  /* Geofence appearance palette — Phase 1 style cascade (map_style_defaults
     / geofence_types.style). Unlike the triple tokens above, these are
     COMPLETE colour values: the JSONB style blob stores `var(--color-geo-*)`
     and the value is applied directly as a Leaflet fillColor/strokeColor
     (a solid colour) — translucency is a separate blob key (fill_opacity).
     Hexes mirror the alert-level palette for semantic consistency. Used only
     when a geofence has NO active alert/incident (has_active_override=false);
     otherwise the level-* class colour wins. */
  --color-geo-default: #6b7280;   /* neutral slate — unclassified default */
  --color-geo-hazard:  #BA0C05;   /* red — hazard zone */
  --color-geo-evac:    #F26103;   /* orange — evacuation zone */
  --color-geo-safe:    #015C58;   /* teal-green — safe zone */

  /* Dashboard severity buckets — sev_bar and stat_tile group the
     8-tier taxonomy into three buckets (per bucket_alert_level in
     dashboard/query.rs). Aliases the status hex so a future bucket
     palette tweak doesn't drag the status pills along with it. */
  --color-severity-red:   var(--color-status-error);
  --color-severity-amber: var(--color-status-warning);
  --color-severity-green: var(--color-status-success);


  /* Surfaces */
  --color-bg: #080d1a;
  --color-bg-raised: #111827;
  --color-bg-overlay: #1e293b;
  --color-surface: #111827;
  --color-surface-hover: #1e293b;

  /* Text */
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #080d1a;

  /* Borders */
  --color-border: rgba(148, 163, 184, 0.08);
  --color-border-light: rgba(148, 163, 184, 0.15);
  --color-border-focus: rgb(var(--color-primary-light));

  /* Gradients */
  --gradient-brand: linear-gradient(135deg,
    rgb(var(--color-primary)) 0%,
    rgb(var(--color-secondary)) 100%);
  --gradient-brand-light: linear-gradient(135deg,
    rgb(var(--color-primary-light)) 0%,
    rgb(var(--color-secondary-light)) 100%);
  --gradient-surface: linear-gradient(180deg,
    var(--color-bg) 0%,
    var(--color-bg-raised) 100%);

  /* Nav */
  --nav-bg: rgba(8, 13, 26, 0.92);
  --nav-border: rgba(148, 163, 184, 0.06);
  --nav-height: 56px;

  /* Footer */
  --footer-bg: var(--color-bg);
  --footer-border: var(--color-border);

  /* Glow effects */
  --glow-primary: 0 0 40px rgba(var(--color-primary), 0.15);
  --glow-secondary: 0 0 40px rgba(var(--color-secondary), 0.15);
  --glow-critical: 0 0 30px rgba(var(--color-status-error), 0.2);
}
