/**
 * FITCRM — темы интерфейса: тёмная (по умолчанию), светлая, фуксия.
 * Подключается после style.css; переопределяет токены и enterprise-слой.
 */

:root,
[data-theme="dark"] {
    color-scheme: dark;

    --crm-bg: #1a2740;
    --crm-bg-2: #20304c;
    --crm-surface: #243552;
    --crm-surface-2: #2c4060;
    --crm-surface-3: #355078;
    --crm-border: #4a6284;
    --crm-border-soft: rgba(186, 210, 235, 0.22);
    --crm-text: #f5f8fc;
    --crm-text-muted: #b4c3d6;
    --crm-text-faint: #8ea0b8;

    --crm-glass-header: rgba(26, 39, 64, 0.84);
    --crm-glass-sidebar: rgba(36, 53, 82, 0.96);
    --crm-glass-sticky: rgba(26, 39, 64, 0.94);
    --crm-body-bg-image:
        radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.16), transparent 26rem),
        radial-gradient(circle at 92% 12%, rgba(34, 211, 238, 0.10), transparent 24rem),
        linear-gradient(145deg, var(--crm-bg), #152033 72%);
    --crm-card-bg-image: linear-gradient(180deg, rgba(44, 64, 96, 0.96), rgba(36, 53, 82, 0.96));
    --crm-hover-surface: rgba(56, 189, 248, 0.10);
    --crm-hover-border: rgba(56, 189, 248, 0.32);
    --crm-active-surface: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(34, 211, 238, 0.08));
    --crm-active-border: rgba(56, 189, 248, 0.35);
    --crm-input-bg: rgba(44, 64, 96, 0.82);
    --crm-table-head-bg: rgba(32, 48, 76, 0.96);
    --crm-table-row-hover: rgba(56, 189, 248, 0.07);
    --crm-ghost-bg: rgba(255, 255, 255, 0.06);
    --crm-secondary-bg: rgba(255, 255, 255, 0.08);
    --crm-secondary-hover-bg: rgba(56, 189, 248, 0.12);
    --crm-secondary-hover-border: rgba(56, 189, 248, 0.30);
    --crm-btn-primary-border: rgba(103, 212, 255, 0.48);
    --crm-btn-primary-text: #04111d;
    --crm-btn-primary-shadow: 0 14px 28px rgba(56, 189, 248, 0.20);
    --crm-link-color: #b6d9fc;
    --crm-splash-bg: #1a2740;
    --crm-splash-text: #f5f8fc;
    --crm-sidebar-bg-image:
        linear-gradient(180deg, rgba(56, 189, 248, 0.14) 0%, transparent 28%),
        linear-gradient(165deg, rgba(36, 53, 82, 0.98) 0%, rgba(26, 39, 64, 0.98) 100%);
    --crm-header-bg-image:
        linear-gradient(90deg, rgba(56, 189, 248, 0.14) 0%, rgba(34, 211, 238, 0.06) 42%, transparent 72%),
        linear-gradient(180deg, rgba(26, 39, 64, 0.94), rgba(26, 39, 64, 0.82));
}

