/* ============================================================
   CRM Dark Theme — глобальный тёмный override
   Переопределяет ВСЕ переменные дизайн-систем, встречающиеся
   на страницах CRM. Подключается ПОСЛЕ инлайновых стилей.
   ============================================================ */

:root {
    /* ── Фоны ── */
    --bg: #0b0e1a;
    --bg-2: #0f1424;
    --card: #131929;
    --card2: #1a2034;
    --surface: #131929;
    --surface-2: #1a2034;
    --surface-3: #222a44;
    --field-bg: #1a2034;
    --light: #1a2034;

    /* ── Текст ── */
    --text: #e6eaf5;
    --text-2: #cbd2e4;
    --text-main: #e6eaf5;
    --text-secondary: #8b93ad;
    --text-muted: #8b93ad;
    --text-light: #cbd2e4;
    --dark: #e6eaf5;
    --muted: #8b93ad;
    --gray: #8b93ad;

    /* ── Границы ── */
    --border: #232a44;
    --border-strong: #2e3755;
    --gray-light: #252d47;
    --glass: rgba(19, 25, 41, 0.72);
    --glass-border: rgba(148, 163, 184, 0.16);
    --ring: rgba(99, 102, 241, 0.35);

    /* ── Акценты ── */
    --primary: #6366f1;
    --primary-2: #8b5cf6;
    --primary-dark: #4f46e5;
    --primary-hover: #7c7ff2;
    --primary-light: rgba(99, 102, 241, 0.16);
    --primary-soft: rgba(99, 102, 241, 0.14);
    --accent: #818cf8;
    --acc: #818cf8;

    --success: #10b981;
    --success-light: #0f2a20;
    --success-soft: rgba(16, 185, 129, 0.14);
    --green: #34d399;

    --danger: #f43f5e;
    --danger-light: #2a141a;
    --danger-soft: rgba(244, 63, 94, 0.14);
    --red: #f87171;

    --warning: #f59e0b;
    --warning-light: #2a2110;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --gold: #e8b54d;
    --yellow: #f59e0b;

    --info: #0ea5e9;
    --info-soft: rgba(14, 165, 233, 0.14);
    --violet: #8b5cf6;
    --violet-soft: rgba(139, 92, 246, 0.14);
    --telegram: #229ed9;

    /* ── Поверхность (в glass-системе --white = фон карточки) ── */
    --white: #131929;

    /* ── Тени ── */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 16px 28px rgba(0, 0, 0, 0.50);
    --shadow-xl: 0 24px 46px rgba(0, 0, 0, 0.55);
    --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.50);

    /* ── Радиусы и анимация ── */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.22s cubic-bezier(.22, .61, .36, 1);
    --trans: 0.2s ease;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ── База ── */
html, body {
    background:
        radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.16), transparent 45%),
        radial-gradient(circle at 88% 14%, rgba(14, 165, 233, 0.12), transparent 40%),
        linear-gradient(135deg, #0b0e1a 0%, #0f1424 45%, #0b0e1a 100%) !important;
    color: #e6eaf5 !important;
}
body { min-height: 100vh; }

/* ── Ссылки ── */
a { color: #818cf8; }
a:hover { color: #a5b4fc; }

/* ── Формы ── */
input, select, textarea {
    background-color: #1a2034 !important;
    color: #e6eaf5 !important;
    border-color: #2a3452 !important;
}
input:focus, select:focus, textarea:focus {
    border-color: #6366f1 !important;
    outline: none;
}
input::placeholder, textarea::placeholder { color: #6b7490 !important; }
select option { background-color: #1a2034 !important; color: #e6eaf5 !important; }

/* ── Таблицы ── */
table { background: transparent; border-color: #252d47; }
th { background: #1a2034 !important; color: #cbd2e4 !important; border-color: #252d47 !important; }
td { color: #cbd2e4; border-color: #252d47 !important; }
tr:hover td { background: rgba(99, 102, 241, 0.05); }

/* ── Скроллбар ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0e1a; }
::-webkit-scrollbar-thumb { background: #2a3452; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a4668; }
