/*
 * Design tokens — the single styling source of truth (WebUI.md §2). Components reference var(--token)
 * only; a theme is just an override of these values, selected by data-theme on <html>. Light + dark
 * ship now; brand themes are an additive token map later (no code change).
 */

:root,
:root[data-theme="light"] {
    --color-bg: #f4f5f7;
    --color-surface: #ffffff;
    --color-surface-2: #eef0f3;
    --color-border: #d8dce1;
    --color-text: #1b1f24;
    --color-text-muted: #5b6470;
    --color-primary: #1466c4;
    --color-primary-contrast: #ffffff;
    --color-danger: #c62828;
    --color-disabled: #9aa3ad;

    /* The Mohlink mark's own navy, as drawn in the app icon and the favicon. */
    --color-logo: #173660;

    /* Non-alarming: a state that is recorded but never acted on. Deliberately outside the alarm
       palette AND away from the greys already spoken for by --color-disabled (unknown state) and
       --color-text-muted (masked), so three different "nothing to do here" pills stay tellable apart. */
    --color-event-nonalarming: #6e6a86;
    --color-event-active: #d32f2f;
    --color-event-ack: #f59e0b;
    --color-event-clear: #2e7d32;
    --color-event-deactivated: #1565c0;
    --color-event-forecast: #ec4899;

    /* The Alarms Dashboard's group-cluster outline: neutral, so it never competes with the
       state-coloured card borders (WebUI.md §9.2a). */
    --color-dash-outline: #7b8594;

    /* The fill behind a group cluster's cards: a little darker than the page background in light
       mode (and a little lighter in dark mode) so the group reads as a distinct tray, while the
       cards keep their own --color-surface (WebUI.md §9.2a). */
    --color-dash-group-bg: #e8eaef;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    --radius-1: 4px;
    --radius-2: 8px;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-size: 14px;

    --elevation-1: 0 1px 2px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.10);
    --tabbar-height: 52px;
}

:root[data-theme="dark"] {
    --color-bg: #14171c;
    --color-surface: #1d2127;
    --color-surface-2: #262b33;
    --color-border: #333a44;
    --color-text: #e6e9ee;
    --color-text-muted: #9aa3ae;
    --color-primary: #4c9bf0;
    --color-primary-contrast: #08233f;
    --color-danger: #ef5350;
    --color-disabled: #5b6470;

    /* The mark's navy at the same hue but lightened, since the navy itself all but
       disappears against the dark surfaces (1.4:1). This clears AA against both --color-bg
       and the tab bar's --color-surface. */
    --color-logo: #6fa0dc;

    --color-event-nonalarming: #8b86a8;
    --color-event-active: #ef5350;
    --color-event-ack: #fbbf24;
    --color-event-clear: #66bb6a;
    --color-event-deactivated: #4b8ddb;
    --color-event-forecast: #f472b6;

    /* The cluster outline lightened to stay visible against the dark surfaces (WebUI.md §9.2a). */
    --color-dash-outline: #8b95a5;

    /* The group-cluster fill, a little lighter than the dark page background — kept just below
       --color-surface so the cards stay the frontmost, lightest layer (WebUI.md §9.2a). */
    --color-dash-group-bg: #1a1e24;

    --elevation-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
}