[data-theme="light"] {
    color-scheme: light;

    --color-midnight-ink: #f3f4f6;
    --color-graphite-plate: #ffffff;
    --color-steel-border: #d1d5db;
    --color-fog: #6b7280;
    --color-pebble: #4b5563;
    --color-moonlight: #111827;
    --color-ice: #1f2937;
    --color-glacier: #374151;
    --color-frost-link: #2563eb;
    --color-electric-iris: #2563eb;
    --color-ember: #dc2626;
    --color-azure: #0284c7;
    --color-cipher-mint: #059669;

    --crm-bg: #f3f4f6;
    --crm-bg-2: #e5e7eb;
    --crm-surface: #ffffff;
    --crm-surface-2: #f9fafb;
    --crm-surface-3: #f3f4f6;
    --crm-border: #d1d5db;
    --crm-border-soft: rgba(17, 24, 39, 0.10);
    --crm-text: #111827;
    --crm-text-muted: #6b7280;
    --crm-text-faint: #9ca3af;
    --crm-accent: #2563eb;
    --crm-accent-hover: #1d4ed8;
    --crm-accent-strong: #3b82f6;
    --crm-success: #059669;
    --crm-warning: #d97706;
    --crm-error: #dc2626;
    --crm-shadow-soft: 0 12px 32px rgba(17, 24, 39, 0.08);
    --crm-shadow-card: 0 8px 24px rgba(17, 24, 39, 0.06);
    --crm-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);

    --bg-surface: var(--crm-surface);
    --border-color: var(--crm-border);
    --text-main: var(--crm-text);
    --text-muted: var(--crm-text-muted);

    --crm-glass-header: rgba(255, 255, 255, 0.92);
    --crm-glass-sidebar: rgba(255, 255, 255, 0.98);
    --crm-glass-sticky: rgba(255, 255, 255, 0.96);
    --crm-body-bg-image:
        radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.10), transparent 24rem),
        radial-gradient(circle at 92% 8%, rgba(14, 165, 233, 0.08), transparent 22rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    --crm-card-bg-image: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --crm-sidebar-bg-image:
        linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
    --crm-header-bg-image:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.05) 46%, transparent 74%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
    --crm-hover-surface: rgba(37, 99, 235, 0.08);
    --crm-hover-border: rgba(37, 99, 235, 0.22);
    --crm-active-surface: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(59, 130, 246, 0.06));
    --crm-active-border: rgba(37, 99, 235, 0.35);
    --crm-input-bg: #ffffff;
    --crm-table-head-bg: #f3f4f6;
    --crm-table-row-hover: rgba(37, 99, 235, 0.06);
    --crm-ghost-bg: rgba(17, 24, 39, 0.04);
    --crm-secondary-bg: rgba(17, 24, 39, 0.05);
    --crm-secondary-hover-bg: rgba(37, 99, 235, 0.08);
    --crm-secondary-hover-border: rgba(37, 99, 235, 0.24);
    --crm-btn-primary-border: rgba(37, 99, 235, 0.35);
    --crm-btn-primary-text: #ffffff;
    --crm-btn-primary-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
    --crm-link-color: #2563eb;
    --crm-splash-bg: #f3f4f6;
    --crm-splash-text: #111827;
}

