/* ============================================================================
   THEME SYSTEM — светлая / тёмная тема
   Управляется атрибутом data-theme на <html>:
     (нет атрибута) или data-theme="light"  → светлая
     data-theme="dark"                       → тёмная
   Режим "auto" (по системе) выставляет data-theme через theme.js
   на основе prefers-color-scheme, поэтому CSS знает только light/dark.
   Подключается ПОСЛЕ style.css / chat-unified.css / mobile.css,
   чтобы переопределять их значения.
   @version 2.0.0 — Полная поддержка всех десктопных и мобильных компонентов
   ============================================================================ */

/* --- Семантические токены поверхностей (светлая тема — значения по умолчанию) --- */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --accent-color: #8b5cf6;
    
    --surface-bg: #f1f5f9;          /* фон рабочей области */
    --surface-card: #ffffff;        /* карточки, панели */
    --surface-card-2: #f8fafc;      /* вторичные поверхности (заголовки, секции) */
    --surface-sunken: #f1f5f9;      /* «утопленные» блоки (инпуты, info-item) */
    --surface-border: #e2e8f0;      /* границы */
    --surface-border-strong: #cbd5e1;
    --surface-text: #0f172a;        /* основной текст */
    --surface-text-muted: #64748b;  /* приглушённый текст */
    --surface-text-faint: #94a3b8;  /* совсем светлый текст */
    --surface-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
    --surface-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --surface-shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
    --surface-hover: #f8fafc;       /* фон при наведении */
    --scrollbar-thumb: rgba(0, 0, 0, 0.16);

    /* Мобильный бар / шапка (светлые) */
    --mobile-nav-bg: rgba(255, 255, 255, 0.88);
    --mobile-header-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --mobile-card-bg: #ffffff;
    --mobile-card-border: #e2e8f0;

    color-scheme: light;
}

/* --- Тёмная тема (Dark Mode Tokens) --- */
[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent-color: #a78bfa;

    --surface-bg: #0b0f17;          /* ультра-глубокий стильный тёмный канвас */
    --surface-card: #141b26;        /* основной фон карточек */
    --surface-card-2: #1b2432;      /* вторичные блоки / заголовки */
    --surface-sunken: #0f1520;      /* инпуты, утопленные плашки */
    --surface-border: #232d3d;      /* деликатные границы */
    --surface-border-strong: #334155;
    --surface-text: #f1f5f9;        /* контрастный читаемый белый текст */
    --surface-text-muted: #94a3b8;  /* мягкий приглушённый текст */
    --surface-text-faint: #64748b;  /* вспомогательный текст */
    --surface-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --surface-shadow: 0 6px 18px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.35);
    --surface-shadow-lg: 0 14px 34px -4px rgba(0, 0, 0, 0.7), 0 6px 14px -2px rgba(0, 0, 0, 0.4);
    --surface-hover: #1e2838;       /* подсветка при наведении */
    --scrollbar-thumb: rgba(255, 255, 255, 0.16);

    /* Мобильный бар / шапка (тёмные) */
    --mobile-nav-bg: rgba(20, 27, 38, 0.92);
    --mobile-header-bg: linear-gradient(135deg, #182030 0%, #1e1b4b 100%);
    --mobile-card-bg: #141b26;
    --mobile-card-border: #232d3d;

    /* Переопределяем базовые токены из style.css */
    --secondary-color: #0b0f17;
    --text-color: #f1f5f9;
    --text-light: #94a3b8;

    /* Сохраняем color-scheme: light, чтобы системные иконки статус-бара Android оставались тёмными и видимыми на белой полосе */
    color-scheme: light;
}

/* Плавный переход при смене темы */
html.theme-transition,
html.theme-transition body,
html.theme-transition .desktop-topbar,
html.theme-transition .topbar-icon-btn,
html.theme-transition .topbar-user-chip,
html.theme-transition .topbar-search-trigger,
html.theme-transition .card,
html.theme-transition .dt-task-card,
html.theme-transition .task-card,
html.theme-transition .main-content,
html.theme-transition .sidebar,
html.theme-transition .mobile-bottom-nav,
html.theme-transition .mobile-header,
html.theme-transition .detail-header {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — базовые поверхности и компоненты
   ============================================================================ */

html {
    background-color: var(--surface-bg, #f1f5f9);
}

[data-theme="dark"],
html[data-theme="dark"] {
    background-color: #0b0f17 !important;
}

[data-theme="dark"] body {
    background-color: var(--surface-bg, #0b0f17);
    color: var(--surface-text);
}

[data-theme="dark"] .main-content {
    background: linear-gradient(135deg, #0b0f17 0%, #0f172a 100%);
}

/* --- Карточки / панели --- */
[data-theme="dark"] .card {
    background: var(--surface-card);
    color: var(--surface-text);
    border-color: var(--surface-border);
    box-shadow: var(--surface-shadow);
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
    color: var(--surface-text);
}
[data-theme="dark"] .table th {
    background: var(--surface-card-2);
    color: var(--surface-text);
    border-color: var(--surface-border);
}
[data-theme="dark"] .table,
[data-theme="dark"] .table td {
    color: var(--surface-text);
    border-color: var(--surface-border);
}
[data-theme="dark"] .table {
    background: var(--surface-card);
    --bs-table-bg: transparent;
    --bs-table-color: var(--surface-text);
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background: var(--surface-hover);
    color: var(--surface-text);
}

/* --- Текстовые утилиты Bootstrap --- */
[data-theme="dark"] .text-dark { color: var(--surface-text) !important; }
[data-theme="dark"] .text-muted { color: var(--surface-text-muted) !important; }
[data-theme="dark"] .text-secondary { color: var(--surface-text-muted) !important; }
[data-theme="dark"] .text-body { color: var(--surface-text) !important; }
[data-theme="dark"] .bg-white { background-color: var(--surface-card) !important; }
[data-theme="dark"] .bg-light { background-color: var(--surface-card-2) !important; color: var(--surface-text) !important; }
[data-theme="dark"] .bg-light-subtle { background-color: var(--surface-sunken) !important; color: var(--surface-text) !important; }
[data-theme="dark"] .bg-body-tertiary { background-color: var(--surface-sunken) !important; color: var(--surface-text) !important; }
[data-theme="dark"] .bg-body-secondary { background-color: var(--surface-card-2) !important; color: var(--surface-text) !important; }

/* --- Формы --- */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control {
    background: var(--surface-sunken);
    border-color: var(--surface-border);
    color: var(--surface-text);
}
[data-theme="dark"] select.form-select option {
    background: #141b26;
    color: #f1f5f9;
}
[data-theme="dark"] .form-control::placeholder { color: var(--surface-text-faint); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--surface-card);
    border-color: var(--primary-color);
    color: var(--surface-text);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-label-styled { color: var(--surface-text); }
[data-theme="dark"] .form-text { color: var(--surface-text-muted); }
[data-theme="dark"] .input-group-text {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .form-check-input {
    background-color: var(--surface-sunken);
    border-color: var(--surface-border-strong);
}
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
[data-theme="dark"] .form-check-label { color: var(--surface-text); }

/* Инвертируем иконку встроенного календаря в HTML5 date inputs */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}

/* --- Бейджи Bootstrap в тёмной теме --- */
[data-theme="dark"] .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--surface-text) !important;
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .badge.bg-secondary {
    background-color: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .badge.bg-dark {
    background-color: rgba(0, 0, 0, 0.4) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .badge.bg-primary {
    background-color: rgba(99, 102, 241, 0.22) !important;
    color: #c7d2fe !important;
}
[data-theme="dark"] .badge.bg-success {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
}
[data-theme="dark"] .badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.22) !important;
    color: #fde68a !important;
}
[data-theme="dark"] .badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.22) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .badge.bg-info {
    background-color: rgba(14, 165, 233, 0.22) !important;
    color: #7dd3fc !important;
}

/* --- Модалки / выпадашки / поповеры --- */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .popover,
[data-theme="dark"] .offcanvas {
    background: var(--surface-card);
    color: var(--surface-text);
    border-color: var(--surface-border);
    box-shadow: var(--surface-shadow-lg);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: var(--surface-border); }
[data-theme="dark"] .modal-title { color: var(--surface-text); }
[data-theme="dark"] .dropdown-item { color: var(--surface-text); }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: var(--surface-hover);
    color: var(--surface-text);
}
[data-theme="dark"] .dropdown-divider { border-color: var(--surface-border); }
[data-theme="dark"] .dropdown-header { color: var(--surface-text-muted); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(1.6); }

/* --- Списки --- */
[data-theme="dark"] .list-group-item {
    background: var(--surface-card);
    color: var(--surface-text);
    border-color: var(--surface-border);
}
[data-theme="dark"] .list-group-item-action:hover {
    background: var(--surface-hover);
    color: var(--surface-text);
}

/* --- Алерты --- */
[data-theme="dark"] .alert-info {
    background: rgba(99, 102, 241, 0.14);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
[data-theme="dark"] .alert-secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* --- Хлебные крошки и пагинация --- */
[data-theme="dark"] .breadcrumb-item { color: var(--surface-text-muted); }
[data-theme="dark"] .breadcrumb-item a { color: var(--primary-light); }
[data-theme="dark"] .breadcrumb-item.active { color: var(--surface-text-muted); }
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--surface-text-faint); }

[data-theme="dark"] .page-link {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--surface-text);
}
[data-theme="dark"] .page-link:hover {
    background: var(--surface-hover);
    border-color: var(--surface-border-strong);
    color: var(--primary-light);
}
[data-theme="dark"] .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
[data-theme="dark"] .page-item.disabled .page-link {
    background: var(--surface-sunken);
    border-color: var(--surface-border);
    color: var(--surface-text-faint);
}

