:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PT Astra Sans', 'PT Sans', 'Liberation Sans', 'DejaVu Sans', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* ============================================================
       СВЕТЛАЯ ТЕМА (по умолчанию)
       ============================================================ */
    --bg-app: #f6f7f9;
    --bg-surface: #ffffff;
    --bg-surface-2: #fafbfc;
    --bg-subtle: #f0f2f5;
    --bg-overlay: rgba(15, 20, 25, 0.45);

    --text-primary: #0f1419;
    --text-secondary: #5f6b7a;
    --text-tertiary: #8a94a3;
    --text-inverse: #ffffff;
    --text-disabled: #b8bec7;

    --border-subtle: #eef0f3;
    --border-default: #e5e8ec;
    --border-strong: #d1d6dd;

    --accent-primary: #2c5aa0;
    --accent-hover: #24508f;
    --accent-active: #1e4580;
    --accent-subtle: #eef2f9;
    --accent-border: #c5d5ea;
    --accent-text: #2c5aa0;

    /* ----------------------------------------
       Семантические цвета
       info — связан с акцентом через var()
       ---------------------------------------- */
    --color-info:        var(--accent-primary);
    --color-info-bg:     var(--accent-subtle);
    --color-info-border: var(--accent-border);
    --color-info-text:   var(--accent-active);

    --color-success: #2d7a4f;
    --color-success-bg: #ecf6f0;
    --color-success-border: #b8ddc6;
    --color-success-text: #1e5a37;

    --color-danger: #b8443a;
    --color-danger-hover: #9e3a31;
    --color-danger-bg: #fbeeed;
    --color-danger-border: #f0c9c5;
    --color-danger-text: #8a2f27;

    --color-warning: #b8860b;
    --color-warning-bg: #fdf6e3;
    --color-warning-border: #ecd99a;
    --color-warning-text: #8a6508;

    /* ============================================================
       Размеры, радиусы, тени, типографика, z-index
       ============================================================ */
    --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;
    --space-16: 64px;
    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius-md: 7px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --radius-full: 9999px;

    /* Тени */
    --shadow-xs: 0 1px 2px rgba(15, 20, 25, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 20, 25, 0.06), 0 1px 2px rgba(15, 20, 25, 0.04);
    --shadow-md: 0 4px 8px rgba(15, 20, 25, 0.06), 0 2px 4px rgba(15, 20, 25, 0.04);
    --shadow-lg: 0 12px 24px rgba(15, 20, 25, 0.08), 0 4px 8px rgba(15, 20, 25, 0.04);
    --shadow-xl: 0 24px 48px rgba(15, 20, 25, 0.12), 0 8px 16px rgba(15, 20, 25, 0.06);

    /* Фокус — обводка для инпутов и кнопок */
    --shadow-focus: 0 0 0 3px rgba(44, 90, 160, 0.15);

    /* Типографика */
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 20px;
    --fs-3xl: 24px;
    --fs-4xl: 30px;
    --lh-tight: 1.25;
    --lh-snug: 1.4;
    --lh-normal: 1.5;
    --lh-relaxed: 1.65;
    --ls-tight: -0.02em;
    --ls-normal: 0;
    --ls-wide: 0.02em;

    /* Анимация */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --duration-fast: 120ms;
    --duration-base: 180ms;
    --duration-slow: 280ms;

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-width-sm: 64px;
    --header-height: 56px;
    --content-max-width: 1440px;

    /* Z-index */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 300;
    --z-header: 400;
    --z-modal-bg: 500;
    --z-modal: 510;
    --z-toast: 600;
    --z-tooltip: 700;

    color-scheme: light;
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   Активируется при установке <html data-theme="dark">
   ============================================================ */
[data-theme="dark"] {
    /* Фоны */
    --bg-app: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-2: #1c2128;
    --bg-subtle: #21262d;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* Тексты */
    --text-primary: #e6edf3;
    --text-secondary: #9198a1;
    --text-tertiary: #6e7681;
    --text-inverse: #0d1117;
    --text-disabled: #484f58;

    /* Границы */
    --border-subtle: #21262d;
    --border-default: #30363d;
    --border-strong: #484f58;

    /* Акцент (синий) — переопределяется через JS */
    --accent-primary: #4a8fd8;
    --accent-hover: #5a9fe8;
    --accent-active: #3a7fc8;
    --accent-subtle: #1a2733;
    --accent-border: #2d4a6a;
    --accent-text: #6aafe8;

    /* info наследует акцент автоматически */
    --color-info:        var(--accent-primary);
    --color-info-bg:     var(--accent-subtle);
    --color-info-border: var(--accent-border);
    --color-info-text:   var(--accent-text);

    /* Успех (зелёный) */
    --color-success: #3fb950;
    --color-success-bg: #12261a;
    --color-success-border: #1f4527;
    --color-success-text: #7ac88a;

    /* Опасность (красный) */
    --color-danger: #f85149;
    --color-danger-hover: #ff6a62;
    --color-danger-bg: #2d1313;
    --color-danger-border: #5a2520;
    --color-danger-text: #f88a80;

    /* Предупреждение (жёлтый) */
    --color-warning: #d29922;
    --color-warning-bg: #2b2410;
    --color-warning-border: #5a4a1a;
    --color-warning-text: #e8c268;

    /* Фокус — светлая обводка для тёмной темы */
    --shadow-focus: 0 0 0 3px rgba(74, 143, 216, 0.25);

    color-scheme: dark;
}