[data-theme="fuchsia"] {
    color-scheme: light;

    --color-midnight-ink: #fff1f5;
    --color-graphite-plate: #ffffff;
    --color-steel-border: #f9a8d4;
    --color-fog: #9d174d;
    --color-pebble: #831843;
    --color-moonlight: #3f1b2e;
    --color-ice: #4a044e;
    --color-glacier: #831843;
    --color-frost-link: #be185d;
    --color-electric-iris: #db2777;
    --color-ember: #e11d48;
    --color-azure: #db2777;
    --color-cipher-mint: #059669;

    --crm-bg: #fff1f5;
    --crm-bg-2: #fce7f3;
    --crm-surface: #ffffff;
    --crm-surface-2: #fff7fb;
    --crm-surface-3: #fce7f3;
    --crm-border: #f9a8d4;
    --crm-border-soft: rgba(219, 39, 119, 0.16);
    --crm-text: #3f1b2e;
    --crm-text-muted: #8b5a72;
    --crm-text-faint: #b08a9c;
    --crm-accent: #db2777;
    --crm-accent-hover: #be185d;
    --crm-accent-strong: #ec4899;
    --crm-success: #059669;
    --crm-warning: #d97706;
    --crm-error: #e11d48;
    --crm-shadow-soft: 0 12px 32px rgba(131, 24, 67, 0.10);
    --crm-shadow-card: 0 8px 24px rgba(131, 24, 67, 0.08);
    --crm-focus-ring: 0 0 0 3px rgba(219, 39, 119, 0.22);

    --bg-surface: var(--crm-surface);
    --border-color: var(--crm-border);
    --text-main: var(--crm-text);
    --text-muted: var(--crm-text-muted);

    --crm-glass-header: rgba(255, 255, 255, 0.92);
    --crm-glass-sidebar: rgba(255, 247, 251, 0.98);
    --crm-glass-sticky: rgba(255, 255, 255, 0.96);
    --crm-body-bg-image:
        radial-gradient(circle at 8% 0%, rgba(236, 72, 153, 0.16), transparent 24rem),
        radial-gradient(circle at 92% 8%, rgba(244, 114, 182, 0.12), transparent 22rem),
        linear-gradient(180deg, #fff7fb 0%, #fce7f3 100%);
    --crm-card-bg-image: linear-gradient(180deg, #ffffff 0%, #fff5f9 100%);
    --crm-hover-surface: rgba(219, 39, 119, 0.08);
    --crm-hover-border: rgba(219, 39, 119, 0.24);
    --crm-active-surface: linear-gradient(135deg, rgba(219, 39, 119, 0.14), rgba(236, 72, 153, 0.06));
    --crm-active-border: rgba(219, 39, 119, 0.36);
    --crm-input-bg: #ffffff;
    --crm-table-head-bg: #fce7f3;
    --crm-table-row-hover: rgba(219, 39, 119, 0.06);
    --crm-ghost-bg: rgba(63, 27, 46, 0.04);
    --crm-secondary-bg: rgba(219, 39, 119, 0.06);
    --crm-secondary-hover-bg: rgba(219, 39, 119, 0.10);
    --crm-secondary-hover-border: rgba(219, 39, 119, 0.26);
    --crm-btn-primary-border: rgba(219, 39, 119, 0.35);
    --crm-btn-primary-text: #ffffff;
    --crm-btn-primary-shadow: 0 10px 24px rgba(219, 39, 119, 0.20);
    --crm-link-color: #be185d;
    --crm-splash-bg: #fff1f5;
    --crm-splash-text: #3f1b2e;
    --crm-sidebar-bg-image:
        linear-gradient(180deg, rgba(236, 72, 153, 0.10) 0%, transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fff1f5 100%);
    --crm-header-bg-image:
        linear-gradient(90deg, rgba(236, 72, 153, 0.10) 0%, rgba(244, 114, 182, 0.06) 46%, transparent 74%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 251, 0.92));
}

[data-theme="dark"] .crm-body,
[data-theme="light"] .crm-body,
[data-theme="fuchsia"] .crm-body {
    background: var(--crm-body-bg-image) !important;
    color: var(--crm-text);
}

.crm-header {
    background: var(--crm-header-bg-image) !important;
}

.crm-sidebar {
    background: var(--crm-sidebar-bg-image) !important;
}

[data-theme="light"] .crm-header,
[data-theme="fuchsia"] .crm-header {
    background: var(--crm-header-bg-image) !important;
    border-bottom-color: var(--crm-border-soft);
}

[data-theme="light"] .crm-sidebar,
[data-theme="fuchsia"] .crm-sidebar {
    background: var(--crm-sidebar-bg-image) !important;
    border-right-color: var(--crm-border-soft);
}

[data-theme="light"] .crm-footer,
[data-theme="fuchsia"] .crm-footer {
    background: var(--crm-surface);
    border-top-color: var(--crm-border-soft);
    color: var(--crm-text-muted);
}

[data-theme="light"] a,
[data-theme="fuchsia"] a {
    color: var(--crm-link-color);
}

[data-theme="light"] .crm-login-card,
[data-theme="light"] .crm-dashboard-widget,
[data-theme="light"] .crm-role-cabinet,
[data-theme="light"] .crm-card-section,
[data-theme="light"] .crm-card,
[data-theme="light"] .crm-dashboard-quicklinks,
[data-theme="light"] .crm-dashboard-tasks,
[data-theme="light"] .crm-notifications,
[data-theme="light"] .crm-table-wrap,
[data-theme="fuchsia"] .crm-login-card,
[data-theme="fuchsia"] .crm-dashboard-widget,
[data-theme="fuchsia"] .crm-role-cabinet,
[data-theme="fuchsia"] .crm-card-section,
[data-theme="fuchsia"] .crm-card,
[data-theme="fuchsia"] .crm-dashboard-quicklinks,
[data-theme="fuchsia"] .crm-dashboard-tasks,
[data-theme="fuchsia"] .crm-notifications,
[data-theme="fuchsia"] .crm-table-wrap {
    background: var(--crm-card-bg-image) !important;
    border-color: var(--crm-border-soft) !important;
    box-shadow: var(--crm-shadow-card);
}

[data-theme="light"] .crm-sidebar-link:hover,
[data-theme="light"] .crm-nav-link:hover,
[data-theme="light"] .crm-nav-dropdown-trigger:hover,
[data-theme="light"] .crm-director-stat-card:hover,
[data-theme="light"] .crm-quicklink-card:hover,
[data-theme="light"] .crm-role-ops-chip:hover,
[data-theme="fuchsia"] .crm-sidebar-link:hover,
[data-theme="fuchsia"] .crm-nav-link:hover,
[data-theme="fuchsia"] .crm-nav-dropdown-trigger:hover,
[data-theme="fuchsia"] .crm-director-stat-card:hover,
[data-theme="fuchsia"] .crm-quicklink-card:hover,
[data-theme="fuchsia"] .crm-role-ops-chip:hover {
    background: var(--crm-hover-surface) !important;
    border-color: var(--crm-hover-border);
    color: var(--crm-text);
}

[data-theme="light"] .crm-sidebar-link-active,
[data-theme="light"] .crm-nav-link-active,
[data-theme="light"] .crm-nav-dropdown-trigger.crm-nav-link-active,
[data-theme="fuchsia"] .crm-sidebar-link-active,
[data-theme="fuchsia"] .crm-nav-link-active,
[data-theme="fuchsia"] .crm-nav-dropdown-trigger.crm-nav-link-active {
    background: var(--crm-active-surface) !important;
    border-color: var(--crm-active-border) !important;
    color: var(--crm-text) !important;
}

[data-theme="light"] .crm-btn-primary,
[data-theme="light"] .crm-btn-accent,
[data-theme="fuchsia"] .crm-btn-primary,
[data-theme="fuchsia"] .crm-btn-accent {
    border-color: var(--crm-btn-primary-border) !important;
    background: linear-gradient(135deg, var(--crm-accent), var(--crm-accent-strong)) !important;
    color: var(--crm-btn-primary-text) !important;
    box-shadow: var(--crm-btn-primary-shadow);
}

[data-theme="light"] .crm-btn-ghost,
[data-theme="fuchsia"] .crm-btn-ghost {
    border-color: var(--crm-border-soft) !important;
    background: var(--crm-ghost-bg) !important;
    color: var(--crm-text) !important;
}

[data-theme="light"] .crm-btn-secondary,
[data-theme="fuchsia"] .crm-btn-secondary {
    border-color: var(--crm-border-soft) !important;
    background: var(--crm-secondary-bg) !important;
    color: var(--crm-text) !important;
}

[data-theme="light"] .crm-btn-secondary:hover,
[data-theme="fuchsia"] .crm-btn-secondary:hover {
    border-color: var(--crm-secondary-hover-border) !important;
    background: var(--crm-secondary-hover-bg) !important;
}

[data-theme="light"] .crm-input,
[data-theme="light"] .crm-select,
[data-theme="light"] .crm-search-input,
[data-theme="light"] .crm-textarea,
[data-theme="light"] input.crm-input,
[data-theme="light"] select.crm-input,
[data-theme="light"] textarea.crm-input,
[data-theme="fuchsia"] .crm-input,
[data-theme="fuchsia"] .crm-select,
[data-theme="fuchsia"] .crm-search-input,
[data-theme="fuchsia"] .crm-textarea,
[data-theme="fuchsia"] input.crm-input,
[data-theme="fuchsia"] select.crm-input,
[data-theme="fuchsia"] textarea.crm-input {
    background: var(--crm-input-bg) !important;
    border-color: var(--crm-border) !important;
    color: var(--crm-text) !important;
}

[data-theme="light"] .crm-table th,
[data-theme="fuchsia"] .crm-table th {
    background: var(--crm-table-head-bg) !important;
    color: var(--crm-text-muted) !important;
}

[data-theme="light"] .crm-table tbody tr:hover,
[data-theme="fuchsia"] .crm-table tbody tr:hover {
    background: var(--crm-table-row-hover) !important;
}

[data-theme="light"] .crm-nav-dropdown-menu,
[data-theme="light"] .crm-notif-dropdown,
[data-theme="light"] .crm-ai-dropdown,
[data-theme="light"] .crm-role-switch-menu,
[data-theme="fuchsia"] .crm-nav-dropdown-menu,
[data-theme="fuchsia"] .crm-notif-dropdown,
[data-theme="fuchsia"] .crm-ai-dropdown,
[data-theme="fuchsia"] .crm-role-switch-menu {
    background: var(--crm-surface) !important;
    border-color: var(--crm-border-soft) !important;
    color: var(--crm-text);
    box-shadow: var(--crm-shadow-soft);
}

[data-theme="light"] .crm-nav-dropdown-item:hover,
[data-theme="light"] .crm-notif-list li:hover,
[data-theme="fuchsia"] .crm-nav-dropdown-item:hover,
[data-theme="fuchsia"] .crm-notif-list li:hover {
    background: var(--crm-hover-surface);
}

[data-theme="light"] .crm-page-header.crm-ts-history-header,
[data-theme="fuchsia"] .crm-page-header.crm-ts-history-header {
    background: var(--crm-glass-sticky);
}

[data-theme="light"] .crm-ts-history-details,
[data-theme="fuchsia"] .crm-ts-history-details {
    background: var(--crm-surface-2);
    border-color: var(--crm-border-soft);
}

[data-theme="light"] .crm-ts-history-week-item,
[data-theme="fuchsia"] .crm-ts-history-week-item {
    background: var(--crm-ghost-bg);
    border-color: var(--crm-border-soft);
}

[data-theme="light"] .crm-ts-history-filters-note,
[data-theme="fuchsia"] .crm-ts-history-filters-note {
    background: var(--crm-hover-surface);
    border-color: var(--crm-border-soft);
    color: var(--crm-text-muted);
}

[data-theme="light"] .crm-login-kicker,
[data-theme="fuchsia"] .crm-login-kicker {
    border-color: var(--crm-hover-border);
    background: var(--crm-hover-surface);
    color: var(--crm-accent-hover);
}

[data-theme="light"] .crm-login-trust-grid span,
[data-theme="fuchsia"] .crm-login-trust-grid span {
    background: var(--crm-ghost-bg);
    border-color: var(--crm-border-soft);
    color: var(--crm-text);
}

[data-theme="light"] .crm-login-app-link,
[data-theme="fuchsia"] .crm-login-app-link {
    background: var(--crm-ghost-bg);
    border-color: var(--crm-border-soft);
    color: var(--crm-text);
}

[data-theme="light"] .crm-settings-nav-link.is-active,
[data-theme="fuchsia"] .crm-settings-nav-link.is-active {
    background: var(--crm-active-surface);
    border-color: var(--crm-active-border);
    color: var(--crm-text);
}

[data-theme="light"] .crm-message-error,
[data-theme="fuchsia"] .crm-message-error {
    background: rgba(220, 38, 38, 0.12);
    color: var(--crm-error);
}

[data-theme="light"] .crm-message-success,
[data-theme="fuchsia"] .crm-message-success {
    background: rgba(5, 150, 105, 0.12);
    color: var(--crm-success);
}

#crm-boot-splash {
    background: var(--crm-splash-bg);
    color: var(--crm-splash-text);
}

