/* ARQ CRM design tokens. Every colour, size and duration used by the UI is
   defined here; component CSS never hardcodes a raw value. */

:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-sunken: #eef0f4;
    --border: #dfe3ea;
    --border-strong: #c3cad6;

    /* Text */
    --text: #171c26;
    --text-muted: #5a6475;
    --text-inverse: #ffffff;

    /* Accent */
    --accent: #3d3fc4;
    --accent-hover: #3032a6;
    --accent-soft: #e9e9fb;
    --accent-text: #3032a6;

    /* Status */
    --success: #14713f;
    --success-soft: #e0f3e8;
    --warning: #8a5a00;
    --warning-soft: #fcefd2;
    --danger: #b3261e;
    --danger-hover: #931f18;
    --danger-soft: #fbe6e4;
    --info: #1c5fa8;
    --info-soft: #e2eefb;
    --teal: #0b6b6b;
    --teal-soft: #dcf2f1;
    --pink: #a3256f;
    --pink-soft: #fbe4f1;

    /* Sidebar */
    --sidebar-bg: #151a2d;
    --sidebar-text: #c5cbe0;
    --sidebar-text-active: #ffffff;
    --sidebar-active: #272e4d;

    /* Typography */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-md: 0.875rem;
    --fs-lg: 1rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.75rem;
    --lh: 1.5;
    --lh-tight: 1.25;

    /* Spacing (4px scale) */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 2.5rem;
    --sp-8: 3rem;

    /* Shape */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-full: 999px;

    /* Elevation */
    --shadow-1: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 3px rgb(16 24 40 / 0.08);
    --shadow-2: 0 8px 24px rgb(16 24 40 / 0.16);
    --focus-ring: 0 0 0 3px rgb(61 63 196 / 0.35);

    /* Motion */
    --dur-fast: 120ms;
    --dur: 200ms;

    /* Layout */
    --sidebar-w: 15rem;
    --topbar-h: 3.5rem;
    --content-max: 90rem;
}

/* Dark theme: applied when the user chose it, or when the system prefers it
   and the user has not chosen light. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1219;
    --surface: #171b25;
    --surface-raised: #1e2330;
    --surface-sunken: #121620;
    --border: #2a3040;
    --border-strong: #3b4357;
    --text: #e8ebf2;
    --text-muted: #9aa4b8;
    --text-inverse: #ffffff;
    --accent: #6f72ee;
    --accent-hover: #8589f5;
    --accent-soft: #23264a;
    --accent-text: #b0b3ff;
    --success: #5fd092;
    --success-soft: #14301f;
    --warning: #f0bd52;
    --warning-soft: #382a0c;
    --danger: #ff8a80;
    --danger-hover: #ffa49c;
    --danger-soft: #3d1614;
    --info: #7db8f5;
    --info-soft: #13283f;
    --teal: #5fd0cc;
    --teal-soft: #0f2f2e;
    --pink: #f08cc4;
    --pink-soft: #3a1329;
    --sidebar-bg: #0b0e15;
    --sidebar-text: #a9b1c7;
    --sidebar-active: #1c2236;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 8px 24px rgb(0 0 0 / 0.55);
    --focus-ring: 0 0 0 3px rgb(111 114 238 / 0.5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0f1219;
        --surface: #171b25;
        --surface-raised: #1e2330;
        --surface-sunken: #121620;
        --border: #2a3040;
        --border-strong: #3b4357;
        --text: #e8ebf2;
        --text-muted: #9aa4b8;
        --text-inverse: #ffffff;
        --accent: #6f72ee;
        --accent-hover: #8589f5;
        --accent-soft: #23264a;
        --accent-text: #b0b3ff;
        --success: #5fd092;
        --success-soft: #14301f;
        --warning: #f0bd52;
        --warning-soft: #382a0c;
        --danger: #ff8a80;
        --danger-hover: #ffa49c;
        --danger-soft: #3d1614;
        --info: #7db8f5;
        --info-soft: #13283f;
        --teal: #5fd0cc;
        --teal-soft: #0f2f2e;
        --pink: #f08cc4;
        --pink-soft: #3a1329;
        --sidebar-bg: #0b0e15;
        --sidebar-text: #a9b1c7;
        --sidebar-active: #1c2236;
        --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
        --shadow-2: 0 8px 24px rgb(0 0 0 / 0.55);
        --focus-ring: 0 0 0 3px rgb(111 114 238 / 0.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --dur-fast: 0ms;
        --dur: 0ms;
    }
}
