/* =============================================
   DESIGN TOKENS - ЦЕНТРАЛИЗОВАННЫЕ ПЕРЕМЕННЫЕ
   CORA-X Design System v1.0
   Дата: 17.11.2024
   ============================================= */

:root {
    /* ============================================
       ЦВЕТА - PRIMARY
       ============================================ */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-light: #60a5fa;
    --color-primary-dark: #1e40af;
    --color-primary-rgb: 59, 130, 246;
    --color-primary-bg: #eff6ff;
    /* ✅ Добавлено: светлый фон для акцентов */

    /* ============================================
       ЦВЕТА - SEMANTIC
       ============================================ */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-light: #34d399;
    --color-success-dark: #047857;

    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-light: #fbbf24;
    --color-warning-dark: #b45309;

    --color-error: #ef4444;
    --color-error-hover: #dc2626;
    --color-error-light: #f87171;
    --color-error-dark: #b91c1c;

    --color-info: #0891b2;
    --color-info-hover: #0e7490;
    --color-info-light: #06b6d4;
    --color-info-dark: #155e75;

    /* ============================================
       ЦВЕТА - РАЗДЕЛЫ (по дизайн-системе)
       ============================================ */
    --section-home: #3b82f6;
    /* Синий */
    --section-patients: #9333ea;
    /* Фиолетовый */
    --section-registration: #10b981;
    /* Зелёный */
    --section-hospitals: #ea580c;
    /* Оранжевый */
    --section-topometry: #0891b2;
    /* Бирюзовый */
    --section-templates: #4f46e5;
    /* Индиго */

    /* ============================================
       GRAY SCALE
       ============================================ */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --white: #ffffff;
    --black: #000000;

    /* ============================================
       SPACING СИСТЕМА (8px base)
       ============================================ */
    --space-0: 0;
    --space-px: 1px;
    --space-0-5: 0.125rem;
    /* 2px */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-7: 1.75rem;
    /* 28px */
    --space-8: 2rem;
    /* 32px */
    --space-9: 2.25rem;
    /* 36px */
    --space-10: 2.5rem;
    /* 40px */
    --space-11: 2.75rem;
    /* 44px */
    --space-12: 3rem;
    /* 48px */
    --space-14: 3.5rem;
    /* 56px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */
    --space-24: 6rem;
    /* 96px */

    /* ============================================
       TYPOGRAPHY
       ============================================ */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-family-mono: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;

    /* Font sizes */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */

    /* Font weights */
    --font-thin: 100;
    --font-extralight: 200;
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --font-black: 900;

    /* Line heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* ============================================
       SHADOWS — FLAT
       ============================================ */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-none: 0 0 rgba(0, 0, 0, 0);

    /* ============================================
       SHADOWS — 3D EMBOSSED
       Multi-layer: outer contour + depth + soft + inner highlight
       ============================================ */
    --shadow-3d-sm:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --shadow-3d-md:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --shadow-3d-lg:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --shadow-3d-xl:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 16px 32px rgba(0, 0, 0, 0.06),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
    --shadow-3d-sunken:
        inset 0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 2px rgba(0, 0, 0, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.6);
    --shadow-3d-pressed:
        inset 0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.5);

    /* 3D Gradients for raised surfaces */
    --gradient-raised: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    --gradient-raised-hover: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    --gradient-sunken: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    --gradient-header: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --gradient-btn-primary: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    --gradient-btn-success: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
    --gradient-btn-danger: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    --gradient-btn-warning: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);

    /* ============================================
       GRADIENT TOKENS (merged from gradients.css)
       ============================================ */
    /* Primary */
    --gradient-primary: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    --gradient-primary-light: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    --gradient-primary-reverse: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --gradient-primary-subtle: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    /* Success */
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-success-dark: linear-gradient(135deg, #059669 0%, #047857 100%);
    /* Danger */
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-danger-light: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    --gradient-danger-lighter: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    /* Neutral */
    --gradient-neutral: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --gradient-neutral-dark: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    /* Component */
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);
    /* Background */
    --gradient-bg-body: linear-gradient(to right, #0EA5E9 0%, #0284C7 20%, #0369A1 40%, #075985 60%, #0C4A6E 80%, #1E3A5F 100%);
    --gradient-bg-container: linear-gradient(to right, #E0F2FE 0%, #BAE6FD 20%, #7DD3FC 40%, #38BDF8 60%, #0EA5E9 80%, #0284C7 100%);
    /* Utility */
    --gradient-line: linear-gradient(90deg, transparent 0%, #0891b2 50%, transparent 100%);
    --gradient-progress: linear-gradient(90deg, #0891b2 0%, #06b6d4 100%);
    /* Input */
    --gradient-input-warning: linear-gradient(90deg, rgba(249, 115, 22, 0.03) 0%, rgba(255, 255, 255, 1) 20%);
    --gradient-input-success: linear-gradient(90deg, rgba(16, 185, 129, 0.03) 0%, rgba(255, 255, 255, 1) 20%);

    /* ============================================
       BORDER RADIUS
       ============================================ */
    --radius-none: 0;
    --radius-sm: 0.125rem;
    /* 2px */
    --radius-base: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    /* 6px */
    --radius-lg: 0.5rem;
    /* 8px */
    --radius-xl: 0.75rem;
    /* 12px */
    --radius-2xl: 1rem;
    /* 16px */
    --radius-3xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;

    /* ============================================
       TRANSITIONS
       ============================================ */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ============================================
       BREAKPOINTS (для JS использования)
       ============================================ */
    --bp-xs: 320px;
    --bp-sm: 640px;
    --bp-md: 768px;
    --bp-lg: 1024px;
    --bp-xl: 1280px;
    --bp-2xl: 1536px;

    /* ============================================
       Z-INDEX СЛОИ
       ============================================ */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-overlay: 9000;
    --z-fullscreen: 9999;
    --z-top: 999999;

    /* ============================================
       РАЗМЕРЫ КОМПОНЕНТОВ
       ============================================ */
    --header-height: 64px;
    --footer-height: 64px;
    --sidebar-width: 250px;
    --panel-width: 150px;

    --input-height: 2.5rem;
    /* 40px */
    --input-height-sm: 2rem;
    /* 32px */
    --input-height-lg: 3rem;
    /* 48px */

    --button-height: 2.5rem;
    /* 40px */
    --button-height-sm: 2rem;
    /* 32px */
    --button-height-lg: 3rem;
    /* 48px */

    /* ============================================
       OPACITY
       ============================================ */
    --opacity-0: 0;
    --opacity-10: 0.1;
    --opacity-20: 0.2;
    --opacity-30: 0.3;
    --opacity-40: 0.4;
    --opacity-50: 0.5;
    --opacity-60: 0.6;
    --opacity-70: 0.7;
    --opacity-80: 0.8;
    --opacity-90: 0.9;
    --opacity-100: 1;
}

/* ============================================
   DARK MODE — ОТКЛЮЧЕНО
   Инвертирование gray scale ломает UI,
   т.к. стили используют hardcoded hex-цвета.
   Для тёмной темы см. chat-v3.css (.cx-dark).
   ============================================ */
