/*
 * MySedona design tokens: the SedonaRetail 2.x BlueLight / Dark palette, same values as the SedonaLicence
 * admin (--sl-*), renamed --ms-*. Light is the default; dark follows prefers-color-scheme unless the
 * visitor picked a theme: /assets/js/ms-theme.js sets <html data-theme="light|dark"> from
 * localStorage "ms-theme" before first paint (absent = automatic).
 * The dark block is therefore written twice (media query + explicit attribute): change both together.
 * Page CSS must use these tokens, never literal colours.
 */
:root {
    color-scheme: light;

    /* surfaces */
    --ms-ground: #F3F6FA;
    --ms-surface: #FFFFFF;
    --ms-sunk: #F6F9FC;
    --ms-line: #DFE7F0;
    --ms-line-strong: #C9D6E4;
    --ms-grid: #EDF2F7;

    /* text */
    --ms-text: #152238;
    --ms-muted: #56677D;
    --ms-faint: #8496AB;

    /* brand + accent */
    --ms-brand: #0B3F75;
    --ms-accent: #0F6FB9;
    --ms-accent-hover: #0D5B9D;
    --ms-accent-text: #0D5B9D;
    --ms-accent-subtle: rgba(15, 111, 185, 0.10);
    --ms-on-accent: #FFFFFF;
    --ms-focus: rgba(15, 111, 185, 0.35);

    /* navigation + rows */
    --ms-nav-sel-bg: #E5F0FB;
    --ms-nav-sel-text: #0D5B9D;
    --ms-nav-hover: #F1F5FA;
    --ms-row-hover: #F6F9FC;

    /* status families: back / text / dot */
    --ms-ok-bg: #E6F4EC;      --ms-ok-text: #1B7343;      --ms-ok-dot: #22A05B;
    --ms-warn-bg: #FFF1DE;    --ms-warn-text: #8F5200;    --ms-warn-dot: #E8870E;
    --ms-err-bg: #FDECEA;     --ms-err-text: #B42318;     --ms-err-dot: #D92D20;
    --ms-info-bg: #E5F0FB;    --ms-info-text: #0D5B9D;    --ms-info-dot: #1F7BC4;
    --ms-neutral-bg: #EDF2F7; --ms-neutral-text: #56677D; --ms-neutral-dot: #8496AB;

    /* elevation */
    --ms-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(13, 91, 157, 0.08);
    --ms-shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
    --ms-scrim: rgba(15, 30, 50, 0.45);

    /* shape, type, layout */
    --ms-radius: 8px;
    --ms-radius-card: 12px;
    --ms-radius-pill: 999px;
    --ms-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --ms-mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
    --ms-top-h: 56px;
    --ms-nav-w: 248px;
    --ms-rail-w: 64px;
    --ms-page-pad: 24px;
    --ms-content-w: 1480px;
    --ms-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2356677D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

@media (max-width: 767.98px) {
    :root { --ms-page-pad: 16px; }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --ms-ground: #0B1726;
        --ms-surface: #112136;
        --ms-sunk: #0E1C2E;
        --ms-line: #22384F;
        --ms-line-strong: #2E4862;
        --ms-grid: #1A2E44;
        --ms-text: #EAF2FA;
        --ms-muted: #9DB0C6;
        --ms-faint: #6F849B;
        --ms-brand: #45B8FF;
        --ms-accent: #45B8FF;
        --ms-accent-hover: #6CC8FF;
        --ms-accent-text: #7CCBFF;
        --ms-accent-subtle: rgba(69, 184, 255, 0.14);
        --ms-on-accent: #0B1726;
        --ms-focus: rgba(69, 184, 255, 0.45);
        --ms-nav-sel-bg: #173A5C;
        --ms-nav-sel-text: #EAF2FA;
        --ms-nav-hover: #162B43;
        --ms-row-hover: #132B45;
        --ms-ok-bg: #12342A;      --ms-ok-text: #6FD6A0;      --ms-ok-dot: #6FD6A0;
        --ms-warn-bg: #3A2B14;    --ms-warn-text: #FFC766;    --ms-warn-dot: #FFC766;
        --ms-err-bg: #3B1C22;     --ms-err-text: #FF9C92;     --ms-err-dot: #FF9C92;
        --ms-info-bg: #13324F;    --ms-info-text: #7CCBFF;    --ms-info-dot: #7CCBFF;
        --ms-neutral-bg: #1A2E44; --ms-neutral-text: #9DB0C6; --ms-neutral-dot: #6F849B;
        --ms-shadow: none;
        --ms-shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.55);
        --ms-scrim: rgba(3, 9, 18, 0.62);
        --ms-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239DB0C6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --ms-ground: #0B1726;
    --ms-surface: #112136;
    --ms-sunk: #0E1C2E;
    --ms-line: #22384F;
    --ms-line-strong: #2E4862;
    --ms-grid: #1A2E44;
    --ms-text: #EAF2FA;
    --ms-muted: #9DB0C6;
    --ms-faint: #6F849B;
    --ms-brand: #45B8FF;
    --ms-accent: #45B8FF;
    --ms-accent-hover: #6CC8FF;
    --ms-accent-text: #7CCBFF;
    --ms-accent-subtle: rgba(69, 184, 255, 0.14);
    --ms-on-accent: #0B1726;
    --ms-focus: rgba(69, 184, 255, 0.45);
    --ms-nav-sel-bg: #173A5C;
    --ms-nav-sel-text: #EAF2FA;
    --ms-nav-hover: #162B43;
    --ms-row-hover: #132B45;
    --ms-ok-bg: #12342A;      --ms-ok-text: #6FD6A0;      --ms-ok-dot: #6FD6A0;
    --ms-warn-bg: #3A2B14;    --ms-warn-text: #FFC766;    --ms-warn-dot: #FFC766;
    --ms-err-bg: #3B1C22;     --ms-err-text: #FF9C92;     --ms-err-dot: #FF9C92;
    --ms-info-bg: #13324F;    --ms-info-text: #7CCBFF;    --ms-info-dot: #7CCBFF;
    --ms-neutral-bg: #1A2E44; --ms-neutral-text: #9DB0C6; --ms-neutral-dot: #6F849B;
    --ms-shadow: none;
    --ms-shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.55);
    --ms-scrim: rgba(3, 9, 18, 0.62);
    --ms-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239DB0C6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
