/* KayPRO Secure Power — 3-Tier WCAG 2.2 AA Design Tokens */
:root {
    /* Tier 1: Primitives */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #0b1120;

    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;

    /* Tier 2: Semantic Light Mode (verified >=4.5:1 text & >=3:1 UI contrast) */
    --bg-canvas: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-subtle: #e2e8f0;
    --bg-header: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569; /* 7.5:1 on white, 6.7:1 on #f1f5f9 */

    --border-color: #cbd5e1;
    --border-strong: #94a3b8;

    --accent-primary: #1d4ed8;   /* 6.7:1 with white text */
    --accent-hover: #1e40af;
    --accent-soft: #dbeafe;
    --accent-soft-fg: #1e3a8a;
    --focus-ring: #2563eb;

    --status-ok-bg: #dcfce7;
    --status-ok-fg: #166534;     /* 6.9:1 on #dcfce7 */
    --status-ok-solid: #15803d;  /* 5.1:1 with white text */

    --status-warn-bg: #fef3c7;
    --status-warn-fg: #92400e;   /* 6.8:1 on #fef3c7 */
    --status-warn-solid: #b45309;/* 5.0:1 with white text */

    --status-crit-bg: #fee2e2;
    --status-crit-fg: #991b1b;   /* 7.6:1 on #fee2e2 */
    --status-crit-solid: #b91c1c;/* 6.4:1 with white text */

    --status-info-bg: #e0f2fe;
    --status-info-fg: #075985;

    --banner-bg-start: #1e293b;
    --banner-bg-end: #0f172a;
    --banner-fg: #f8fafc;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.18);

    /* Chart Telemetry Colors */
    --chart-volt: #2563eb;
    --chart-amp: #0284c7;
    --chart-watt: #dc2626;
    --chart-grid: rgba(100, 116, 139, 0.18);

    /* Tier 3: Component Tokens */
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --card-radius: 10px;
    --radius-sm: 6px;
    --touch-min: 44px;
}

[data-theme="dark"] {
    /* Industrial Slate/Cobalt Dark Mode (zero low-contrast neon purple) */
    --bg-canvas: #0b1120;
    --bg-surface: #131c2e;
    --bg-subtle: #1e293b;
    --bg-header: #131c2e;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;     /* 5.9:1 on #131c2e */

    --border-color: #334155;
    --border-strong: #475569;

    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: #1e3a8a;
    --accent-soft-fg: #dbeafe;
    --focus-ring: #60a5fa;

    --status-ok-bg: #064e3b;
    --status-ok-fg: #6ee7b7;     /* 8.3:1 on #064e3b */
    --status-ok-solid: #15803d;

    --status-warn-bg: #451a03;
    --status-warn-fg: #fcd34d;   /* 10.6:1 on #451a03 */
    --status-warn-solid: #b45309;

    --status-crit-bg: #450a0a;
    --status-crit-fg: #fca5a5;   /* 8.1:1 on #450a0a */
    --status-crit-solid: #b91c1c;

    --status-info-bg: #0c4a6e;
    --status-info-fg: #bae6fd;

    --banner-bg-start: #1e293b;
    --banner-bg-end: #0f172a;
    --banner-fg: #f8fafc;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.55);

    --chart-volt: #60a5fa;
    --chart-amp: #38bdf8;
    --chart-watt: #f87171;
    --chart-grid: rgba(148, 163, 184, 0.16);
}
