/* SwiftMaintenance — design tokens
   Brand palette derived from logo.svg: deep blue #405daa + cyan #37c6f1 */

:root {
    /* Brand */
    --brand-primary: #405daa;
    --brand-primary-600: #3d6ca5;
    --brand-primary-700: #324c87;
    --brand-primary-400: #4172b8;
    --brand-primary-50: #eef2fb;
    --brand-accent: #37c6f1;
    --brand-accent-600: #1fa8d3;
    --brand-accent-400: #53c8e9;
    --brand-accent-50: #e6f7fd;

    /* Neutrals (light) — slate scale */
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #475569;
    --text-subtle: #64748b;
    --text-inverse: #ffffff;

    /* Semantic */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: var(--brand-accent);
    --info-bg: var(--brand-accent-50);

    /* Surfaces */
    --ring: rgba(64, 93, 170, 0.45);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 17px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;

    /* Layout */
    --header-h: 60px;
    --footer-h: 56px;
    --sidebar-w: 240px;
}

[data-theme="dark"] {
    /* Slightly desaturate brand on dark to keep contrast comfortable */
    --brand-primary: #5a78c5;
    --brand-primary-600: #6e8bd8;
    --brand-primary-700: #4d6cb6;
    --brand-primary-400: #7a96d8;
    --brand-primary-50: rgba(90, 120, 197, 0.20);
    --brand-accent: #4cd2f5;
    --brand-accent-600: #6fdcf7;
    --brand-accent-400: #6fdcf7;
    --brand-accent-50: rgba(76, 210, 245, 0.18);

    --bg: #0b1220;
    --bg-elevated: #111a2e;
    --bg-muted: #162038;
    --border: #1e2a44;
    --border-strong: #2a3a5c;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --text-inverse: #0b1220;

    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.14);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.14);
    --info: var(--brand-accent);
    --info-bg: rgba(76, 210, 245, 0.14);

    --ring: rgba(122, 150, 216, 0.55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* Reset / base */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover { color: var(--brand-primary-600); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-3);
    color: var(--text);
    font-weight: 600;
    line-height: 1.25;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-3); }

::selection {
    background: var(--brand-accent-50);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Theme transition */
html, body, .card, .btn, .input, .badge, .modal-content, .navbar, .sidebar, .footer, .stat-card, .table {
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