/* --- Кнопки действий задачи (.task-action-btn) --- */
[data-theme="dark"] .action-start {
    background-color: rgba(34, 197, 94, 0.16) !important;
    color: #86efac !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}
[data-theme="dark"] .action-start:hover {
    background-color: rgba(34, 197, 94, 0.28) !important;
}
[data-theme="dark"] .action-pause {
    background-color: rgba(245, 158, 11, 0.16) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
[data-theme="dark"] .action-pause:hover {
    background-color: rgba(245, 158, 11, 0.28) !important;
}
[data-theme="dark"] .action-review {
    background-color: rgba(99, 102, 241, 0.18) !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.32) !important;
}
[data-theme="dark"] .action-review:hover {
    background-color: rgba(99, 102, 241, 0.3) !important;
}
[data-theme="dark"] .action-accept {
    background-color: rgba(34, 197, 94, 0.18) !important;
    color: #86efac !important;
    border-color: rgba(34, 197, 94, 0.32) !important;
}
[data-theme="dark"] .action-accept:hover {
    background-color: rgba(34, 197, 94, 0.3) !important;
}
[data-theme="dark"] .action-return {
    background-color: rgba(239, 68, 68, 0.16) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
[data-theme="dark"] .action-return:hover {
    background-color: rgba(239, 68, 68, 0.28) !important;
}
[data-theme="dark"] .action-delegate {
    background-color: rgba(168, 85, 247, 0.18) !important;
    color: #d8b4fe !important;
    border-color: rgba(168, 85, 247, 0.32) !important;
}
[data-theme="dark"] .action-delegate:hover {
    background-color: rgba(168, 85, 247, 0.3) !important;
}
[data-theme="dark"] .action-collaborators {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}
[data-theme="dark"] .action-collaborators:hover {
    background-color: rgba(16, 185, 129, 0.3) !important;
    color: #a7f3d0 !important;
}
[data-theme="dark"] .action-edit {
    background-color: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .action-edit:hover {
    background-color: var(--surface-hover) !important;
}
[data-theme="dark"] .action-delete {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.32) !important;
}
[data-theme="dark"] .action-delete:hover {
    background-color: rgba(239, 68, 68, 0.3) !important;
}
[data-theme="dark"] .action-back {
    background-color: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .action-back:hover {
    background-color: var(--surface-hover) !important;
}

/* --- Nav tabs / pills --- */
[data-theme="dark"] .nav-tabs { border-color: var(--surface-border); }
[data-theme="dark"] .nav-tabs .nav-link { color: var(--surface-text-muted); }
[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--surface-card);
    color: var(--surface-text);
    border-color: var(--surface-border) var(--surface-border) var(--surface-card);
}
[data-theme="dark"] .nav-pills .nav-link {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .nav-pills .nav-link.active {
    background: var(--primary-color);
    color: #ffffff;
}

/* --- Границы Bootstrap --- */
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end { border-color: var(--surface-border) !important; }

/* --- Скроллбары --- */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   ТЁМНАЯ ТЕМА — SELECT2 (компонент мультивыбора)
   ============================================================================ */
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: var(--surface-sunken) !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: 8px !important;
    color: var(--surface-text) !important;
    min-height: 40px;
}
[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--surface-text) !important;
    line-height: 38px;
}
[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--surface-text-muted) transparent transparent transparent !important;
}
[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: rgba(99, 102, 241, 0.2) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    color: #c7d2fe !important;
    border-radius: 6px !important;
}
[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #c7d2fe !important;
    margin-right: 4px;
}
[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fca5a5 !important;
}
[data-theme="dark"] .select2-dropdown {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
    box-shadow: var(--surface-shadow-lg) !important;
    border-radius: 8px !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--surface-sunken) !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: 6px !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .select2-container--default .select2-results__option {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted {
    background-color: var(--surface-hover) !important;
    color: var(--primary-light) !important;
}
[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: var(--surface-text) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — TINYMCE (визуальный редактор)
   ============================================================================ */
[data-theme="dark"] .tox-tinymce {
    border-color: var(--surface-border) !important;
    background-color: var(--surface-sunken) !important;
}
[data-theme="dark"] .tox .tox-toolbar,
[data-theme="dark"] .tox .tox-toolbar-overlord,
[data-theme="dark"] .tox .tox-toolbar__primary,
[data-theme="dark"] .tox .tox-menubar {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .tox .tox-tbtn,
[data-theme="dark"] .tox .tox-mbtn {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .tox .tox-tbtn svg,
[data-theme="dark"] .tox .tox-mbtn__select-label {
    fill: var(--surface-text-muted) !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .tox .tox-tbtn:hover,
[data-theme="dark"] .tox .tox-mbtn:hover {
    background-color: var(--surface-hover) !important;
}
[data-theme="dark"] .tox .tox-edit-area,
[data-theme="dark"] .tox .tox-edit-area iframe {
    background-color: var(--surface-sunken) !important;
}
[data-theme="dark"] .tox .tox-statusbar {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .tox .tox-dialog {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .tox .tox-dialog__header,
[data-theme="dark"] .tox .tox-dialog__footer {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .tox .tox-menu {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
}
[data-theme="dark"] .tox .tox-collection__item {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .tox .tox-collection__item--active {
    background-color: var(--surface-hover) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — ДЕСКТОПНЫЕ КАРТОЧКИ ЗАДАЧ (.dt-task-card)
   ============================================================================ */
[data-theme="dark"] .dt-task-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .dt-task-card:hover {
    background: #17202e;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
}
[data-theme="dark"] .dt-card__id {
    color: var(--surface-text-faint);
}
[data-theme="dark"] .dt-card__title {
    color: var(--surface-text);
}
[data-theme="dark"] .dt-card__desc {
    color: var(--surface-text-muted);
}

/* Статусы десктопной карточки в тёмной теме */
[data-theme="dark"] .dt-status-pending { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
[data-theme="dark"] .dt-status-pending .dt-status-dot { background: #94a3b8; box-shadow: 0 0 6px #94a3b8; }

[data-theme="dark"] .dt-status-in_progress { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-theme="dark"] .dt-status-in_progress .dt-status-dot { background: #6366f1; box-shadow: 0 0 6px #6366f1; }

[data-theme="dark"] .dt-status-paused { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
[data-theme="dark"] .dt-status-paused .dt-status-dot { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

[data-theme="dark"] .dt-status-review { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-theme="dark"] .dt-status-review .dt-status-dot { background: #8b5cf6; box-shadow: 0 0 6px #8b5cf6; }

[data-theme="dark"] .dt-status-completed { background: rgba(34, 197, 94, 0.18); color: #86efac; }
[data-theme="dark"] .dt-status-completed .dt-status-dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; }

[data-theme="dark"] .dt-status-cancelled { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .dt-status-cancelled .dt-status-dot { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

/* Приоритеты десктопной карточки в тёмной теме */
[data-theme="dark"] .dt-priority-high { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .dt-priority-medium { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
[data-theme="dark"] .dt-priority-low { background: rgba(34, 197, 94, 0.18); color: #86efac; }

/* Бейджи в десктопных карточках */
[data-theme="dark"] .dt-badge--comment { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .dt-badge--subtasks { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
[data-theme="dark"] .dt-badge--project { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }

/* Прогресс-бар */
[data-theme="dark"] .dt-progress-bar { background: var(--surface-sunken); }
[data-theme="dark"] .dt-progress-bar__text { color: var(--surface-text-muted); }

/* Медиа в карточках */
[data-theme="dark"] .dt-media-item { background: var(--surface-sunken); border: 1px solid var(--surface-border); }

/* Подвал и мета */
[data-theme="dark"] .dt-card__footer { border-top-color: var(--surface-border); }
[data-theme="dark"] .dt-avatar,
[data-theme="dark"] .task-card .avatar {
    background: var(--surface-card-2);
    border-color: var(--surface-card);
    color: var(--surface-text);
    border-radius: 50% !important;
}
[data-theme="dark"] .dt-avatar-letter,
[data-theme="dark"] .task-card .avatar-letter {
    color: var(--surface-text-muted);
    border-radius: 50% !important;
}
[data-theme="dark"] .dt-card__worktime,
[data-theme="dark"] .dt-card__deadline {
    background: var(--surface-sunken);
    color: var(--surface-text-muted);
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .dt-deadline--overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}
[data-theme="dark"] .dt-card__completed-info {
    border-top-color: var(--surface-border);
    color: #86efac;
}

/* ============================================================================
   СТИЛИ ДЛЯ КАНБАН-КОЛОНОК (МОИ ЗАДАЧИ / ПРОЕКТЫ)
   ============================================================================ */
.kanban-header--paused { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; color: #ffffff !important; }
.kanban-header--pending { background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important; color: #ffffff !important; }
.kanban-header--in-progress { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important; color: #ffffff !important; }
.kanban-header--review { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important; color: #ffffff !important; }
.kanban-header--completed { background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important; color: #ffffff !important; }

.kanban-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

/* Канбан-колонки на десктопе в тёмной теме */
[data-theme="dark"] .col-md-2-4 > .card {
    background: var(--surface-sunken);
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .col-md-2-4 > .card > .card-header:not([class*="kanban-header--"]) {
    background: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
    border-bottom: 1px solid var(--surface-border);
}

[data-theme="dark"] .kanban-header--paused { background: linear-gradient(135deg, #78350f 0%, #451a03 100%) !important; color: #fde68a !important; border-bottom: 1px solid rgba(245, 158, 11, 0.3) !important; }
[data-theme="dark"] .kanban-header--pending { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important; color: #e2e8f0 !important; border-bottom: 1px solid rgba(148, 163, 184, 0.3) !important; }
[data-theme="dark"] .kanban-header--in-progress { background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important; color: #bfdbfe !important; border-bottom: 1px solid rgba(59, 130, 246, 0.3) !important; }
[data-theme="dark"] .kanban-header--review { background: linear-gradient(135deg, #4c1d95 0%, #2e1065 100%) !important; color: #ddd6fe !important; border-bottom: 1px solid rgba(139, 92, 246, 0.3) !important; }
[data-theme="dark"] .kanban-header--completed { background: linear-gradient(135deg, #064e3b 0%, #022c22 100%) !important; color: #a7f3d0 !important; border-bottom: 1px solid rgba(16, 185, 129, 0.3) !important; }

[data-theme="dark"] .kanban-badge {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .dropzone {
    background: transparent;
}
[data-theme="dark"] .dropzone.dragover {
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — МОБИЛЬНЫЕ КАРТОЧКИ (.task-card) И СПИСОК
   ============================================================================ */
[data-theme="dark"] .task-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    color: var(--surface-text);
}
[data-theme="dark"] .task-card:active {
    background: #192230;
}
[data-theme="dark"] .task-card__title {
    color: var(--surface-text);
}
[data-theme="dark"] .task-id {
    color: var(--surface-text-faint);
}

/* Статусы и приоритеты мобильной карточки в тёмной теме */
[data-theme="dark"] .task-status.status-pending,
[data-theme="dark"] .status-badge.pending { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); }
[data-theme="dark"] .task-status.status-pending .status-dot,
[data-theme="dark"] .status-badge.pending .status-icon { background: #94a3b8; }

[data-theme="dark"] .task-status.status-in_progress,
[data-theme="dark"] .status-badge.in_progress { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.35); }
[data-theme="dark"] .task-status.status-in_progress .status-dot,
[data-theme="dark"] .status-badge.in_progress .status-icon { background: #6366f1; }

[data-theme="dark"] .task-status.status-paused,
[data-theme="dark"] .status-badge.paused { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .task-status.status-paused .status-dot,
[data-theme="dark"] .status-badge.paused .status-icon { background: #f59e0b; }

[data-theme="dark"] .task-status.status-review,
[data-theme="dark"] .status-badge.review { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.35); }
[data-theme="dark"] .task-status.status-review .status-dot,
[data-theme="dark"] .status-badge.review .status-icon { background: #8b5cf6; }

[data-theme="dark"] .task-status.status-completed,
[data-theme="dark"] .status-badge.completed { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.35); }
[data-theme="dark"] .task-status.status-completed .status-dot,
[data-theme="dark"] .status-badge.completed .status-icon { background: #22c55e; }

[data-theme="dark"] .task-priority.priority-high,
[data-theme="dark"] .priority-badge.high { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
[data-theme="dark"] .task-priority.priority-medium,
[data-theme="dark"] .priority-badge.medium { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .task-priority.priority-low,
[data-theme="dark"] .priority-badge.low { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.35); }

/* Мобильные бейджи и медиа */
[data-theme="dark"] .badge-comment { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .badge-subtasks { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
[data-theme="dark"] .badge-project { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-theme="dark"] .task-card__media { background: var(--surface-sunken); }
[data-theme="dark"] .media-item { border: 1px solid var(--surface-border); }

/* Подвал мобильной карточки */
[data-theme="dark"] .task-card__footer { border-top-color: var(--surface-border); }
[data-theme="dark"] .task-card .avatar {
    background: var(--surface-card-2);
    border-color: var(--surface-card);
}
[data-theme="dark"] .task-card .avatar-letter { color: var(--surface-text-muted); }
[data-theme="dark"] .task-work-time,
[data-theme="dark"] .task-deadline {
    background: var(--surface-sunken);
    color: var(--surface-text-muted);
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .task-deadline.overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — МОБИЛЬНЫЙ ХЕДЕР И НИЖНЯЯ ПАНЕЛЬ (HEADER & BOTTOM NAV)
   ============================================================================ */
[data-theme="dark"] .mobile-header {
    background: var(--mobile-header-bg);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .mobile-profile-link:hover {
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .mobile-user-avatar {
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .mobile-user-avatar-fallback {
    background: #283447;
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}
[data-theme="dark"] .mobile-header-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}
[data-theme="dark"] .mobile-header-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Нижняя панель навигации (Mobile Bottom Nav) */
[data-theme="dark"] .mobile-bottom-nav {
    background: var(--mobile-nav-bg);
    border-top: 1px solid var(--surface-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="dark"] .bottom-nav-item {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .bottom-nav-item.active {
    color: var(--primary-light);
}
[data-theme="dark"] .bottom-nav-plus {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — МОБИЛЬНАЯ СТРАНИЦА ДЕТАЛЕЙ ЗАДАЧИ (.mobile-detail-page)
   ============================================================================ */
[data-theme="dark"] .mobile-detail-page {
    background: var(--surface-bg);
    color: var(--surface-text);
}
[data-theme="dark"] .detail-header {
    background: rgba(20, 27, 38, 0.92);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: var(--surface-text);
}
[data-theme="dark"] .back-button,
[data-theme="dark"] .menu-button {
    color: var(--surface-text);
}
[data-theme="dark"] .back-button:active,
[data-theme="dark"] .menu-button:active {
    background-color: var(--surface-hover);
}
[data-theme="dark"] .task-title {
    color: var(--surface-text);
}
[data-theme="dark"] .task-info-section,
[data-theme="dark"] .participants-section,
[data-theme="dark"] .description-section,
[data-theme="dark"] .images-section,
[data-theme="dark"] .comments-section,
[data-theme="dark"] .history-section {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--surface-text);
}
[data-theme="dark"] .task-name {
    color: var(--surface-text);
}
[data-theme="dark"] .participant-label,
[data-theme="dark"] .deadline-info,
[data-theme="dark"] .work-time-info {
    color: var(--surface-text-muted);
    background: var(--surface-sunken);
}
[data-theme="dark"] .description-section h3,
[data-theme="dark"] .images-section h3,
[data-theme="dark"] .comments-section h3,
[data-theme="dark"] .history-section h3 {
    color: var(--surface-text);
}
[data-theme="dark"] .description-content {
    color: var(--surface-text);
}
[data-theme="dark"] .avatar-placeholder {
    background: var(--surface-card-2);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .comment-item {
    background: var(--surface-sunken);
    border: 1px solid var(--surface-border);
    color: var(--surface-text);
}
[data-theme="dark"] .comment-item.own-comment {
    background: var(--surface-card-2);
}

/* Мобильный чат в тёмной теме */
[data-theme="dark"] .comments-section.uc-tg {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .chat-messages.uc-tg-area {
    background-color: #0e1621 !important;
}
[data-theme="dark"] .chat-input {
    background-color: var(--surface-card) !important;
    border-top-color: var(--surface-border) !important;
}
[data-theme="dark"] .chat-input .input-group,
[data-theme="dark"] .chat-input textarea {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .chat-input textarea:focus {
    background: var(--surface-card) !important;
    border-color: var(--primary-color) !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .fullscreen-chat-header {
    background: #161d26 !important;
    border-bottom: 1px solid var(--surface-border) !important;
    color: var(--surface-text) !important;
}
[data-theme="dark"] .fullscreen-chat-title {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .fullscreen-chat-subtitle {
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .fullscreen-chat-header .back-button {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .fullscreen-chat-header .collapse-btn {
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .bitrix-emoji-panel {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
}
[data-theme="dark"] .bitrix-emoji-quick {
    background: var(--surface-sunken) !important;
    border-bottom-color: var(--surface-border) !important;
}
[data-theme="dark"] .bitrix-emoji-quick-label {
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .bitrix-emoji-categories {
    background: var(--surface-card-2) !important;
    border-bottom-color: var(--surface-border) !important;
}
[data-theme="dark"] .bitrix-emoji-category {
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .bitrix-emoji-category.active {
    background: var(--surface-card) !important;
    color: var(--primary-light) !important;
}
[data-theme="dark"] .bitrix-emoji-content {
    background: var(--surface-card) !important;
}
[data-theme="dark"] .new-comment-notification {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
}
[data-theme="dark"] .notification-sender {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .scroll-to-top-btn {
    background: var(--surface-card) !important;
    color: var(--surface-text) !important;
    border-color: var(--surface-border) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .task-subtasks .card {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
}

/* Мобильный таймлайн истории изменений */
[data-theme="dark"] .history-section {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .mobile-timeline::before {
    background: var(--surface-border) !important;
}
[data-theme="dark"] .timeline-entry {
    background: var(--surface-sunken);
    border-color: var(--surface-border);
}
[data-theme="dark"] .timeline-type { color: var(--surface-text); }
[data-theme="dark"] .timeline-meta { color: var(--surface-text-muted); }
[data-theme="dark"] .timeline-value {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .view-all-button {
    background: var(--surface-sunken);
    border-color: var(--surface-border);
    color: var(--primary-light);
}
[data-theme="dark"] .view-all-button:active {
    background: var(--surface-hover);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — СТРАНИЦА ПРОЕКТОВ (PROJECTS)
   ============================================================================ */
[data-theme="dark"] .project-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    color: var(--surface-text);
}
[data-theme="dark"] .project-card:hover {
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6) !important;
}
[data-theme="dark"] .project-cover-sm {
    background: var(--surface-sunken);
}
[data-theme="dark"] .project-card .card-title a {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .project-card .card-title a:hover {
    color: var(--primary-light) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — ПОИСК, ФИЛЬТРЫ, СРОКИ (DEADLINES)
   ============================================================================ */
[data-theme="dark"] .search-box .search-input {
    background: var(--surface-sunken) !important;
    color: var(--surface-text) !important;
    border: 1px solid var(--surface-border) !important;
}
[data-theme="dark"] .search-box .search-icon {
    color: var(--surface-text-muted);
}
/* Мобильные фильтры задач и поиск в тёмной теме */
[data-theme="dark"] .page-header {
    border-bottom-color: var(--surface-border) !important;
}
[data-theme="dark"] .page-title {
    color: var(--surface-text) !important;
}
[data-theme="dark"] .search-input.mobile-search-input {
    background: #0b0f17 !important;
    color: #f1f5f9 !important;
    border-color: #232d3d !important;
}
[data-theme="dark"] .search-input.mobile-search-input::placeholder {
    color: #64748b !important;
}
[data-theme="dark"] .search-box .search-icon {
    color: #64748b !important;
}
[data-theme="dark"] .search-box .clear-search {
    color: #94a3b8 !important;
}
[data-theme="dark"] .filter-button {
    color: var(--surface-text-muted) !important;
}
[data-theme="dark"] .filter-button:hover,
[data-theme="dark"] .filter-button.has-active-filter {
    color: #818cf8 !important;
}
[data-theme="dark"] .filter-dropdown {
    background: #141b26 !important;
    border-color: #232d3d !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .filter-dropdown .dropdown-item {
    color: #cbd5e1 !important;
    background: transparent !important;
}
[data-theme="dark"] .filter-dropdown .dropdown-item:hover,
[data-theme="dark"] .filter-dropdown .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .filter-dropdown .dropdown-item.active {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #a5b4fc !important;
    font-weight: 600 !important;
}
[data-theme="dark"] .filter-dropdown .dropdown-divider {
    border-top-color: #232d3d !important;
    opacity: 1 !important;
}
[data-theme="dark"] .filter-dropdown .form-check-label {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .filter-dropdown .form-check-input {
    background-color: #0b0f17 !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .filter-dropdown .form-check-input:checked {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
}
[data-theme="dark"] .active-filter-bar {
    background: #141b26 !important;
    border-color: #232d3d !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}
[data-theme="dark"] .active-filter-label {
    color: #94a3b8 !important;
}
[data-theme="dark"] .active-filter-badge.badge-all {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}
[data-theme="dark"] .active-filter-badge.badge-pending {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
}
[data-theme="dark"] .active-filter-badge.badge-in_progress {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
}
[data-theme="dark"] .active-filter-badge.badge-paused {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #fde68a !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .active-filter-badge.badge-review {
    background: rgba(139, 92, 246, 0.22) !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
}
[data-theme="dark"] .active-filter-badge.badge-completed {
    background: rgba(34, 197, 94, 0.22) !important;
    color: #86efac !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
}
[data-theme="dark"] .btn-reset-filter {
    color: #94a3b8 !important;
}
[data-theme="dark"] .btn-reset-filter:hover {
    color: #f87171 !important;
}
[data-theme="dark"] .empty-state {
    background: #141b26 !important;
    border: 1px solid #232d3d !important;
}
[data-theme="dark"] .empty-title {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .empty-description {
    color: #94a3b8 !important;
}
[data-theme="dark"] .empty-icon {
    color: #475569 !important;
}
[data-theme="dark"] .mobile-deadlines-container .deadline-tabs .scrollable-tabs {
    background: var(--surface-card) !important;
    border-bottom: 1px solid var(--surface-border);
}
[data-theme="dark"] .mobile-deadlines-container .deadline-tabs .nav-link {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .mobile-deadlines-container .deadline-tabs .nav-link.active {
    background: var(--surface-hover);
    color: var(--surface-text);
}
[data-theme="dark"] .deadline-column .card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
}
[data-theme="dark"] .deadline-dropzone {
    background: transparent;
}
[data-theme="dark"] .deadline-dropzone .empty-dropzone {
    color: var(--surface-text-faint);
}

/* Заголовки категорий сроков в тёмной теме */
[data-theme="dark"] .deadline-header--overdue { background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%) !important; color: #fecaca !important; border-bottom: 1px solid rgba(239, 68, 68, 0.3) !important; }
[data-theme="dark"] .deadline-header--today { background: linear-gradient(135deg, #064e3b 0%, #022c22 100%) !important; color: #a7f3d0 !important; border-bottom: 1px solid rgba(16, 185, 129, 0.3) !important; }
[data-theme="dark"] .deadline-header--tomorrow { background: linear-gradient(135deg, #0c4a6e 0%, #082f49 100%) !important; color: #bae6fd !important; border-bottom: 1px solid rgba(14, 165, 233, 0.3) !important; }
[data-theme="dark"] .deadline-header--this-week { background: linear-gradient(135deg, #164e63 0%, #083344 100%) !important; color: #a5f3fc !important; border-bottom: 1px solid rgba(6, 182, 212, 0.3) !important; }
[data-theme="dark"] .deadline-header--next-week { background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important; color: #bfdbfe !important; border-bottom: 1px solid rgba(59, 130, 246, 0.3) !important; }
[data-theme="dark"] .deadline-header--two-weeks { background: linear-gradient(135deg, #4c1d95 0%, #2e1065 100%) !important; color: #ddd6fe !important; border-bottom: 1px solid rgba(139, 92, 246, 0.3) !important; }
[data-theme="dark"] .deadline-header--next-month { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important; color: #cbd5e1 !important; border-bottom: 1px solid var(--surface-border) !important; }

[data-theme="dark"] .deadline-badge {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — мессенджер (uc-*)
   ============================================================================ */
[data-theme="dark"] {
    --uc-bg: #0b1016;
    --uc-own-bg: #2b5278;          /* тёмно-синий свой пузырь */
    --uc-own-text: #ffffff;
    --uc-other-bg: #1a212b;
    --uc-other-text: #e6edf3;
    --uc-input-bg: #1a212b;
    --uc-input-border: #2b3543;
    --uc-header-bg: #161d26;
    --uc-sidebar-bg: #131a22;
    --uc-border: #2b3543;
    --uc-muted: #8a97a5;
    --uc-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --uc-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --uc-bg-primary: #1a212b;
    --uc-bg-secondary: #161d26;
    --uc-text-secondary: #9aa7b4;
    --uc-overlay-weak: rgba(255,255,255,0.06);
    --uc-overlay-mid: rgba(255,255,255,0.12);
    --uc-reply-preview-bg: rgba(255,255,255,0.07);
    --uc-reply-preview-bg-hover: rgba(255,255,255,0.12);
}

[data-theme="dark"] .uc-message-actions,
[data-theme="dark"] .uc-quick-reaction-picker {
    border-color: var(--uc-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
[data-theme="dark"] .uc-reply-input-bar {
    border-top-color: var(--uc-border);
}
[data-theme="dark"] .uc-mark-read-btn {
    background: var(--surface-card-2);
    border-color: var(--uc-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .uc-search-input-header,
[data-theme="dark"] .uc-search-count {
    background: var(--surface-sunken);
    border-color: var(--uc-border);
    color: var(--surface-text);
}
[data-theme="dark"] .uc-search-nav-btn {
    background: var(--surface-card-2);
    border-color: var(--uc-border);
}
[data-theme="dark"] .uc-search-highlight {
    background: #b59a3a;
    color: #fff;
}
[data-theme="dark"] .uc-read-icon--unread { border-color: var(--surface-border-strong); }
[data-theme="dark"] .uc-date-separator__text { background: rgba(255,255,255,0.14); }

[data-theme="dark"] .uc-contacts-header h5,
[data-theme="dark"] .uc-contact-name,
[data-theme="dark"] .uc-chat-header-name { color: var(--surface-text); }
[data-theme="dark"] .uc-contact-preview { color: var(--surface-text-muted); }
[data-theme="dark"] .uc-search-input,
[data-theme="dark"] .uc-input-field {
    background: var(--surface-sunken);
    color: var(--surface-text);
    border-color: var(--uc-border);
}
[data-theme="dark"] .uc-search-input:focus,
[data-theme="dark"] .uc-input-field:focus {
    background: var(--surface-card);
}
[data-theme="dark"] .uc-contact-item:hover { background: var(--surface-hover); }
[data-theme="dark"] .uc-header-btn {
    background: var(--surface-card-2);
    color: var(--surface-text-muted);
    border-color: var(--uc-border);
}
[data-theme="dark"] .uc-dropdown-menu {
    background: var(--surface-card);
    border-color: var(--uc-border);
}
[data-theme="dark"] .uc-dropdown-item { color: var(--surface-text); }
[data-theme="dark"] .uc-dropdown-item:hover { background: var(--surface-hover); }

/* Telegram-тема мессенджера в тёмном режиме (scope .uc-messenger) */
[data-theme="dark"] .uc-messenger {
    --tg-bg: #0e1621;
    --tg-own-bubble: #2b5278;
    --tg-own-text: #ffffff;
    --tg-own-meta: #a7c5e3;
    --tg-other-bubble: #1a212b;
    --tg-other-text: #e6edf3;
    --tg-meta: #7d8a97;
    --tg-tick: #6ee7b7;
    --tg-accent: #5ea3e8;
    --tg-sidebar-bg: #131a22;
    --tg-active: #22303f;
    --tg-name-color: #7cb3f0;
}
[data-theme="dark"] .uc-messenger .uc-messages-area {
    background-color: #0e1621 !important;
    background-image: url('/static/images/tg_doodle_pattern_dark.svg') !important;
    background-repeat: repeat !important;
    background-size: 360px 360px !important;
    background-attachment: scroll !important;
    opacity: 1;
}
[data-theme="dark"] .uc-messenger .uc-message--own .uc-bubble-text,
[data-theme="dark"] .uc-messenger .uc-message--other .uc-bubble-text {
    color: var(--surface-text);
}
[data-theme="dark"] .uc-messenger .uc-message--own .uc-bubble-text { color: #fff; }
[data-theme="dark"] .uc-messenger .uc-message--own.uc-message--tail .uc-bubble::after {
    box-shadow: -6px 0 0 0 var(--tg-own-bubble);
}
[data-theme="dark"] .uc-messenger .uc-message--other.uc-message--tail .uc-bubble::after {
    box-shadow: 6px 0 0 0 var(--tg-other-bubble);
}
[data-theme="dark"] .uc-messenger .uc-contact-item.active .uc-contact-name,
[data-theme="dark"] .uc-messenger .uc-contact-item--active .uc-contact-name {
    color: var(--surface-text);
}
[data-theme="dark"] .uc-messenger .uc-contact-item.active .uc-contact-preview,
[data-theme="dark"] .uc-messenger .uc-contact-item--active .uc-contact-preview,
[data-theme="dark"] .uc-messenger .uc-contact-item.active .uc-contact-time,
[data-theme="dark"] .uc-messenger .uc-contact-item--active .uc-contact-time {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .uc-messenger .uc-message--own .uc-time,
[data-theme="dark"] .uc-messenger .uc-message--own .uc-delivery-icon { color: var(--tg-own-meta); }

/* ============================================================================
   ТЁМНАЯ ТЕМА — центр уведомлений
/* ============================================================================
   ТЁМНАЯ ТЕМА — верхняя панель (desktop-topbar) и центр уведомлений
   ============================================================================ */
[data-theme="dark"] .desktop-topbar {
    background: var(--surface-card);
    border-color: var(--surface-border);
}
[data-theme="dark"] .topbar-search-trigger {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .topbar-search-trigger:hover {
    background: var(--surface-hover);
    color: var(--surface-text);
}
[data-theme="dark"] .topbar-search-kbd {
    background: var(--surface-card);
    color: var(--surface-text-muted);
    border-color: var(--surface-border);
}
[data-theme="dark"] .topbar-connection-indicator.topbar-icon-btn {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .topbar-connection-indicator.topbar-icon-btn:hover {
    background: var(--surface-hover);
}
[data-theme="dark"] .topbar-connection-indicator .conn-bar {
    background: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .topbar-icon-btn {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .topbar-icon-btn:hover {
    background: var(--surface-hover);
    color: var(--primary-light, #818cf8);
    border-color: var(--primary-light, #818cf8);
}
[data-theme="dark"] .topbar-badge {
    border-color: var(--surface-card);
}
[data-theme="dark"] .topbar-divider {
    background: var(--surface-border);
}
[data-theme="dark"] .topbar-user-chip {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
}
[data-theme="dark"] .topbar-user-chip:hover {
    background: var(--surface-hover);
}
[data-theme="dark"] .topbar-user-name {
    color: var(--surface-text);
}

[data-theme="dark"] .notification-center-panel {
    background: var(--surface-card);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .notification-center-header {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
}
[data-theme="dark"] .notif-title { color: var(--surface-text); }
[data-theme="dark"] .notif-subtitle { color: var(--surface-text-muted); }
[data-theme="dark"] .notification-back-btn {
    background: var(--surface-card);
    color: var(--surface-text);
}
[data-theme="dark"] .notification-back-btn:hover {
    background: var(--surface-hover);
}
[data-theme="dark"] .notif-category-tabs {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
}
[data-theme="dark"] .notif-tab {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .notif-tab:hover {
    background: var(--surface-hover);
    color: var(--surface-text);
}
[data-theme="dark"] .notif-tab.active {
    background: var(--primary-color, #6366f1);
    border-color: var(--primary-color, #6366f1);
    color: #ffffff;
}
[data-theme="dark"] .notif-filter-subbar {
    background: var(--surface-card);
    border-color: var(--surface-border);
}
[data-theme="dark"] .notif-slider {
    background: var(--surface-border);
}
[data-theme="dark"] .notif-switch-label {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .notification-center-body {
    background: var(--surface-bg);
}
[data-theme="dark"] .notif-card {
    background: var(--surface-card);
    border-color: var(--surface-border);
}
[data-theme="dark"] .notif-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: var(--surface-hover);
}
[data-theme="dark"] .notif-card.unread {
    background: rgba(99, 102, 241, 0.09);
    border-color: rgba(99, 102, 241, 0.3);
}
[data-theme="dark"] .notif-card-title {
    color: var(--surface-text);
}
[data-theme="dark"] .notif-card-body {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .notif-empty-icon {
    background: var(--surface-card-2);
    color: var(--surface-text-muted);
}
[data-theme="dark"] .notif-empty-title {
    color: var(--surface-text);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — правая панель Bitrix
   ============================================================================ */
[data-theme="dark"] .bitrix-sidebar {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
}
[data-theme="dark"] .bitrix-avatar { background: var(--surface-card); border-color: var(--surface-border); }
[data-theme="dark"] .bitrix-mini-chat {
    background: var(--surface-card);
    border-color: var(--surface-border);
}
[data-theme="dark"] .bitrix-chat-header {
    background: var(--surface-card-2);
    border-color: var(--surface-border);
}
[data-theme="dark"] .bitrix-chat-name { color: var(--surface-text); }
[data-theme="dark"] .bitrix-chat-messages { background: var(--uc-bg); }
[data-theme="dark"] .bitrix-bottom-actions { border-color: var(--surface-border); }

/* ============================================================================
   ТЁМНАЯ ТЕМА — кастомные виджеты и детали
   ============================================================================ */
[data-theme="dark"] .info-item { background: var(--surface-sunken); color: var(--surface-text); }
[data-theme="dark"] .settings-section { background: var(--surface-sunken) !important; }
[data-theme="dark"] .status-row { border-bottom-color: var(--surface-border) !important; }
[data-theme="dark"] .status-label { color: var(--surface-text-muted) !important; }
[data-theme="dark"] .switch-label { color: var(--surface-text) !important; }
[data-theme="dark"] .switch-helper { color: var(--surface-text-muted) !important; }
[data-theme="dark"] .debug-log { background: var(--surface-sunken) !important; border-color: var(--surface-border) !important; color: var(--surface-text) !important; }

[data-theme="dark"] .notification-widget-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .widget-card,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .kanban-column,
[data-theme="dark"] .drag-preview {
    background: var(--surface-card) !important;
    color: var(--surface-text);
    border-color: var(--surface-border) !important;
}
[data-theme="dark"] .notification-widget-title { color: var(--surface-text); }
[data-theme="dark"] .notification-widget-text { color: var(--surface-text-muted); }
[data-theme="dark"] .notification-widget-close { color: var(--surface-text-muted); }

/* ============================================================================
   ТЁМНАЯ ТЕМА — ПЛАНЫ НА ДЕНЬ (DAILY PLANS)
   ============================================================================ */
[data-theme="dark"] .daily-plans-page .today-card,
[data-theme="dark"] .daily-plans-page .sidebar-card,
[data-theme="dark"] .report-page .report-card,
[data-theme="dark"] .report-page .format-card,
[data-theme="dark"] .report-page .sidebar-card,
[data-theme="dark"] .team-page .user-card,
[data-theme="dark"] .view-plan-page .section-card {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .daily-plans-page .today-card .card-header,
[data-theme="dark"] .daily-plans-page .sidebar-card .card-header,
[data-theme="dark"] .report-page .report-card .card-header,
[data-theme="dark"] .report-page .format-card .card-header,
[data-theme="dark"] .report-page .sidebar-card .card-header,
[data-theme="dark"] .team-page .user-card .card-header,
[data-theme="dark"] .view-plan-page .section-card .card-header {
    background: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .daily-plans-page .task-item,
[data-theme="dark"] .daily-plans-page .history-item,
[data-theme="dark"] .report-page .history-item,
[data-theme="dark"] .view-plan-page .task-item {
    background: var(--surface-card);
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .daily-plans-page .task-item:hover,
[data-theme="dark"] .daily-plans-page .history-item:hover,
[data-theme="dark"] .report-page .history-item:hover,
[data-theme="dark"] .view-plan-page .task-item:hover {
    background: var(--surface-hover) !important;
}

[data-theme="dark"] .daily-plans-page .action-buttons {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .daily-plans-page .quick-btn,
[data-theme="dark"] .report-page .export-btn,
[data-theme="dark"] .template-btn {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .daily-plans-page .quick-btn:hover,
[data-theme="dark"] .report-page .export-btn:hover,
[data-theme="dark"] .template-btn:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-light) !important;
}

[data-theme="dark"] .report-page .report-content pre,
[data-theme="dark"] .report-page .format-block,
[data-theme="dark"] .team-page .date-label,
[data-theme="dark"] .team-page .date-nav {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .daily-plans-page .empty-state i,
[data-theme="dark"] .view-plan-page .empty-state i {
    color: var(--surface-text-faint) !important;
}

/* Статусы планов на день в тёмной теме */
[data-theme="dark"] .team-page .status-draft { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
[data-theme="dark"] .team-page .status-finalized { background: rgba(34, 197, 94, 0.2); color: #86efac; }
[data-theme="dark"] .team-page .status-reported { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }

/* ============================================================================
   ТЁМНАЯ ТЕМА — ПРОФИЛЬ (PROFILE)
   ============================================================================ */
[data-theme="dark"] .timeline-content {
    background: var(--surface-sunken);
    color: var(--surface-text);
    border-left-color: var(--surface-border-strong) !important;
}
[data-theme="dark"] .timeline-marker {
    background: var(--surface-card);
    border-color: var(--surface-border-strong);
}
[data-theme="dark"] .timeline-item::after,
[data-theme="dark"] .timeline::before,
[data-theme="dark"] .mini-timeline::before { background: var(--surface-border); }

/* ============================================================================
   ТЁМНАЯ ТЕМА — ДЕТАЛИ ЗАДАЧИ И ИСТОРИЯ (TASKS DETAIL & HISTORY)
   ============================================================================ */
[data-theme="dark"] .image-preview-container {
    background: var(--surface-sunken);
    border-color: var(--surface-border);
}
[data-theme="dark"] .task-image-wrapper { background: var(--surface-sunken); }
[data-theme="dark"] .reply-preview {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .timeline-card-header {
    border-bottom-color: var(--surface-border);
}
[data-theme="dark"] .change-content {
    background-color: var(--surface-sunken);
    color: var(--surface-text);
}
[data-theme="dark"] .change-label {
    color: var(--surface-text-muted);
}
[data-theme="dark"] .change-arrow {
    color: var(--surface-text-faint);
}

/* ============================================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ (Современная кнопка десктопа и мобильных)
   ============================================================================ */
.theme-toggle-btn {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* Десктопная кнопка в шапке (светлая тема по умолчанию) */
.topbar-icon-btn.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--surface-border, #e2e8f0);
    background: var(--surface-card, #ffffff);
    color: #6366f1; /* Стильный индиго для луны */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.topbar-icon-btn.theme-toggle-btn:hover {
    background: #f8fafc;
    border-color: #818cf8;
    color: #4f46e5;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.topbar-icon-btn.theme-toggle-btn:active {
    transform: translateY(0) scale(0.95);
}

.topbar-icon-btn.theme-toggle-btn i {
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}

/* Десктопная кнопка в шапке (тёмная тема) */
[data-theme="dark"] .topbar-icon-btn.theme-toggle-btn {
    background: var(--surface-card, #182030);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24; /* Тёплый солнечный янтарный */
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

[data-theme="dark"] .topbar-icon-btn.theme-toggle-btn:hover {
    background: rgba(251, 191, 36, 0.12);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
    transform: translateY(-1px);
}

[data-theme="dark"] .topbar-icon-btn.theme-toggle-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Динамическая анимация вращения и упругого масштабирования при клике */
.theme-icon-spin {
    animation: themeIconSpin 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes themeIconSpin {
    0% {
        transform: rotate(-140deg) scale(0.6);
        opacity: 0.3;
    }
    60% {
        transform: rotate(15deg) scale(1.15);
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* В мобильной шапке кнопка */
.mobile-header-icon.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mobile-header-icon.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}
.mobile-header-icon.theme-toggle-btn i {
    font-size: 16px;
}

/* Сегментированный выбор темы в настройках */
.theme-segmented {
    display: inline-flex;
    background: var(--surface-sunken);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.theme-segmented button {
    border: none;
    background: none;
    color: var(--surface-text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.theme-segmented button:hover { color: var(--surface-text); }
.theme-segmented button.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — СОЗДАНИЕ И РЕДАКТИРОВАНИЕ ЗАДАЧ (CREATE / EDIT TASK)
   ============================================================================ */
[data-theme="dark"] .form-section {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .form-section-header {
    background: var(--surface-sunken) !important;
    border-bottom-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .form-section-header > i:first-child {
    color: #818cf8 !important;
}

[data-theme="dark"] .form-section-chevron {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .form-label-styled,
[data-theme="dark"] .form-label {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .form-hint {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .btn-icon-back {
    background: var(--surface-sunken) !important;
    color: var(--surface-text-muted) !important;
    border: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .btn-icon-back:hover {
    background: var(--surface-hover) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .assignee-tag-input,
[data-theme="dark"] .collab-tag-input {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .assignee-tag-input:focus-within,
[data-theme="dark"] .collab-tag-input:focus-within {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .collab-tag {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .collab-tag-remove {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .collab-tag-remove:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .collab-search-input {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .collab-search-input::placeholder {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .collab-dropdown {
    background: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .collab-dropdown-item:hover {
    background: var(--surface-hover) !important;
}

[data-theme="dark"] .collab-dropdown-name {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .collab-dropdown-pos {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .collab-dropdown-empty {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .file-upload-zone,
[data-theme="dark"] .file-upload-zone-sm {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .file-upload-zone:hover,
[data-theme="dark"] .file-upload-zone-sm:hover {
    border-color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.08) !important;
}

[data-theme="dark"] .file-upload-text,
[data-theme="dark"] .file-upload-label {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .file-upload-hint {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .file-upload-icon {
    color: #818cf8 !important;
}

[data-theme="dark"] .ai-card {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .ai-card-title {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .btn-ai-suggest {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(129, 140, 248, 0.4) !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .btn-ai-suggest:hover {
    background: rgba(99, 102, 241, 0.22) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-cancel {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .btn-cancel:hover {
    background: var(--surface-hover) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .deadline-info-mobile {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .quick-deadline-buttons .btn-outline-primary {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .quick-deadline-buttons .btn-outline-secondary {
    background: rgba(148, 163, 184, 0.12) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .suggestions-container {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .suggestions-container .btn-outline-primary {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .image-preview-container {
    background: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .preview-item {
    border-color: var(--surface-border) !important;
}

/* ============================================================================
   TELEGRAM MESSENGER & TASK CHAT — ПОЛНАЯ ТЁМНАЯ ТЕМА (DARK MODE)
   Стиль: аутентичный Telegram Dark / Telegram Desktop / Telegram Web
   ============================================================================ */

[data-theme="dark"] {
    --uc-bg: #0e1621;
    --uc-sidebar-bg: #17212b;
    --uc-header-bg: #17212b;
    --uc-own-bg: #2b5278;
    --uc-own-text: #ffffff;
    --uc-other-bg: #182533;
    --uc-other-text: #f5f5f5;
    --uc-input-bg: #17212b;
    --uc-input-border: #242f3d;
    --uc-border: #242f3d;
    --uc-muted: #798b9b;
    --uc-bg-primary: #17212b;
    --uc-bg-secondary: #131e29;
    --uc-text-secondary: #798b9b;
    --uc-overlay-weak: rgba(255, 255, 255, 0.06);
    --uc-overlay-mid: rgba(255, 255, 255, 0.12);
    --uc-reply-preview-bg: rgba(255, 255, 255, 0.08);
    --uc-reply-preview-bg-hover: rgba(255, 255, 255, 0.14);
}

/* Полноэкранный мессенджер */
[data-theme="dark"] .uc-messenger {
    background-color: #0e1621 !important;
    background-image: url('/static/images/tg_doodle_pattern_dark.svg') !important;
    background-repeat: repeat !important;
    background-size: 360px 360px !important;
    background-attachment: scroll !important;
    border-color: #242f3d !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .uc-contacts-panel {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .uc-contacts-header {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .uc-contacts-header h5 {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .uc-search-input {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-search-input:focus {
    border-color: #5288c1 !important;
    background: #2b394a !important;
}

[data-theme="dark"] .uc-contact-item {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .uc-contact-item:hover {
    background: #202b36 !important;
}

[data-theme="dark"] .uc-contact-item.active,
[data-theme="dark"] .uc-contact-item--active {
    background: #2b5278 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-contact-name {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .uc-contact-preview {
    color: #798b9b !important;
}

[data-theme="dark"] .uc-contact-time {
    color: #798b9b !important;
}

/* Панель и шапка чата */
[data-theme="dark"] .uc-chat-panel,
[data-theme="dark"] .uc-tg .uc-chat-panel,
[data-theme="dark"] .uc-empty-chat {
    background-color: #0e1621 !important;
    background-image: url('/static/images/tg_doodle_pattern_dark.svg') !important;
    background-repeat: repeat !important;
    background-size: 360px 360px !important;
    background-attachment: scroll !important;
}

[data-theme="dark"] .uc-chat-header {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .uc-chat-header-name {
    color: #ffffff !important;
}

[data-theme="dark"] .uc-chat-header-status {
    color: #798b9b !important;
}

[data-theme="dark"] .uc-header-btn {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .uc-header-btn:hover {
    background: #2b394a !important;
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-search-input-header {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

/* Область сообщений и пузыри */
[data-theme="dark"] .uc-messages-area,
[data-theme="dark"] #chatMessages,
[data-theme="dark"] .bitrix-chat-messages,
[data-theme="dark"] .task-chat-messages-container,
[data-theme="dark"] .uc-tg-area {
    background-color: #0e1621 !important;
    background-image: url('/static/images/tg_doodle_pattern_dark.svg') !important;
    background-repeat: repeat !important;
    background-size: 360px 360px !important;
    background-attachment: scroll !important;
}

[data-theme="dark"] .uc-message--other .uc-bubble {
    background: #182533 !important;
    color: #f5f5f5 !important;
    border: 1px solid #1f2f40 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .uc-message--own .uc-bubble {
    background: #2b5278 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .uc-sender-name {
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-message--own .uc-sender-name {
    color: #90caf9 !important;
}

[data-theme="dark"] .uc-bubble-text {
    color: inherit !important;
}

[data-theme="dark"] .uc-time {
    color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .uc-delivery-icon--read {
    color: #4fae4e !important;
}

/* Панель ввода сообщения */
[data-theme="dark"] .uc-input-container {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .uc-message-input {
    background: #17212b !important;
    border-color: #242f3d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-message-input:focus {
    border-color: #5288c1 !important;
}

[data-theme="dark"] .uc-icon-btn {
    color: #798b9b !important;
}

[data-theme="dark"] .uc-icon-btn:hover {
    color: #64b5f6 !important;
    background: rgba(100, 181, 246, 0.1) !important;
}

[data-theme="dark"] .uc-send-btn {
    background: #5288c1 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-send-btn:hover {
    background: #649ad3 !important;
}

/* Меню, поповеры, контекстное меню */
[data-theme="dark"] .uc-dropdown-menu,
[data-theme="dark"] .uc-context-menu {
    background: #17212b !important;
    border: 1px solid #2b394a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .uc-dropdown-item,
[data-theme="dark"] .uc-context-item {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .uc-dropdown-item:hover,
[data-theme="dark"] .uc-context-item:hover {
    background: #242f3d !important;
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-dropdown-item.danger,
[data-theme="dark"] .uc-context-item.danger {
    color: #ef5350 !important;
}

[data-theme="dark"] .uc-dropdown-item.danger:hover,
[data-theme="dark"] .uc-context-item.danger:hover {
    background: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350 !important;
}

/* Закреплённые сообщения и Ответы */
[data-theme="dark"] .uc-pinned-bar {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .uc-pinned-bar-title {
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-pinned-bar-text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .uc-reply-bar {
    background: #131e29 !important;
    border-left-color: #5288c1 !important;
}

[data-theme="dark"] .uc-reply-bar-title {
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-reply-bar-text {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .uc-reply-preview {
    background: rgba(255, 255, 255, 0.08) !important;
    border-left-color: #64b5f6 !important;
}

[data-theme="dark"] .uc-reply-preview-name {
    color: #64b5f6 !important;
}

[data-theme="dark"] .uc-reply-preview-text {
    color: #cbd5e1 !important;
}

/* Реакции */
[data-theme="dark"] .uc-reaction-badge {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .uc-reaction-badge:hover {
    background: #2b394a !important;
}

[data-theme="dark"] .uc-reaction-badge--active {
    background: #2b5278 !important;
    border-color: #5288c1 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-reaction-picker {
    background: #17212b !important;
    border: 1px solid #2b394a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

/* Модальные окна (Пересылка) */
[data-theme="dark"] .uc-modal {
    background: #17212b !important;
    border: 1px solid #2b394a !important;
    color: #f5f5f5 !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .uc-modal-title {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .uc-modal-search {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-forward-item {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .uc-forward-item:hover {
    background: #202b36 !important;
}

/* Bitrix боковая панель и Мини-чат */
[data-theme="dark"] .bitrix-sidebar {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .bitrix-users-list {
    background: #17212b !important;
}

[data-theme="dark"] .bitrix-user-item:hover {
    background: #202b36 !important;
}

[data-theme="dark"] .bitrix-user-name {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .bitrix-user-status {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-mini-chat {
    background: #17212b !important;
    border: 1px solid #242f3d !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .bitrix-chat-header {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .bitrix-chat-name {
    color: #ffffff !important;
}

[data-theme="dark"] .bitrix-chat-status {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-chat-messages {
    background-color: #0e1621 !important;
}

[data-theme="dark"] .bitrix-chat-input-container {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] .bitrix-chat-input {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bitrix-dropdown-menu {
    background: #17212b !important;
    border: 1px solid #2b394a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .bitrix-dropdown-item {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bitrix-dropdown-item:hover {
    background: #242f3d !important;
    color: #64b5f6 !important;
}

/* Обсуждения задач (десктопная карточка и мобильный чат) */
[data-theme="dark"] .comments-section,
[data-theme="dark"] #commentsSection,
[data-theme="dark"] .task-discussion-wrapper {
    background: #141b26 !important;
    border-color: #232d3d !important;
}

[data-theme="dark"] .chat-messages-container,
[data-theme="dark"] #chatMessages {
    background-color: #0e1621 !important;
    background-image: url('/static/images/tg_doodle_pattern_dark.svg') !important;
    background-repeat: repeat !important;
    background-size: 360px 360px !important;
    background-attachment: scroll !important;
}

[data-theme="dark"] #messageForm,
[data-theme="dark"] .task-chat-form {
    background: #17212b !important;
    border-color: #242f3d !important;
}

[data-theme="dark"] #message-input,
[data-theme="dark"] .task-chat-input {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

/* Карточка чата обсуждения задачи (Telegram Desktop Card) в темной теме */
[data-theme="dark"] .uc-tg-card,
[data-theme="dark"] .card.uc-tg-card {
    background: #17212b !important;
    border-color: #242f3d !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .uc-tg-card .card-header {
    background: #17212b !important;
    border-bottom: 1px solid #242f3d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .uc-tg-card .uc-input-area {
    background: #17212b !important;
    border-top: 1px solid #242f3d !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — ПАНЕЛЬ ПОИСКА СОТРУДНИКОВ (bitrix-user-search-panel)
   ============================================================================ */
[data-theme="dark"] .bitrix-user-search-panel {
    background: #17212b !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .bitrix-user-search-header {
    background: #1e2a36 !important;
    border-bottom-color: #242f3d !important;
}

[data-theme="dark"] .bitrix-user-search-input {
    background: #242f3d !important;
    border-color: #2e3c4d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bitrix-user-search-input:focus {
    border-color: #5288c1 !important;
    box-shadow: 0 0 0 3px rgba(82, 136, 193, 0.25) !important;
}

[data-theme="dark"] .bitrix-user-search-input::placeholder {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-user-search-close {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-user-search-close:hover {
    background: #242f3d !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bitrix-user-search-results {
    background: #17212b !important;
}

[data-theme="dark"] .bitrix-user-search-results::-webkit-scrollbar-thumb {
    background: #2e3c4d !important;
}

[data-theme="dark"] .bitrix-search-result-item:hover {
    background: #202b36 !important;
}

[data-theme="dark"] .bitrix-search-result-item:active {
    background: #2b394a !important;
}

[data-theme="dark"] .bitrix-search-result-avatar {
    border-radius: 0 !important;
    overflow: visible !important;
}

[data-theme="dark"] .bitrix-search-result-avatar img {
    border-color: #2e3c4d !important;
}

[data-theme="dark"] .bitrix-search-result-placeholder {
    border-color: #2e3c4d !important;
}

[data-theme="dark"] .bitrix-search-result-status {
    border-color: #17212b !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .bitrix-search-result-item:hover .bitrix-search-result-status {
    border-color: #202b36 !important;
}

[data-theme="dark"] .bitrix-search-result-name {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .bitrix-search-result-name mark {
    background: rgba(82, 136, 193, 0.35) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bitrix-search-result-detail {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-search-result-desc {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-search-result-sep {
    color: #4a5c6e !important;
}

[data-theme="dark"] .bitrix-search-result-status-text {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-search-result-online {
    color: #4ade80 !important;
}

[data-theme="dark"] .bitrix-device-icon {
    background: #242f3d !important;
    border-color: #17212b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .bitrix-search-no-results {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-search-section-title {
    color: #5c6f80 !important;
}

/* Индикатор статуса в боковой панели — border цвет для тёмной темы */
[data-theme="dark"] .bitrix-status-indicator {
    border-color: #17212b !important;
}

/* Метка последнего визита в тёмной теме */
[data-theme="dark"] .bitrix-last-seen {
    background: rgba(23, 33, 43, 0.9) !important;
    color: #798b9b !important;
}

/* Аватар border в тёмной теме */
[data-theme="dark"] .bitrix-user-avatar {
    border-color: #2e3c4d !important;
}

[data-theme="dark"] .bitrix-user-placeholder {
    border-color: #2e3c4d !important;
}

/* Превью изображений в sidebar — тёмная тема */
[data-theme="dark"] .bitrix-image-preview-container {
    background-color: #1e2a36 !important;
    border-top-color: #242f3d !important;
}

[data-theme="dark"] .bitrix-image-preview-header {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-clear-images {
    color: #798b9b !important;
}

[data-theme="dark"] .bitrix-clear-images:hover {
    background-color: #242f3d !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bitrix-image-preview-item {
    border-color: #2e3c4d !important;
}

/* Мобильная тёмная тема — поиск сотрудников */
@media (max-width: 768px) {
    [data-theme="dark"] .bitrix-user-search-panel {
        background: #17212b !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6) !important;
    }

    [data-theme="dark"] .bitrix-user-search-header {
        background: #1e2a36 !important;
    }

    [data-theme="dark"] .bitrix-user-search-input {
        background: #242f3d !important;
        border-color: #2e3c4d !important;
        color: #ffffff !important;
    }
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — Глобальные переопределения утилит Bootstrap
   ============================================================================ */
[data-theme="dark"] .text-dark {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--surface-card) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--surface-sunken) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .card-header.bg-white {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .btn-white {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .btn-white:hover {
    background-color: var(--surface-hover) !important;
    border-color: var(--surface-border-strong) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-light {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .btn-light:hover {
    background-color: var(--surface-hover) !important;
    border-color: var(--surface-border-strong) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: var(--surface-sunken) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .badge.bg-white {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--surface-border) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — Корпоративная лента компании (/feed)
   ============================================================================ */
[data-theme="dark"] .composer-card {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .composer-title-input {
    background: transparent !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .composer-title-input::placeholder {
    color: var(--surface-text-faint) !important;
}

[data-theme="dark"] .composer-textarea {
    background: transparent !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .composer-textarea::placeholder {
    color: var(--surface-text-faint) !important;
}

[data-theme="dark"] .post-content {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .post-pinned {
    box-shadow: 0 4px 16px rgba(234, 179, 8, 0.15) !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
}

[data-theme="dark"] .post-birthday-card {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, var(--surface-card) 55%) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .post-achievement-card {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, var(--surface-card) 55%) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] .reaction-btn {
    border-color: var(--surface-border) !important;
    background: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .reaction-btn:hover {
    background: var(--surface-hover) !important;
    border-color: var(--surface-border-strong) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .reaction-btn.active-reaction {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: #818cf8 !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .comment-bubble > div {
    background: var(--surface-sunken) !important;
    border: 1px solid var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .comment-bubble a {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .telegram-comment-input {
    background-color: var(--surface-sunken, #141b26) !important;
    border-color: var(--surface-border, #232d3d) !important;
    color: var(--surface-text, #f1f5f9) !important;
}

[data-theme="dark"] .telegram-comment-input:focus {
    background-color: var(--surface-card, #1b2432) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .telegram-send-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.45) !important;
}

[data-theme="dark"] .reaction-pill-badge.user-reacted {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .feed-filters-bar .btn-white {
    background-color: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .feed-filters-bar .btn-white:hover {
    background-color: var(--surface-hover) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .event-date-box {
    background-color: var(--surface-sunken) !important;
    border: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .event-date-box .fw-bold {
    color: var(--surface-text) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — Интерактивный календарь (/calendar)
   ============================================================================ */
[data-theme="dark"] .calendar-page-container .card {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th {
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .fc .fc-col-header-cell {
    background-color: var(--surface-card-2) !important;
}

[data-theme="dark"] .fc .fc-col-header-cell-cushion {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .fc .fc-toolbar-title {
    color: var(--surface-text) !important;
}

[data-theme="dark"] .fc .fc-button-primary {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .fc .fc-button-primary:hover {
    background-color: var(--surface-hover) !important;
    border-color: var(--surface-border-strong) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .fc .fc-day-today {
    background-color: rgba(99, 102, 241, 0.14) !important;
}

[data-theme="dark"] .fc .fc-day-today .fc-daygrid-day-number {
    color: var(--primary-light) !important;
}

[data-theme="dark"] .fc .fc-daygrid-day-number {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .fc-list-day-cushion {
    background-color: var(--surface-card-2) !important;
    color: var(--surface-text) !important;
}

[data-theme="dark"] .fc-list-event:hover td {
    background-color: var(--surface-hover) !important;
}

[data-theme="dark"] .fc-list-event-title a {
    color: var(--surface-text) !important;
}

/* ============================================================================
   ТЁМНАЯ ТЕМА — Профиль сотрудника
   ============================================================================ */
[data-theme="dark"] .profile-header-card {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .profile-avatar {
    border-color: var(--surface-card) !important;
}

[data-theme="dark"] .default-avatar-hero {
    border-color: var(--surface-card) !important;
}

[data-theme="dark"] .profile-stat-box {
    background-color: var(--surface-card-2) !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: 12px;
    padding: 8px 16px;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--surface-text-muted) !important;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--surface-text) !important;
    border-color: transparent !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--surface-card) !important;
    color: var(--primary-light) !important;
    border-color: var(--surface-border) var(--surface-border) var(--surface-card) !important;
}

[data-theme="dark"] .achievement-badge-card {
    background-color: var(--surface-card-2) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .achievement-badge-card.is-locked {
    background-color: var(--surface-sunken) !important;
    opacity: 0.55;
}

[data-theme="dark"] .profile-container .bg-light {
    background-color: var(--surface-sunken) !important;
}

[data-theme="dark"] .profile-container .card {
    background-color: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
}

/* ============================================================================
   SOCIAL NETWORK COMPONENTS (DARK THEME)
   ============================================================================ */
[data-theme="dark"] .reaction-dock-popover {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .reaction-emoji-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .reaction-pill-badge {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .reaction-pill-badge.user-reacted {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: #6366f1 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .kudos-choice-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .kudos-choice-card:hover {
    border-color: #f59e0b !important;
    background-color: rgba(245, 158, 11, 0.1) !important;
}

[data-theme="dark"] .kudos-choice-card.active {
    border-color: #f59e0b !important;
    background-color: rgba(245, 158, 11, 0.2) !important;
}

[data-theme="dark"] .focus-task-card {
    background-color: var(--surface-card) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .focus-task-card:hover {
    background-color: var(--surface-hover) !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .skill-badge-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .skill-count-badge {
    background-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .user-work-status-badge {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .status-preset-btn {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .status-preset-btn:hover,
[data-theme="dark"] .status-preset-btn.active {
    background-color: #273549 !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .status-preset-btn .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .floating-social-toast {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}

/* ============================================================================
   Modern Kanban Task Board Control Hub & Sticky Toolbar
   ============================================================================ */
.task-board-control-hub {
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 14px;
    padding: 8px 14px;
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.task-board-control-hub.no-transition,
.task-board-control-hub.no-transition * {
    transition: none !important;
}

.sticky-task-toolbar {
    position: sticky;
    top: 50px;
    z-index: 95;
}

.task-hub-row-primary {
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    align-items: center;
    flex-wrap: nowrap !important;
}

@media (max-width: 767.98px) {
    .task-hub-row-primary {
        height: auto;
        min-height: 38px;
        max-height: none;
        flex-wrap: wrap !important;
    }
}

.task-hub-actions {
    flex-shrink: 0;
    flex-wrap: nowrap !important;
}

.task-hub-search-box {
    min-width: 70px;
    max-width: 340px;
    flex: 1 1 auto;
}

/* Действия, видимые только в Моем плане (Роботы, Добавить колонку) */
#taskBoardControlHub:not([data-active-view="my_plan"]) .my-plan-only-actions {
    display: none !important;
}

#taskBoardContainer {
    min-height: calc(100vh - 165px);
}

.task-hub-row-filters {
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
    overflow: hidden;
    max-height: 120px;
}

.task-board-control-hub.is-collapsed .task-hub-row-filters {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    pointer-events: none;
}

.task-board-control-hub.is-collapsed #filterChevronIcon {
    transform: rotate(180deg);
}

.transition-icon {
    transition: transform 0.2s ease;
}

.toolbar-vertical-divider {
    width: 1px;
    height: 20px;
    background: var(--surface-border, #e2e8f0);
    margin: 0 4px;
}

.task-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.task-search-icon {
    position: absolute;
    left: 12px;
    color: var(--surface-text-muted, #94a3b8);
    font-size: 0.8rem;
    pointer-events: none;
}

.task-search-input {
    width: 100%;
    padding: 5px 56px 5px 32px;
    font-size: 0.82rem;
    border-radius: 9999px;
    border: 1px solid var(--surface-border, #cbd5e1);
    background: var(--surface-sunken, #f8fafc);
    color: var(--surface-text, #0f172a);
    transition: all 0.2s ease;
    height: 32px;
}

.task-search-input:focus {
    outline: none;
    border-color: #6366f1;
    background: var(--surface-card, #ffffff);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.task-search-kbd {
    position: absolute;
    right: 28px;
    padding: 1px 5px;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--surface-text-muted, #94a3b8);
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 5px;
    pointer-events: none;
}

.task-search-clear-btn {
    position: absolute;
    right: 6px;
    border: none;
    background: transparent;
    color: var(--surface-text-muted, #94a3b8);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s;
}

.task-search-clear-btn:hover {
    color: #ef4444;
}

/* Компактные инлайн селекторы */
.task-compact-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.select-inline-icon {
    position: absolute;
    left: 9px;
    font-size: 0.72rem;
    color: var(--surface-text-muted, #94a3b8);
    pointer-events: none;
    z-index: 1;
}

.task-compact-select {
    padding: 3px 8px 3px 26px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--surface-border, #cbd5e1);
    background: var(--surface-sunken, #f8fafc);
    color: var(--surface-text, #0f172a);
    cursor: pointer;
    height: 30px;
    transition: all 0.15s ease;
}

.task-compact-select:focus {
    outline: none;
    border-color: #6366f1;
    background: var(--surface-card, #ffffff);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.task-hub-reset-btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-priority-chip {
    border: 1px solid var(--surface-border, #cbd5e1);
    background: var(--surface-sunken, #f8fafc);
    color: var(--surface-text, #475569);
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1.2;
}

.task-priority-chip:hover {
    background: var(--surface-hover, #f1f5f9);
    border-color: var(--surface-border-strong, #94a3b8);
}

.task-priority-chip.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.task-priority-chip.chip-high.active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.task-priority-chip.chip-medium.active {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.task-priority-chip.chip-low.active {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.task-hub-stats-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--surface-text-muted, #64748b);
    background: var(--surface-sunken, #f1f5f9);
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid var(--surface-border, #e2e8f0);
    white-space: nowrap;
    min-width: 86px;
    justify-content: center;
    flex-shrink: 0;
}

.task-density-btn.active {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #4f46e5 !important;
}

.kanban-empty-filtered {
    padding: 20px 12px;
    border-radius: 12px;
    border: 1px dashed var(--surface-border, #cbd5e1);
    background: rgba(0, 0, 0, 0.02);
    text-align: center;
    margin: 8px 4px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .task-board-control-hub {
    background: rgba(24, 34, 50, 0.95) !important;
    border-color: #273549 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .sticky-task-toolbar {
    background: rgba(20, 29, 43, 0.95) !important;
}

[data-theme="dark"] .task-search-input {
    background: #121a26 !important;
    border-color: #2b394c !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .task-search-input:focus {
    background: #15202f !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .task-search-kbd {
    background: #1e2a3b !important;
    border-color: #334358 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .task-compact-select {
    background: #121a26 !important;
    border-color: #2b394c !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .task-compact-select:focus {
    background: #15202f !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .select-inline-icon {
    color: #64748b !important;
}

[data-theme="dark"] .task-density-btn.active {
    background: rgba(99, 102, 241, 0.22) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
    color: #818cf8 !important;
}
    background: #15202f !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .task-priority-chip {
    background: #15202f !important;
    border-color: #2b394c !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .task-priority-chip:hover {
    background: #1e2c40 !important;
    border-color: #3d516b !important;
}

[data-theme="dark"] .task-hub-stats-badge {
    background: #121a26 !important;
    border-color: #273549 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .kanban-empty-filtered {
    border-color: #273549 !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: #64748b !important;
}

/* Modern Toasts Dark Mode */
[data-theme="dark"] .modern-toast {
    background: rgba(20, 27, 38, 0.94) !important;
    border-color: #2a374a !important;
    color: #f1f5f9 !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .modern-toast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modern Empty State Dark Mode */
[data-theme="dark"] .modern-empty-state {
    background: var(--surface-card, #141b26) !important;
    border-color: var(--surface-border, #232d3d) !important;
}

[data-theme="dark"] .modern-empty-state-icon {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--primary-light, #818cf8) !important;
}

/* ============================================================================
   Сегментированный переключатель видов задач (Канбан / Мой план / Сроки)
   ============================================================================ */
.task-segmented-nav {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.task-segment-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.task-segment-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

.task-segment-btn.active {
    background: #ffffff;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.task-segment-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Тёмная тема для переключателя представлений */
[data-theme="dark"] .task-segmented-nav {
    background: #111827 !important;
    border-color: #1f2937 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .task-segment-btn {
    color: #9ca3af;
}

[data-theme="dark"] .task-segment-btn:hover {
    color: #f3f4f6;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .task-segment-btn.active {
    background: #1f2937 !important;
    color: #60a5fa !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid #374151 !important;
}

[data-theme="dark"] .task-segment-badge {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #93c5fd !important;
}

/* Стили доски «Мой план» */
[data-theme="dark"] .my-plan-control-bar {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .my-plan-column {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .my-plan-add-stage-card {
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .my-plan-add-stage-card:hover {
    border-color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.04) !important;
}

/* ============================================================================
   ЕДИНАЯ СИСТЕМА ДРАГ-ЭНД-ДРОП ДЛЯ КАНБАНА, МОЕГО ПЛАНА И СРОКОВ
   ============================================================================ */

/* Парящая карточка под курсором (Drag Mirror) */
.drag-mirror-clone {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35), 0 0 0 1.5px rgba(59, 130, 246, 0.5) !important;
    transform: rotate(2.5deg) scale(1.02) !important;
    transform-origin: top left;
    transition: transform 0.08s ease, box-shadow 0.15s ease !important;
    border-radius: 12px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    opacity: 0.96 !important;
    cursor: grabbing !important;
}

[data-theme="dark"] .drag-mirror-clone {
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.7), 0 0 0 1.5px rgba(96, 165, 250, 0.6) !important;
}

/* Исходная карточка на доске в момент перетаскивания (Placeholder) */
.dt-task-card.is-dragging,
.dt-task-card.dragging {
    opacity: 0.28 !important;
    transform: scale(0.97) !important;
    outline: 2px dashed rgba(59, 130, 246, 0.6) !important;
    outline-offset: 2px;
    border-radius: 12px !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    cursor: grabbing !important;
}

/* Подсветка зоны сброса (Dropzone) при наведении */
.dropzone.dropzone-over,
.deadline-dropzone.dropzone-over,
.my-plan-dropzone.dropzone-over {
    outline: 2px dashed #3b82f6 !important;
    outline-offset: -3px !important;
    background-color: rgba(59, 130, 246, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="dark"] .dropzone.dropzone-over,
[data-theme="dark"] .deadline-dropzone.dropzone-over,
[data-theme="dark"] .my-plan-dropzone.dropzone-over {
    outline: 2px dashed #60a5fa !important;
    background-color: rgba(96, 165, 250, 0.12) !important;
    box-shadow: inset 0 0 24px rgba(96, 165, 250, 0.15) !important;
}

/* Класс для скрытия карточек фильтром с гарантированным приоритетом */
.dt-task-card.task-hidden {
    display: none !important;
}

.kanban-empty-filtered {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    margin: 8px 0;
}

/* ============================================================================
   Стилизация шапок колонок раздела «Мой план» (подсветка в стиле Канбана/Сроков)
   ============================================================================ */
.my-plan-header {
    background: linear-gradient(135deg, var(--stage-color, #3b82f6) 0%, color-mix(in srgb, var(--stage-color, #3b82f6) 75%, #000) 100%) !important;
    color: #ffffff !important;
    border-bottom: none !important;
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.my-plan-header .my-plan-stage-title {
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 700;
}

.my-plan-header .my-plan-column-drag-handle {
    color: rgba(255, 255, 255, 0.75) !important;
    cursor: grab;
    transition: color 0.15s ease, opacity 0.15s ease;
}
.my-plan-header .my-plan-column-drag-handle:hover {
    color: #ffffff !important;
}

.my-plan-header .my-plan-count-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    border: none !important;
}

.my-plan-header .my-plan-robot-btn {
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none;
    border-radius: 50%;
    padding: 4px 8px;
    transition: all 0.2s ease;
}
.my-plan-header .my-plan-robot-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

.my-plan-header .dropdown .btn-icon {
    color: rgba(255, 255, 255, 0.85) !important;
    background: transparent;
    border: none;
    transition: color 0.15s ease;
}
.my-plan-header .dropdown .btn-icon:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Тёмная тема для шапок колонок «Мой план» */
[data-theme="dark"] .my-plan-header {
    background: linear-gradient(135deg, color-mix(in srgb, var(--stage-color, #3b82f6) 38%, #0f172a) 0%, color-mix(in srgb, var(--stage-color, #3b82f6) 18%, #020617) 100%) !important;
    color: color-mix(in srgb, var(--stage-color, #3b82f6) 35%, #ffffff) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--stage-color, #3b82f6) 35%, transparent) !important;
}

[data-theme="dark"] .my-plan-header .my-plan-stage-title {
    color: color-mix(in srgb, var(--stage-color, #3b82f6) 40%, #ffffff) !important;
}

[data-theme="dark"] .my-plan-header .my-plan-count-badge {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* ============================================================
   Единый стиль переключателей в панели фильтров задач
   (Канбан, Мой план, Сроки)
============================================================ */
.task-board-control-hub .form-check.form-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    margin-bottom: 0;
}

.task-board-control-hub .form-check-input {
    cursor: pointer;
    float: none;
    margin-left: 0;
    margin-top: 0;
    width: 2.3em;
    height: 1.25em;
    border-radius: 2em;
    background-color: var(--surface-sunken, #cbd5e1);
    border: 1px solid var(--surface-border-strong, #94a3b8);
    transition: background-color 0.2s ease, border-color 0.2s ease, background-position 0.2s ease;
    background-position: left center;
}

.task-board-control-hub .form-check-input:checked {
    background-color: var(--primary-color, #6366f1) !important;
    border-color: var(--primary-color, #6366f1) !important;
    background-position: right center;
}

.task-board-control-hub .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.task-board-control-hub .form-check-label {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

[data-theme="dark"] .task-board-control-hub .form-check-input {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .task-board-control-hub .form-check-input:checked {
    background-color: var(--primary-color, #6366f1) !important;
    border-color: var(--primary-color, #6366f1) !important;
}

/* ============================================================
   Horizontal Board Scroller & Drag-and-Drop Auto-Scroll
   (Мой план, Сроки, Канбан)
   ============================================================ */
.board-scroller-outer {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* Плавающие полупрозрачные кнопки прокрутки Glassmorphism */
.board-nav-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%) scale(0.85);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 105;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.board-nav-btn.is-visible {
    opacity: 0.85;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.board-nav-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28), 0 3px 8px rgba(0, 0, 0, 0.1);
    color: #2563eb;
}

.board-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.board-nav-btn--prev {
    left: 10px;
}

.board-nav-btn--next {
    right: 10px;
}

/* Тёмная тема для плавающих кнопок */
[data-theme="dark"] .board-nav-btn {
    background: rgba(22, 30, 46, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .board-nav-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.4);
}

/* Краевые тени наличия скрытых колонок */
.board-edge-shadow {
    position: absolute;
    top: 0;
    bottom: 16px;
    width: 28px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.board-edge-shadow--left {
    left: 0;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.08), transparent);
}

.board-edge-shadow--right {
    right: 0;
    background: linear-gradient(to left, rgba(15, 23, 42, 0.08), transparent);
}

.board-edge-shadow.is-active {
    opacity: 1;
}

[data-theme="dark"] .board-edge-shadow--left {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent);
}

[data-theme="dark"] .board-edge-shadow--right {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.35), transparent);
}

/* Световые индикаторы активного автоскролла при Drag-and-Drop */
.board-edge-hint {
    position: absolute;
    top: 0;
    bottom: 20px;
    width: 90px;
    pointer-events: none;
    z-index: 104;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.board-edge-hint--left {
    left: 0;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.05) 70%, transparent);
    transform: translateX(-15px);
}

.board-edge-hint--right {
    right: 0;
    background: linear-gradient(to left, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.05) 70%, transparent);
    transform: translateX(15px);
}

.board-edge-hint.is-active {
    opacity: 1;
    transform: translateX(0);
}

.board-edge-hint__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.92);
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
    animation: boardEdgePulse 1.1s infinite alternate ease-in-out;
}

@keyframes boardEdgePulse {
    0% { transform: scale(0.92); opacity: 0.85; }
    100% { transform: scale(1.05); opacity: 1; box-shadow: 0 6px 20px rgba(37, 99, 235, 0.65); }
}

/* Режим Pan (перетаскивание пустой доски мышью) */
.my-plan-board-wrapper,
.deadline-container {
    cursor: default;
    scroll-behavior: auto; /* Для непрерывного автоскролла без лагов */
}

.my-plan-board-wrapper.is-panning,
.deadline-container.is-panning {
    cursor: grabbing !important;
    user-select: none !important;
}

.my-plan-board-wrapper.is-panning *,
.deadline-container.is-panning * {
    cursor: grabbing !important;
    user-select: none !important;
    pointer-events: none !important;
}