.crm-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    font-family: system-ui, -apple-system, sans-serif;
}

.crm-boot-splash-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.crm-boot-splash-status {
    margin: 0;
    opacity: 0.9;
}

.crm-theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.crm-theme-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--crm-border-soft);
    border-radius: var(--crm-radius-lg, 16px);
    background: var(--crm-surface);
    color: var(--crm-text);
    cursor: pointer;
    text-align: left;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    font-family: inherit;
}

.crm-theme-option:hover {
    border-color: var(--crm-hover-border);
    transform: translateY(-2px);
    box-shadow: var(--crm-shadow-soft);
}

.crm-theme-option.is-selected {
    border-color: var(--crm-accent);
    box-shadow: var(--crm-focus-ring);
}

.crm-theme-option:focus-visible {
    outline: none;
    box-shadow: var(--crm-focus-ring);
}

.crm-theme-preview {
    display: grid;
    grid-template-rows: 28px 1fr 36px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--crm-border-soft);
}

.crm-theme-preview-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
}

.crm-theme-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.crm-theme-preview-body {
    display: flex;
    min-height: 0;
}

.crm-theme-preview-sidebar {
    width: 28%;
    flex-shrink: 0;
}

.crm-theme-preview-main {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-theme-preview-card {
    flex: 1;
    border-radius: 6px;
}

.crm-theme-preview-chip {
    width: 48%;
    height: 8px;
    border-radius: 999px;
}

.crm-theme-preview-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.crm-theme-preview--dark .crm-theme-preview-bar { background: #2c4060; }
.crm-theme-preview--dark .crm-theme-preview-dot { background: #38bdf8; }
.crm-theme-preview--dark .crm-theme-preview-sidebar { background: #243552; }
.crm-theme-preview--dark .crm-theme-preview-main { background: #1a2740; }
.crm-theme-preview--dark .crm-theme-preview-card { background: #2c4060; border: 1px solid rgba(186, 210, 235, 0.22); }
.crm-theme-preview--dark .crm-theme-preview-chip { background: rgba(56, 189, 248, 0.40); }
.crm-theme-preview--dark .crm-theme-preview-footer { background: #243552; color: #b4c3d6; }

.crm-theme-preview--light .crm-theme-preview-bar { background: #ffffff; border-bottom: 1px solid #e5e7eb; }
.crm-theme-preview--light .crm-theme-preview-dot { background: #2563eb; }
.crm-theme-preview--light .crm-theme-preview-sidebar { background: #f9fafb; border-right: 1px solid #e5e7eb; }
.crm-theme-preview--light .crm-theme-preview-main { background: #f3f4f6; }
.crm-theme-preview--light .crm-theme-preview-card { background: #ffffff; border: 1px solid #e5e7eb; }
.crm-theme-preview--light .crm-theme-preview-chip { background: rgba(37, 99, 235, 0.25); }
.crm-theme-preview--light .crm-theme-preview-footer { background: #ffffff; color: #6b7280; border-top: 1px solid #e5e7eb; }

.crm-theme-preview--fuchsia .crm-theme-preview-bar { background: #ffffff; border-bottom: 1px solid #f9a8d4; }
.crm-theme-preview--fuchsia .crm-theme-preview-dot { background: #db2777; }
.crm-theme-preview--fuchsia .crm-theme-preview-sidebar { background: #fff7fb; border-right: 1px solid #fbcfe8; }
.crm-theme-preview--fuchsia .crm-theme-preview-main { background: #fff1f5; }
.crm-theme-preview--fuchsia .crm-theme-preview-card { background: #ffffff; border: 1px solid #f9a8d4; }
.crm-theme-preview--fuchsia .crm-theme-preview-chip { background: rgba(219, 39, 119, 0.28); }
.crm-theme-preview--fuchsia .crm-theme-preview-footer { background: #ffffff; color: #be185d; border-top: 1px solid #fbcfe8; }

.crm-theme-option-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.crm-theme-option-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--crm-text-muted);
}

.crm-theme-option-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--crm-border-soft);
    color: var(--crm-text-muted);
}

.crm-theme-option.is-selected .crm-theme-option-badge {
    border-color: var(--crm-active-border);
    background: var(--crm-hover-surface);
    color: var(--crm-text);
}

[data-theme="light"] .crm-finance-panel,
[data-theme="light"] .crm-finance-card,
[data-theme="light"] .crm-finance-kpi,
[data-theme="fuchsia"] .crm-finance-panel,
[data-theme="fuchsia"] .crm-finance-card,
[data-theme="fuchsia"] .crm-finance-kpi {
    background: var(--crm-surface) !important;
    border-color: var(--crm-border-soft) !important;
}

[data-theme="light"] .crm-ts-panel,
[data-theme="light"] .crm-ts-week-card,
[data-theme="fuchsia"] .crm-ts-panel,
[data-theme="fuchsia"] .crm-ts-week-card {
    background: var(--crm-card-bg-image) !important;
    border-color: var(--crm-border-soft) !important;
}

/* -------------------------------------------------------------------------- */
/* Табель — календарь смен (месяц / неделя)                                   */
/* -------------------------------------------------------------------------- */

[data-theme="light"] .crm-page-timesheet .crm-ts-month-calendar-cell,
[data-theme="light"] .crm-page-timesheet .crm-ts-shift-calendar-cell,
[data-theme="light"] .crm-ts-shift-calendar-cell {
    background: #f8fafc;
}

[data-theme="light"] .crm-ts-month-shift-picker,
[data-theme="light"] .crm-ts-month-shift-readonly,
[data-theme="light"] .crm-ts-week-shift-picker {
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

[data-theme="light"] .crm-ts-month-dow,
[data-theme="light"] .crm-page-timesheet .crm-ts-month-dow {
    color: #374151;
    font-weight: 700;
}

[data-theme="light"] .crm-ts-cal-cell {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #111827;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .crm-ts-cal-dow {
    color: #64748b;
    font-weight: 600;
}

[data-theme="light"] .crm-ts-cal-dom {
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .crm-ts-cal-out {
    opacity: 1;
}

[data-theme="light"] .crm-ts-cal-out .crm-ts-cal-dom,
[data-theme="light"] .crm-ts-cal-out .crm-ts-cal-dow {
    color: #94a3b8;
}

[data-theme="light"] .crm-ts-cal-empty:not(:disabled):hover {
    border-color: #2563eb;
    background: #f8fafc;
}

[data-theme="light"] .crm-ts-cal-day {
    background: #bfdbfe;
    border-color: #2563eb;
}

[data-theme="light"] .crm-ts-cal-day .crm-ts-cal-dom {
    color: #1e3a8a;
}

[data-theme="light"] .crm-ts-cal-ne::before {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.72) 0%, rgba(196, 181, 253, 0.42) 100%);
}

[data-theme="light"] .crm-ts-cal-ns::after {
    background: linear-gradient(180deg, rgba(196, 181, 253, 0.38) 0%, rgba(126, 34, 206, 0.72) 100%);
}

[data-theme="light"] .crm-ts-cal-cell.crm-ts-cal-ns,
[data-theme="light"] .crm-ts-cal-cell.crm-ts-cal-ne {
    border-color: #7c3aed;
    background: #f5f3ff;
}

[data-theme="light"] .crm-ts-cal-cell.crm-ts-cal-ns .crm-ts-cal-dom,
[data-theme="light"] .crm-ts-cal-cell.crm-ts-cal-ne .crm-ts-cal-dom {
    color: #581c87;
}

[data-theme="light"] .crm-ts-mode-btn-active.crm-ts-mode-btn-day {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e3a8a;
}

[data-theme="light"] .crm-ts-mode-btn-active.crm-ts-mode-btn-night {
    border-color: #7c3aed;
    background: #ede9fe;
    color: #5b21b6;
}

[data-theme="light"] .crm-ts-shift-summary-caption {
    color: #64748b;
}

[data-theme="light"] .crm-ts-stat-day {
    background: #eff6ff;
    border-color: #93c5fd;
}

[data-theme="light"] .crm-ts-stat-night {
    background: #f5f3ff;
    border-color: #c4b5fd;
}

[data-theme="light"] .crm-ts-stat-cal {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .crm-ts-stat-day .crm-ts-stat-label {
    color: #1d4ed8;
}

[data-theme="light"] .crm-ts-stat-night .crm-ts-stat-label {
    color: #7c3aed;
}

[data-theme="light"] .crm-ts-stat-cal .crm-ts-stat-label {
    color: #475569;
}

[data-theme="light"] .crm-ts-stat-num {
    color: #0f172a;
}

[data-theme="light"] .crm-ts-stat-day .crm-ts-stat-hint-mini {
    color: #3b82f6;
}

[data-theme="light"] .crm-ts-stat-night .crm-ts-stat-hint-mini {
    color: #8b5cf6;
}

[data-theme="light"] .crm-ts-stat-cal .crm-ts-stat-hint-mini {
    color: #64748b;
}

[data-theme="light"] .crm-ts-summary-sep,
[data-theme="light"] .crm-ts-summary-sep-inner {
    color: #94a3b8;
}

[data-theme="light"] .crm-ts-shift-summary-month-wrap {
    border-top-color: #e2e8f0;
}

[data-theme="light"] .crm-ts-shift-summary-month-heading {
    color: #64748b;
}

[data-theme="light"] .crm-ts-stat-month-shift {
    color: #1d4ed8;
}

[data-theme="light"] .crm-ts-stat-month-shift strong {
    color: #1e3a8a;
}

[data-theme="light"] .crm-ts-stat-month-day {
    color: #7c3aed;
}

[data-theme="light"] .crm-ts-stat-month-day strong {
    color: #5b21b6;
}

[data-theme="light"] .crm-ts-shift-summary-month-label,
[data-theme="light"] .crm-ts-shift-summary-month-hint-meta {
    color: #64748b;
}

[data-theme="light"] .crm-ts-week-legend,
[data-theme="light"] .crm-ts-shift-summary {
    color: #64748b;
}

[data-theme="light"] .crm-timesheet-fin-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

[data-theme="light"] .crm-timesheet-fin-table tbody tr:hover {
    background: #eff6ff;
}

[data-theme="light"] .crm-club-header {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #e2e8f0;
}

[data-theme="light"] .crm-ts-view-card {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

[data-theme="light"] .crm-ts-view-table thead th {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-color: #cbd5e1;
    box-shadow: 0 2px 0 #e2e8f0;
}

[data-theme="light"] .crm-ts-view-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

[data-theme="light"] .crm-ts-view-table tbody tr:hover {
    background: #eff6ff;
}

[data-theme="light"] .crm-ts-view-col-num {
    color: #334155;
}

[data-theme="light"] .crm-ts-view-col-payout {
    background: rgba(5, 150, 105, 0.10);
    color: #047857;
}

[data-theme="light"] .crm-ts-view-col-remain {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

[data-theme="light"] .crm-timesheet-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
}

[data-theme="light"] .crm-timesheet-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.55);
}

/* Розовая — календарь табеля */
[data-theme="fuchsia"] .crm-page-timesheet .crm-ts-month-calendar-cell,
[data-theme="fuchsia"] .crm-page-timesheet .crm-ts-shift-calendar-cell,
[data-theme="fuchsia"] .crm-ts-shift-calendar-cell {
    background: #fff7fb;
}

[data-theme="fuchsia"] .crm-ts-month-shift-picker,
[data-theme="fuchsia"] .crm-ts-month-shift-readonly,
[data-theme="fuchsia"] .crm-ts-week-shift-picker {
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #f9a8d4;
    background: #ffffff;
}

[data-theme="fuchsia"] .crm-ts-month-dow,
[data-theme="fuchsia"] .crm-page-timesheet .crm-ts-month-dow {
    color: #be185d;
}

[data-theme="fuchsia"] .crm-ts-cal-cell {
    background: #ffffff;
    border-color: #f9a8d4;
    color: #3f1b2e;
}

[data-theme="fuchsia"] .crm-ts-cal-dow {
    color: #8b5a72;
}

[data-theme="fuchsia"] .crm-ts-cal-day {
    background: #fbcfe8;
    border-color: #db2777;
}

[data-theme="fuchsia"] .crm-ts-cal-ne::before {
    background: linear-gradient(180deg, rgba(219, 39, 119, 0.72) 0%, rgba(244, 114, 182, 0.28) 100%);
}

[data-theme="fuchsia"] .crm-ts-cal-ns::after {
    background: linear-gradient(180deg, rgba(244, 114, 182, 0.28) 0%, rgba(190, 24, 93, 0.72) 100%);
}

[data-theme="fuchsia"] .crm-ts-cal-cell.crm-ts-cal-ns,
[data-theme="fuchsia"] .crm-ts-cal-cell.crm-ts-cal-ne {
    border-color: #be185d;
    background: #fdf2f8;
}

[data-theme="fuchsia"] .crm-ts-mode-btn-active.crm-ts-mode-btn-day {
    border-color: #db2777;
    background: #fce7f3;
    color: #831843;
}

[data-theme="fuchsia"] .crm-ts-mode-btn-active.crm-ts-mode-btn-night {
    border-color: #be185d;
    background: #fbcfe8;
    color: #831843;
}

[data-theme="fuchsia"] .crm-ts-stat-day {
    background: #fce7f3;
    border-color: #f9a8d4;
}

[data-theme="fuchsia"] .crm-ts-stat-night {
    background: #fdf2f8;
    border-color: #f472b6;
}

[data-theme="fuchsia"] .crm-ts-stat-cal {
    background: #fff7fb;
    border-color: #fbcfe8;
}

[data-theme="fuchsia"] .crm-ts-stat-day .crm-ts-stat-label {
    color: #be185d;
}

[data-theme="fuchsia"] .crm-ts-stat-night .crm-ts-stat-label {
    color: #831843;
}

[data-theme="fuchsia"] .crm-ts-stat-month-shift,
[data-theme="fuchsia"] .crm-ts-stat-month-shift strong {
    color: #be185d;
}

[data-theme="fuchsia"] .crm-ts-stat-month-day,
[data-theme="fuchsia"] .crm-ts-stat-month-day strong {
    color: #831843;
}

[data-theme="fuchsia"] .crm-club-header {
    background: linear-gradient(135deg, #ffffff, #fff1f5);
    border-color: #f9a8d4;
}

[data-theme="fuchsia"] .crm-timesheet-fin-table tbody tr:nth-child(even) {
    background: #fff7fb;
}

[data-theme="fuchsia"] .crm-timesheet-fin-table tbody tr:hover {
    background: #fce7f3;
}
