/* Светлая тема: переменные и поверхности (подключается после основных стилей). */
html[data-theme="light"] {
  color-scheme: light;
  --bg0: #eef1f8;
  --bg1: #e4eaf5;
  --bg2: #d8e0ed;
  --line: rgba(30, 64, 120, 0.14);
  --text: #0f172a;
  --muted: #64748b;
  --accent1: #ea580c;
  --accent2: #9333ea;
  --accent3: #0284c7;
  --accent4: #2563eb;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --ac-bg: #e8edf8;
  --ac-surface: rgba(255, 255, 255, 0.94);
  --ac-line: rgba(30, 64, 120, 0.14);
  --ac-text: #0f172a;
  --ac-muted: #64748b;
  --ac-wait-card-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.99) 0%, rgba(241, 245, 255, 0.98) 52%, rgba(248, 250, 252, 0.99) 100%);
  --ac-wait-card-shade: 0 22px 50px rgba(15, 23, 42, 0.09);
  --ac-wait-card-inset: 0 1px 0 rgba(255, 255, 255, 0.95) inset;
  --ac-wait-icon-bg: linear-gradient(145deg, rgba(59, 130, 246, 0.12), rgba(14, 165, 233, 0.08));
  --ac-wait-icon-border: rgba(37, 99, 235, 0.22);
  --ac-wait-icon-color: #0369a1;
  --ac-wait-icon-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
  --ac-wait-badge-text: #1d4ed8;
  --ac-wait-badge-bg: rgba(59, 130, 246, 0.12);
  --ac-wait-badge-border: rgba(37, 99, 235, 0.25);
  --ac-wait-list-muted: #64748b;
  --ac-wait-check: #16a34a;
  --ac-wait-foot: #94a3b8;
}

html[data-theme="light"] body,
html[data-theme="light"] body.ac-page {
  background-color: #e4eaf6;
  background-image:
    radial-gradient(ellipse 110% 95% at 4% -8%, rgba(255, 90, 60, 0.14), transparent 48%),
    radial-gradient(ellipse 90% 70% at 96% 4%, rgba(46, 197, 255, 0.16), transparent 46%),
    radial-gradient(ellipse 75% 55% at 52% 102%, rgba(184, 77, 255, 0.12), transparent 42%),
    radial-gradient(ellipse 55% 45% at 78% 38%, rgba(58, 134, 255, 0.11), transparent 50%),
    linear-gradient(168deg, #f8faff 0%, #e8eef9 32%, #dce6f5 58%, #d4dff0 100%);
  background-attachment: fixed;
  color: var(--text);
}

html[data-theme="light"] body.ac-page {
  color: var(--ac-text);
}

html[data-theme="light"] .ac-mesh {
  background:
    radial-gradient(ellipse 100% 80% at 10% -10%, rgba(255, 77, 46, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 90% 10%, rgba(34, 211, 238, 0.14), transparent 45%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(168, 85, 247, 0.1), transparent 40%),
    linear-gradient(180deg, #eef2fa 0%, #e4eaf6 100%);
}

/* Лендинг index — светлая тема: читаемый заголовок, заметнее градиенты и «дождь» */
html[data-theme="light"] body.ac-page-home {
  background-image:
    radial-gradient(ellipse 100% 88% at 6% -6%, rgba(255, 90, 60, 0.26), transparent 54%),
    radial-gradient(ellipse 88% 72% at 96% 6%, rgba(14, 165, 233, 0.24), transparent 50%),
    radial-gradient(ellipse 72% 52% at 50% 104%, rgba(168, 85, 247, 0.22), transparent 48%),
    radial-gradient(ellipse 52% 42% at 78% 32%, rgba(59, 130, 246, 0.2), transparent 54%),
    linear-gradient(168deg, #ffffff 0%, #eef2ff 30%, #e2e8f7 58%, #d4e0f5 100%);
}

html[data-theme="light"] body.ac-page-home .ac-mesh {
  background:
    radial-gradient(ellipse 100% 82% at 10% -12%, rgba(255, 77, 46, 0.24), transparent 54%),
    radial-gradient(ellipse 82% 62% at 92% 8%, rgba(34, 211, 238, 0.22), transparent 48%),
    radial-gradient(ellipse 64% 52% at 48% 100%, rgba(168, 85, 247, 0.2), transparent 44%),
    radial-gradient(ellipse 48% 38% at 72% 36%, rgba(37, 99, 235, 0.14), transparent 52%),
    linear-gradient(185deg, rgba(255, 255, 255, 0.55) 0%, rgba(226, 232, 246, 0.45) 45%, rgba(212, 224, 245, 0.65) 100%);
}

html[data-theme="light"] body.ac-page-home .ac-grid-noise {
  opacity: 0.28;
  mix-blend-mode: multiply;
}

html[data-theme="light"] .ac-page-home .ac-home-title-inner {
  background: linear-gradient(118deg, #0f172a 0%, #1d4ed8 32%, #6d28d9 58%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .ac-page-home .ac-home-cta {
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.28);
}

html[data-theme="light"] .ac-home-footer {
  color: var(--muted);
}

html[data-theme="light"] .ac-nav {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--ac-line);
}

html[data-theme="light"] .ac-nav-links a:hover {
  background: rgba(37, 99, 235, 0.08);
}

html[data-theme="light"] .ac-input {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--ac-line);
  color: var(--ac-text);
}

html[data-theme="light"] .crm-sidebar {
  background: transparent;
  border-right-color: var(--line);
}

html[data-theme="light"] .crm-brand-text strong {
  color: var(--text);
}

html[data-theme="light"] .crm-main {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, transparent 52%),
    linear-gradient(215deg, rgba(46, 197, 255, 0.08) 0%, transparent 48%),
    linear-gradient(0deg, rgba(184, 77, 255, 0.04), transparent 35%);
}

html[data-theme="light"] .crm-topbar {
  background: rgba(255, 255, 255, 0.78);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .crm-chip {
  background: var(--bg2);
  color: var(--muted);
  border-color: var(--line);
}

html[data-theme="light"] .crm-nav-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

html[data-theme="light"] .crm-nav-btn.is-active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
}

html[data-theme="light"] .crm-placeholder {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(240, 244, 252, 0.95));
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .crm-board-viewport {
  border-color: var(--line);
}

html[data-theme="light"] .crm-board-canvas {
  background-color: #e8edf7;
}

html[data-theme="light"] .crm-board-toolbar {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
}

/* Страница «Участники» (users.php) — поля и кнопка сохранения в светлой теме.
   Нельзя использовать шортханд background: — он сбрасывает background-repeat в repeat,
   из‑за чего иконка стрелки селекта тайлится на весь фон. */
html[data-theme="light"] .ac-admin-job-input {
  background-color: rgba(255, 255, 255, 0.98);
  color: var(--ac-text);
  border: 1px solid var(--ac-line);
  color-scheme: light;
}

html[data-theme="light"] .ac-admin-level-select {
  background-color: rgba(255, 255, 255, 0.98);
  color: var(--ac-text);
  border: 1px solid var(--ac-line);
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

html[data-theme="light"] .ac-admin-level-select:hover,
html[data-theme="light"] .ac-admin-job-input:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background-color: #ffffff;
}

html[data-theme="light"] .ac-admin-level-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

html[data-theme="light"] .ac-admin-level-select:focus,
html[data-theme="light"] .ac-admin-job-input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .ac-users-bulk-form .ac-btn-primary {
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
  background-image: none;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .ac-users-bulk-form .ac-btn-primary:hover {
  border-color: rgba(37, 99, 235, 0.48);
  background: linear-gradient(155deg, #ffffff 0%, rgba(239, 246, 255, 1) 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .ac-admin-table-wrap {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--ac-line);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .ac-admin-table td {
  color: var(--ac-text);
}

html[data-theme="light"] .ac-admin-avatar-img {
  border-color: var(--ac-line);
}

html[data-theme="light"] .ac-inline-form select {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ac-text);
  border-color: var(--ac-line);
  color-scheme: light;
}

/* Заголовки и элементы с жёстким #fff в CRM-модулях */
html[data-theme="light"] .crm-brand-text strong,
html[data-theme="light"] .crm-topbar h1,
html[data-theme="light"] .crm-dashboard-title,
html[data-theme="light"] .crm-dash-card-title,
html[data-theme="light"] .profile-nick,
html[data-theme="light"] .profile-total-pill-num,
html[data-theme="light"] .tete-page-title,
html[data-theme="light"] .tasks-page-title,
html[data-theme="light"] .tete-modal > h2,
html[data-theme="light"] .tete-modal-title,
html[data-theme="light"] .tete-btn-primary,
html[data-theme="light"] .tete-pagination-nav button,
html[data-theme="light"] .tete-pagination-pages .tete-page-num,
html[data-theme="light"] .tete-pagination-pages .tete-page-indicator,
html[data-theme="light"] .tete-modal-close:hover,
html[data-theme="light"] .sov-page-title,
html[data-theme="light"] .tasks-btn-primary,
html[data-theme="light"] .tasks-tab.is-active {
  color: var(--text) !important;
}

html[data-theme="light"] .crm-dash-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 255, 0.92) 100%);
  border-color: var(--line);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .crm-dash-card:hover {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(155deg, #ffffff 0%, rgba(241, 245, 255, 0.98) 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .crm-dash-card-icon {
  background: rgba(224, 242, 254, 0.85);
  border-color: rgba(30, 64, 120, 0.12);
  color: #0369a1;
}

html[data-theme="light"] .crm-dash-card-desc {
  color: var(--muted);
}

html[data-theme="light"] .profile-crm-scroll {
  background: linear-gradient(180deg, #f1f5f9 0%, #e8edf5 48%, #f8fafc 100%);
}

html[data-theme="light"] .tete-modal {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 249, 255, 0.99) 100%);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .rc-form-modal__head h2 {
  color: var(--text) !important;
}

html[data-theme="light"] .rc-form-modal__hint {
  background: rgba(241, 245, 255, 0.85);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .rc-form-modal__panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  box-shadow: none;
}

html[data-theme="light"] .rc-form-modal__stat {
  background: rgba(248, 250, 252, 0.95);
  border-color: var(--line);
}

html[data-theme="light"] .rc-form-modal__num {
  background: #fff !important;
  border-color: var(--line) !important;
}

html[data-theme="light"] .rc-form-modal__actions {
  background: linear-gradient(180deg, transparent 0%, rgba(241, 245, 255, 0.6) 100%);
  border-top-color: var(--line);
}

html[data-theme="light"] .rc-form-modal__head-icon {
  background: linear-gradient(145deg, rgba(224, 242, 254, 0.95) 0%, rgba(219, 234, 254, 0.85) 100%);
  border-color: rgba(37, 99, 235, 0.18);
  color: rgba(29, 78, 216, 0.92);
}

html[data-theme="light"] .tete-modal-overlay {
  background: rgba(15, 23, 42, 0.4);
}

html[data-theme="light"] .fb-detail-modal::before {
  opacity: 1;
}

html[data-theme="light"] .fb-detail-title {
  color: var(--text);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .fb-detail-k {
  color: var(--muted);
}

html[data-theme="light"] .fb-detail-ico {
  color: #0284c7;
}

html[data-theme="light"] .fb-detail-v {
  color: var(--text);
}

html[data-theme="light"] .fb-detail-v--multiline {
  background: rgba(241, 245, 249, 0.95);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .fb-detail-actions {
  border-top-color: var(--line);
}

html[data-theme="light"] .fb-detail-btn-edit {
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.15);
}

html[data-theme="light"] .fb-detail-link {
  color: #0369a1;
  text-decoration-color: rgba(3, 105, 161, 0.4);
}

html[data-theme="light"] .fb-detail-link:hover {
  color: #0284c7;
  text-decoration-color: rgba(2, 132, 199, 0.65);
}

html[data-theme="light"] .tete-cell-desc-hint {
  color: var(--muted);
}

/* ——— Задачи ——— */
html[data-theme="light"] .tasks-tabs {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-tab {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tasks-tab:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

html[data-theme="light"] .tasks-tab.is-active {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(2, 132, 199, 0.35);
}

html[data-theme="light"] .tasks-btn-primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(2, 132, 199, 0.18));
  border-color: rgba(2, 132, 199, 0.45);
  color: var(--text) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

html[data-theme="light"] .tasks-btn-primary:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(2, 132, 199, 0.26));
}

html[data-theme="light"] .tasks-column {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .tasks-column-head {
  background: rgba(241, 245, 255, 0.95);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .tasks-col-add {
  border-color: rgba(30, 64, 120, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

html[data-theme="light"] .tasks-col-add:hover {
  color: var(--text);
  background: rgba(2, 132, 199, 0.1);
}

html[data-theme="light"] .tasks-column-body {
  background: rgba(248, 250, 255, 0.5);
}

html[data-theme="light"] .tasks-column-head--yougile {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14) 0%, rgba(241, 245, 255, 0.98) 100%);
  border-top-color: #4f46e5;
}

html[data-theme="light"] .tasks-yougile-head-btn {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tasks-yougile-head-btn:hover {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(224, 242, 254, 0.9);
}

html[data-theme="light"] .tasks-yougile-head-btn--danger:hover {
  color: #b91c1c !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(254, 226, 226, 0.9) !important;
}

html[data-theme="light"] .tasks-yougile-add-column-btn {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(165deg, rgba(224, 242, 254, 0.65) 0%, rgba(241, 245, 255, 0.95) 100%);
  color: var(--text);
}

html[data-theme="light"] .tasks-yougile-add-column-btn:hover {
  border-color: rgba(29, 78, 216, 0.55);
  color: var(--text);
  background: linear-gradient(165deg, rgba(191, 219, 254, 0.85) 0%, rgba(241, 245, 255, 1) 100%);
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.12);
}

/* Плитка «+»: белый глиф на сплошном синем — максимальный контраст в light */
html[data-theme="light"] .tasks-yougile-add-column-icon {
  background: linear-gradient(165deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1px solid rgba(30, 64, 175, 0.65);
  color: #fff;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 16px rgba(37, 99, 235, 0.35);
  font-size: 24px;
}

html[data-theme="light"] .tasks-yougile-add-column-icon i {
  color: #fff !important;
  opacity: 1;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.2);
  -webkit-font-smoothing: antialiased;
}

html[data-theme="light"] .tasks-yougile-add-column-btn:hover .tasks-yougile-add-column-icon {
  background: linear-gradient(165deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  border-color: #1e3a8a;
  color: #fff;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.2) inset,
    0 6px 20px rgba(29, 78, 216, 0.4);
}

html[data-theme="light"] .tasks-yougile-add-column-btn:hover .tasks-yougile-add-column-icon i {
  color: #fff !important;
}

html[data-theme="light"] .tasks-yougile-empty-board {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .tasks-card:hover {
  border-color: rgba(2, 132, 199, 0.28);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .tasks-assignee-card-chip::after {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .tasks-column-count {
  background: rgba(15, 23, 42, 0.06);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tasks-empty {
  background: rgba(241, 245, 255, 0.8);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tasks-card-actions button,
html[data-theme="light"] .tasks-card-actions .tasks-card-chat {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}

html[data-theme="light"] .tasks-card-chat {
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #0369a1 !important;
  background: rgba(224, 242, 254, 0.95) !important;
}

html[data-theme="light"] .tasks-card-chat:hover {
  color: #0c4a6e !important;
  background: rgba(186, 230, 253, 0.98) !important;
}

html[data-theme="light"] .tasks-card-actions button:not(.tasks-card-complete):hover {
  background: rgba(2, 132, 199, 0.1) !important;
  color: var(--text) !important;
}

html[data-theme="light"] .tasks-card-actions .tasks-card-complete {
  color: #166534 !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  background: rgba(220, 252, 231, 0.85) !important;
}

html[data-theme="light"] .tasks-card-actions .tasks-card-complete:hover {
  color: #14532d !important;
  border-color: rgba(22, 163, 74, 0.55) !important;
  background: rgba(187, 247, 208, 0.95) !important;
}

html[data-theme="light"] .tasks-modal {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5ff 100%);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-modal-overlay {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .tasks-field input[type="text"],
html[data-theme="light"] .tasks-field textarea,
html[data-theme="light"] .tasks-field select {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .tasks-assignee-list {
  background: rgba(248, 250, 255, 0.95);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-modal-actions button {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .tasks-modal-actions button:hover {
  background: rgba(241, 245, 255, 1);
}

html[data-theme="light"] .tasks-modal-actions .tasks-btn-save {
  background: rgba(37, 99, 235, 0.85);
  color: #fff !important;
}

html[data-theme="light"] .tasks-modal-actions .tasks-btn-save:hover {
  background: rgba(29, 78, 216, 0.95);
}

html[data-theme="light"] .tasks-chat-panel {
  background: linear-gradient(195deg, #ffffff 0%, #f4f7fd 55%, #eef2fa 100%);
  border-left-color: var(--line);
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .tasks-chat-dock {
  background: linear-gradient(195deg, #ffffff 0%, #e8eef5 100%);
  border-color: rgba(30, 64, 120, 0.2);
  color: #64748b;
  box-shadow: -4px 0 18px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .tasks-chat-dock:hover {
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.3);
  background: linear-gradient(195deg, #f8fafc 0%, #e2e8f0 100%);
}

html[data-theme="light"] .tasks-chat-dock-bar {
  background: rgba(100, 116, 139, 0.42);
}

html[data-theme="light"] .tasks-chat-head,
html[data-theme="light"] .tasks-chat-compose {
  border-color: var(--line);
}

html[data-theme="light"] .tasks-chat-compose {
  background: rgba(248, 250, 255, 0.92);
}

html[data-theme="light"] .tasks-chat-readonly-banner {
  color: #92400e;
  background: rgba(254, 243, 199, 0.85);
  border-color: rgba(245, 158, 11, 0.35);
}

html[data-theme="light"] .tasks-chat-file-btn {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-file-btn:hover {
  color: var(--text);
  border-color: rgba(2, 132, 199, 0.45);
  background: rgba(224, 242, 254, 0.65);
}

html[data-theme="light"] .tasks-chat-pending-chip {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .tasks-chat-pending-chip-meta {
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-pending-chip-remove {
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-pending-chip-remove:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

html[data-theme="light"] .tasks-chat-hint {
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-file-link {
  color: #0369a1;
}

html[data-theme="light"] .tasks-chat-file-link:hover {
  color: #1d4ed8;
}

html[data-theme="light"] .tasks-chat-messages {
  background: rgba(248, 250, 255, 0.6);
}

html[data-theme="light"] .tasks-chat-msg {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-chat-msg--mine {
  background: rgba(219, 234, 254, 0.95);
  border-color: rgba(37, 99, 235, 0.2);
}

html[data-theme="light"] .tasks-chat-msg-user {
  color: #0f172a;
}

html[data-theme="light"] .tasks-chat-head-title {
  color: var(--text);
}

html[data-theme="light"] .tasks-chat-input,
html[data-theme="light"] .tasks-chat-compose textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .tasks-chat-close {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .tasks-chat-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

html[data-theme="light"] .tasks-chat-back-list {
  color: #0369a1;
}

html[data-theme="light"] .tasks-chat-back-list:hover {
  color: #0c4a6e;
}

html[data-theme="light"] .tasks-chat-head {
  background: rgba(255, 255, 255, 0.97);
}

html[data-theme="light"] .tasks-chat-head-check {
  color: rgba(100, 116, 139, 0.9);
}

html[data-theme="light"] .tasks-chat-meta-bar {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .tasks-chat-task-key {
  color: #0284c7;
}

html[data-theme="light"] .tasks-chat-icon-btn {
  background: rgba(15, 23, 42, 0.05);
  color: #64748b;
}

html[data-theme="light"] .tasks-chat-icon-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.08);
  color: #0f172a;
}

html[data-theme="light"] .tasks-chat-icon-btn--ghost {
  background: transparent;
}

html[data-theme="light"] .tasks-chat-tabs {
  background: linear-gradient(180deg, #f1f5f9 0%, #e8eef5 100%);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .tasks-chat-tab {
  color: #64748b;
}

html[data-theme="light"] .tasks-chat-tab:hover {
  color: #334155;
}

html[data-theme="light"] .tasks-chat-tab.is-active {
  color: #0f172a;
  border-bottom-color: #0284c7;
}

html[data-theme="light"] .tasks-chat-details {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .tasks-chat-details-summary {
  color: #0f172a;
}

html[data-theme="light"] .tasks-chat-details-body {
  border-top-color: var(--line);
}

html[data-theme="light"] .tasks-chat-info-block {
  border-bottom-color: rgba(30, 64, 120, 0.08);
}

html[data-theme="light"] .tasks-chat-info-h {
  color: #64748b;
}

html[data-theme="light"] .tasks-chat-dl dt {
  color: #64748b;
}

html[data-theme="light"] .tasks-chat-dl dd {
  color: #0f172a;
}

html[data-theme="light"] .tasks-chat-resp-placeholder {
  border-color: rgba(100, 116, 139, 0.35);
  color: #94a3b8;
}

html[data-theme="light"] .tasks-chat-log-empty {
  color: #64748b;
}

html[data-theme="light"] .tasks-chat-breadcrumb {
  color: #0369a1;
}

html[data-theme="light"] .tasks-chat-linklike {
  color: #0369a1;
}

html[data-theme="light"] .tasks-chat-log-select {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .tasks-chat-log {
  background: rgba(248, 250, 252, 0.95);
  border-color: var(--line);
}

html[data-theme="light"] .tasks-chat-log-date span {
  color: #64748b;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .tasks-chat-log-row {
  border-top-color: rgba(30, 64, 120, 0.08);
}

html[data-theme="light"] .tasks-chat-log-time {
  color: #94a3b8;
}

html[data-theme="light"] .tasks-chat-log-icon {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.12);
}

html[data-theme="light"] .tasks-chat-log-text {
  color: #0f172a;
}

html[data-theme="light"] .tasks-chat-log-avatar {
  border-color: var(--line);
}

html[data-theme="light"] .tasks-chat-log-avatar--empty {
  color: #64748b;
  background: rgba(241, 245, 249, 0.98);
}

html[data-theme="light"] .tasks-chat-log-filter-icon {
  color: #94a3b8;
}

html[data-theme="light"] .tasks-chat-compose textarea:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .tasks-chat-edit-cancel {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-edit-cancel:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--text);
  background: rgba(241, 245, 255, 1);
}

html[data-theme="light"] .tasks-chat-send {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  color: #fff;
  border: 1px solid rgba(30, 64, 175, 0.35);
}

html[data-theme="light"] .tasks-chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
}

html[data-theme="light"] .tasks-chat-msg-body {
  color: var(--text);
}

html[data-theme="light"] .tasks-chat-msg-time {
  color: var(--muted);
}

html[data-theme="light"] .tasks-chat-messages {
  scrollbar-color: rgba(100, 116, 148, 0.5) rgba(241, 245, 249, 0.95);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.95);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.55), rgba(100, 116, 139, 0.6));
  border: 2px solid rgba(241, 245, 249, 0.95);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.45);
}

html[data-theme="light"] .tasks-chat-info-scroll {
  scrollbar-color: rgba(100, 116, 148, 0.5) rgba(241, 245, 249, 0.95);
}

html[data-theme="light"] .tasks-chat-info-scroll::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.95);
}

html[data-theme="light"] .tasks-chat-info-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.5), rgba(100, 116, 139, 0.55));
  border: 2px solid rgba(241, 245, 249, 0.95);
  border-radius: 8px;
}

html[data-theme="light"] .tasks-chat-info-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.42);
}

/* ——— Отчёты (tete) ——— */
html[data-theme="light"] .tete-toolbar-dates {
  background: transparent;
  border: none;
  box-shadow: none;
}

html[data-theme="light"] .tete-toolbar-dates-sep {
  color: var(--muted);
}

html[data-theme="light"] .tete-toolbar-dates input[type='date'] {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .tete-toolbar-dates input[type='date']::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.75;
}

html[data-theme="light"] .tete-toolbar-search {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tete-toolbar-filter select {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .tete-sort-info {
  background: rgba(241, 245, 255, 0.95);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tete-sort-info-body strong {
  color: var(--text);
}

html[data-theme="light"] .tete-btn-primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(2, 132, 199, 0.18));
  border-color: rgba(2, 132, 199, 0.45);
  color: var(--text) !important;
}

html[data-theme="light"] .tete-btn-primary:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(2, 132, 199, 0.26));
}

html[data-theme="light"] .tete-btn-ghost {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .tete-btn-ghost:hover {
  background: rgba(241, 245, 255, 1);
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.35);
}

html[data-theme="light"] .tete-rc-sheet-controls {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .tete-rc-sheet-label {
  color: #64748b;
}

html[data-theme="light"] .tete-rc-sheet-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .tete-rc-sheet-select:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
  border-color: #93c5fd;
}

html[data-theme="light"] .tete-rc-sheet-controls .tete-btn-ghost--compact {
  min-height: 36px;
  border-radius: 10px;
  background: #ffffff;
}

html[data-theme="light"] .tete-rc-sheet-controls #rcBtnDeleteSheet {
  min-width: 38px;
  padding: 7px 10px;
}

html[data-theme="light"] .tete-empty {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(58, 134, 255, 0.1), transparent 55%),
    rgba(255, 255, 255, 0.85);
  border-color: var(--line);
}

html[data-theme="light"] .tete-empty-icon {
  background: rgba(241, 245, 255, 0.95);
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="light"] .tete-empty-title {
  color: var(--text) !important;
}

html[data-theme="light"] .tete-pagination {
  background: transparent;
  border: none;
}

html[data-theme="light"] .tete-pagination-nav button,
html[data-theme="light"] .tete-pagination-pages .tete-page-num {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}

html[data-theme="light"] .tete-pagination-pages .tete-page-indicator {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text) !important;
}

html[data-theme="light"] .tete-pagination-nav .tete-page-prev,
html[data-theme="light"] .tete-pagination-nav .tete-page-next {
  color: var(--muted);
}

html[data-theme="light"] .tete-pagination-nav button:hover:not(:disabled),
html[data-theme="light"] .tete-pagination-pages .tete-page-num:hover:not(:disabled):not(.is-active) {
  border-color: rgba(30, 64, 120, 0.12) !important;
  background: rgba(30, 64, 120, 0.05) !important;
  color: var(--text) !important;
}

html[data-theme="light"] .tete-pagination-nav .tete-page-prev:hover:not(:disabled),
html[data-theme="light"] .tete-pagination-nav .tete-page-next:hover:not(:disabled) {
  color: var(--text) !important;
}

html[data-theme="light"] .tete-pagination-pages .tete-page-num.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text) !important;
}

html[data-theme="light"] .tete-table-wrap {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .tete-table th,
html[data-theme="light"] .tete-table td {
  border-bottom-color: rgba(30, 64, 120, 0.1);
}

html[data-theme="light"] .tete-table td {
  color: var(--text);
}

html[data-theme="light"] .tete-sort-ind {
  color: var(--muted);
}

html[data-theme="light"] .tete-sort-ind.is-active {
  color: #0369a1;
}

html[data-theme="light"] .tete-btn-edit {
  background: rgba(224, 242, 254, 0.95);
  border-color: rgba(2, 132, 199, 0.4);
  color: #0369a1;
}

html[data-theme="light"] .tete-btn-edit:hover {
  background: rgba(186, 230, 253, 1);
  color: #0c4a6e;
}

html[data-theme="light"] .tete-btn-delete {
  background: rgba(254, 242, 242, 0.95);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

html[data-theme="light"] .tete-btn-delete:hover {
  color: #991b1b;
  background: rgba(254, 226, 226, 1);
}

html[data-theme="light"] .tete-field input[type="text"],
html[data-theme="light"] .tete-field textarea,
html[data-theme="light"] .tete-field select {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .tete-modal-close {
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
}

html[data-theme="light"] .tete-modal-close:hover {
  color: var(--text) !important;
  background: rgba(15, 23, 42, 0.1);
}

/* Плашки категорий/статусов — тёмный текст на светлом фоне */
html[data-theme="light"] .tete-pill--cat-rules { color: #b91c1c; border-color: rgba(220, 38, 38, 0.45); background: rgba(254, 242, 242, 0.6); }
html[data-theme="light"] .tete-pill--cat-admin { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.45); background: rgba(239, 246, 255, 0.8); }
html[data-theme="light"] .tete-pill--cat-events { color: #15803d; border-color: rgba(22, 163, 74, 0.45); background: rgba(240, 253, 244, 0.85); }
html[data-theme="light"] .tete-pill--cat-bugs { color: #a16207; border-color: rgba(202, 138, 4, 0.5); background: rgba(254, 252, 232, 0.9); }
html[data-theme="light"] .tete-pill--cat-content { color: #6d28d9; border-color: rgba(124, 58, 237, 0.45); background: rgba(245, 243, 255, 0.85); }
html[data-theme="light"] .tete-pill--cat-economy { color: #c2410c; border-color: rgba(234, 88, 12, 0.45); background: rgba(255, 247, 237, 0.9); }
html[data-theme="light"] .tete-pill--cat-factions { color: #4338ca; border-color: rgba(79, 70, 229, 0.45); background: rgba(238, 242, 255, 0.9); }
html[data-theme="light"] .tete-pill--cat-other { color: #475569; border-color: rgba(100, 116, 139, 0.45); background: rgba(248, 250, 252, 0.95); }

html[data-theme="light"] .tete-pill--prio-low { color: #15803d; border-color: rgba(22, 163, 74, 0.45); background: rgba(240, 253, 244, 0.85); }
html[data-theme="light"] .tete-pill--prio-medium { color: #a16207; border-color: rgba(202, 138, 4, 0.5); background: rgba(254, 252, 232, 0.9); }
html[data-theme="light"] .tete-pill--prio-high { color: #c2410c; border-color: rgba(234, 88, 12, 0.45); background: rgba(255, 247, 237, 0.9); }
html[data-theme="light"] .tete-pill--prio-critical { color: #b91c1c; border-color: rgba(220, 38, 38, 0.45); background: rgba(254, 242, 242, 0.85); }

html[data-theme="light"] .tete-pill--stat-resolved_on_spot { color: #047857; border-color: rgba(5, 150, 105, 0.45); background: rgba(236, 253, 245, 0.9); }
html[data-theme="light"] .tete-pill--stat-explained_to_player { color: #0369a1; border-color: rgba(2, 132, 199, 0.45); background: rgba(240, 249, 255, 0.92); }
html[data-theme="light"] .tete-pill--stat-player_agreed { color: #15803d; border-color: rgba(22, 163, 74, 0.45); background: rgba(240, 253, 244, 0.9); }
html[data-theme="light"] .tete-pill--stat-player_disagreed { color: #b45309; border-color: rgba(217, 119, 6, 0.46); background: rgba(255, 247, 237, 0.92); }
html[data-theme="light"] .tete-pill--stat-escalated_ga { color: #3730a3; border-color: rgba(79, 70, 229, 0.46); background: rgba(238, 242, 255, 0.9); }
html[data-theme="light"] .tete-pill--stat-escalated_senior_admin { color: #6d28d9; border-color: rgba(124, 58, 237, 0.46); background: rgba(245, 243, 255, 0.9); }
html[data-theme="light"] .tete-pill--stat-escalated_dev { color: #be185d; border-color: rgba(190, 24, 93, 0.44); background: rgba(253, 242, 248, 0.92); }
html[data-theme="light"] .tete-pill--stat-needs_verification { color: #a16207; border-color: rgba(202, 138, 4, 0.48); background: rgba(254, 252, 232, 0.92); }
html[data-theme="light"] .tete-pill--stat-needs_evidence { color: #c2410c; border-color: rgba(234, 88, 12, 0.45); background: rgba(255, 247, 237, 0.92); }
html[data-theme="light"] .tete-pill--stat-declined { color: #b91c1c; border-color: rgba(220, 38, 38, 0.46); background: rgba(254, 242, 242, 0.9); }
html[data-theme="light"] .tete-pill--stat-compensation_issued { color: #0e7490; border-color: rgba(14, 116, 144, 0.45); background: rgba(236, 254, 255, 0.92); }
html[data-theme="light"] .tete-pill--stat-punishment_revised { color: #a21caf; border-color: rgba(162, 28, 175, 0.46); background: rgba(253, 244, 255, 0.92); }
html[data-theme="light"] .tete-pill--stat-punishment_kept { color: #be123c; border-color: rgba(190, 24, 93, 0.45); background: rgba(255, 241, 242, 0.9); }
html[data-theme="light"] .tete-pill--stat-feedback_forwarded_to_admins { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.45); background: rgba(239, 246, 255, 0.9); }
html[data-theme="light"] .tete-pill--stat-system_issue_in_progress { color: #475569; border-color: rgba(100, 116, 139, 0.45); background: rgba(248, 250, 252, 0.95); }

html[data-theme="light"] .tete-pill--cftype-admin_player { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.45); background: rgba(239, 246, 255, 0.85); }
html[data-theme="light"] .tete-pill--cftype-leader_player { color: #5b21b6; border-color: rgba(124, 58, 237, 0.45); background: rgba(245, 243, 255, 0.85); }
html[data-theme="light"] .tete-pill--cftype-admin_leader { color: #c2410c; border-color: rgba(234, 88, 12, 0.45); background: rgba(255, 247, 237, 0.9); }
html[data-theme="light"] .tete-pill--cftype-faction_faction { color: #0f766e; border-color: rgba(13, 148, 136, 0.45); background: rgba(240, 253, 250, 0.9); }
html[data-theme="light"] .tete-pill--cftype-other { color: #475569; border-color: rgba(100, 116, 139, 0.45); background: rgba(248, 250, 252, 0.95); }

html[data-theme="light"] .tete-pill--cfstat-new { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.45); background: rgba(239, 246, 255, 0.85); }
html[data-theme="light"] .tete-pill--cfstat-in_progress { color: #a16207; border-color: rgba(202, 138, 4, 0.5); background: rgba(254, 252, 232, 0.9); }
html[data-theme="light"] .tete-pill--cfstat-resolved { color: #15803d; border-color: rgba(22, 163, 74, 0.45); background: rgba(240, 253, 244, 0.85); }
html[data-theme="light"] .tete-pill--cfstat-escalation { color: #b91c1c; border-color: rgba(220, 38, 38, 0.45); background: rgba(254, 242, 242, 0.85); }

/* ——— Серверы (sov) ——— */
html[data-theme="light"] .sov-page-title {
  color: var(--text) !important;
}

html[data-theme="light"] .sov-select-wide {
  background-color: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .sov-select-control {
  background-color: rgba(255, 255, 255, 0.98);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  border-color: var(--line);
  color: var(--text);
  color-scheme: light;
}

html[data-theme="light"] .sov-modal-inner {
  background: var(--ac-surface);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .sov-btn-primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border-color: rgba(29, 78, 216, 0.55);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .sov-btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.65);
}

html[data-theme="light"] .sov-btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--text);
}

/* Доска канбана (server-overview) — светлая тема (.crm-app повышает специфичность) */
html[data-theme="light"] .crm-app .sov-column {
  background: #f1f5f9 !important;
  background-image: none !important;
  border: 1px solid rgba(30, 64, 120, 0.14) !important;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .crm-app .sov-column-cards {
  background: transparent;
}

html[data-theme="light"] .sov-modal-inner .sov-ta,
html[data-theme="light"] .sov-modal-inner textarea.sov-modal-field {
  background: #ffffff !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  color-scheme: light !important;
}

html[data-theme="light"] .sov-modal-inner .sov-ta:hover,
html[data-theme="light"] .sov-modal-inner textarea.sov-modal-field:hover {
  border-color: rgba(37, 99, 235, 0.28) !important;
}

html[data-theme="light"] .sov-modal-inner .sov-ta:focus,
html[data-theme="light"] .sov-modal-inner textarea.sov-modal-field:focus {
  border-color: rgba(37, 99, 235, 0.45) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .sov-modal-inner .sov-ta::placeholder,
html[data-theme="light"] .sov-modal-inner textarea.sov-modal-field::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

html[data-theme="light"] .sov-card-evidence {
  color: var(--muted);
  border-top-color: var(--line) !important;
}

html[data-theme="light"] .sov-card-evidence-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html[data-theme="light"] .sov-card-evidence-link:hover {
  color: #2563eb;
}

html[data-theme="light"] .sov-column-head-row {
  border-bottom-color: var(--line);
}

html[data-theme="light"] .sov-column-head-title {
  color: var(--text);
}

html[data-theme="light"] .sov-column-delete {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
}

html[data-theme="light"] .sov-column-delete:hover {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(254, 242, 242, 0.98);
}

html[data-theme="light"] .sov-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .sov-card:hover {
  background: rgba(239, 246, 255, 0.98);
  border-color: rgba(37, 99, 235, 0.28);
}

html[data-theme="light"] .sov-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

html[data-theme="light"] .sov-card-badge {
  color: #0369a1;
}

html[data-theme="light"] .sov-column-add-card.sov-btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

html[data-theme="light"] .sov-column-add-card.sov-btn-ghost:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.95);
  color: var(--text);
}

html[data-theme="light"] .sov-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .sov-empty-title {
  color: var(--text);
}

html[data-theme="light"] .sov-empty-lead {
  color: var(--muted);
}

html[data-theme="light"] .sov-board-loading {
  color: var(--muted);
}

html[data-theme="light"] .sov-table-wrap {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.96));
  border-color: var(--line);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .sov-table--data thead th {
  background: linear-gradient(180deg, #e8eef9, #dce6f5);
  color: var(--text);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .sov-table--data tbody td {
  border-bottom-color: rgba(30, 64, 120, 0.08);
  color: var(--text);
}

html[data-theme="light"] .sov-table--data tbody tr:nth-child(even) {
  background: rgba(241, 245, 255, 0.55);
}

html[data-theme="light"] .sov-table--data tbody tr:hover {
  background: rgba(219, 234, 254, 0.45);
}

html[data-theme="light"] .sov-table--data tbody td.sov-td-server {
  color: var(--text);
  border-right-color: var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98) 85%, rgba(255, 255, 255, 0));
}

html[data-theme="light"] .sov-table--data tbody tr:nth-child(even) td.sov-td-server {
  background: linear-gradient(90deg, rgba(248, 250, 255, 0.98) 85%, rgba(248, 250, 255, 0));
}

html[data-theme="light"] .sov-table--data tbody tr:hover td.sov-td-server {
  background: linear-gradient(90deg, rgba(224, 242, 254, 0.98) 85%, rgba(224, 242, 254, 0));
}

html[data-theme="light"] .sov-table--data .sov-inp,
html[data-theme="light"] .sov-table--data .sov-ta,
html[data-theme="light"] .sov-table--data .sov-status {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .sov-table--data .sov-inp:hover,
html[data-theme="light"] .sov-table--data .sov-ta:hover,
html[data-theme="light"] .sov-table--data .sov-status:hover {
  background: rgba(248, 250, 255, 1);
  border-color: rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .sov-table--data .sov-inp:focus,
html[data-theme="light"] .sov-table--data .sov-ta:focus,
html[data-theme="light"] .sov-table--data .sov-status:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .sov-table--data .sov-status {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="light"] .sov-table--data .sov-status--stable {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

html[data-theme="light"] .sov-table--data .sov-status--attention {
  border-color: rgba(2, 132, 199, 0.45);
  background: rgba(224, 242, 254, 0.95);
  color: #0369a1;
}

html[data-theme="light"] .sov-table--data .sov-status--critical {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(254, 242, 242, 0.95);
  color: #b91c1c;
}

html[data-theme="light"] .sov-modal h2 {
  color: var(--text) !important;
}

html[data-theme="light"] .sov-btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .sov-btn-ghost:hover {
  background: rgba(241, 245, 255, 1);
  color: var(--text);
}

html[data-theme="light"] .sov-field input {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .sov-modal-close:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .sov-modal .sov-table th,
html[data-theme="light"] .sov-defaults-scroll .sov-table th {
  background: linear-gradient(180deg, #eef2ff, #e2e8f0);
  color: var(--text);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .sov-modal .sov-table td,
html[data-theme="light"] .sov-defaults-scroll .sov-table td {
  color: var(--text);
  border-bottom-color: rgba(30, 64, 120, 0.1);
}

html[data-theme="light"] .sov-modal .sov-td-server,
html[data-theme="light"] .sov-defaults-scroll .sov-td-server {
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .sov-modal .sov-inp,
html[data-theme="light"] .sov-defaults-scroll .sov-inp {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .sov-empty,
html[data-theme="light"] .sov-empty--muted {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
}

html[data-theme="light"] .sov-empty-title {
  color: var(--text) !important;
}

html[data-theme="light"] .sov-modal,
html[data-theme="light"] .sov-defaults-scroll {
  background: linear-gradient(165deg, #ffffff, #f4f7fd);
  border-color: var(--line);
}

/* ——— Конфликтники (cf-) ——— */
html[data-theme="light"] .cf-deadline-trigger {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 255, 0.98));
  border-color: var(--line);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

html[data-theme="light"] .cf-deadline-trigger-icon {
  background: rgba(224, 242, 254, 0.95);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0369a1;
}

html[data-theme="light"] .cf-deadline-popover {
  background: linear-gradient(165deg, #ffffff, #f1f5ff);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .cf-cal-title {
  color: var(--text);
}

html[data-theme="light"] .cf-cal-nav {
  background: rgba(224, 242, 254, 0.9);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

html[data-theme="light"] .cf-cal-nav:hover {
  background: rgba(186, 230, 253, 1);
}

html[data-theme="light"] .cf-cal-day {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: rgba(30, 64, 120, 0.08);
}

html[data-theme="light"] .cf-cal-day.is-today:not(.is-selected) {
  color: #0369a1;
}

html[data-theme="light"] .cf-cal-day.is-selected {
  color: #fff;
}

/* Фильтр по дате в тулбаре (.tete-dp-*) — в тон поиску */
html[data-theme="light"] .tete-dp-trigger {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(30, 64, 120, 0.12);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] .tete-dp-trigger:hover {
  border-color: rgba(30, 64, 120, 0.18);
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .tete-dp-trigger.is-open {
  border-color: rgba(30, 64, 120, 0.22);
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .tete-dp-trigger.is-placeholder .tete-dp-display {
  color: var(--muted);
}

html[data-theme="light"] .tete-dp-icon {
  background: rgba(241, 245, 255, 0.9);
  border-color: rgba(30, 64, 120, 0.1);
  color: var(--muted);
}

html[data-theme="light"] .tete-dp-trigger:hover .tete-dp-icon,
html[data-theme="light"] .tete-dp-trigger.is-open .tete-dp-icon {
  border-color: rgba(30, 64, 120, 0.14);
  color: var(--text);
}

html[data-theme="light"] .tete-dp-popover {
  background: linear-gradient(165deg, #ffffff, #f1f5ff);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .tete-dp-cal-title {
  color: var(--text);
}

html[data-theme="light"] .tete-dp-cal-nav {
  background: rgba(224, 242, 254, 0.9);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

html[data-theme="light"] .tete-dp-cal-nav:hover {
  background: rgba(186, 230, 253, 1);
}

html[data-theme="light"] .tete-dp-cal-day {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: rgba(30, 64, 120, 0.08);
}

html[data-theme="light"] .tete-dp-cal-day.is-today:not(.is-selected) {
  color: #0369a1;
}

html[data-theme="light"] .tete-dp-cal-day.is-selected {
  color: #fff;
}

html[data-theme="light"] .tete-dp-foot {
  border-top-color: var(--line);
}

html[data-theme="light"] .tete-dp-clear {
  color: var(--muted);
}

html[data-theme="light"] .tete-dp-today {
  color: #0369a1;
}

html[data-theme="light"] .tete-dp-today:hover {
  color: #0c4a6e;
}

/* Скроллбары — светлая тема (Firefox + WebKit) */
html[data-theme="light"] .crm-app {
  scrollbar-color: rgba(100, 116, 148, 0.55) rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] .crm-app *::-webkit-scrollbar-track {
  background: rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .crm-app *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.55), rgba(100, 116, 139, 0.65));
  border: 2px solid rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .crm-app *::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.45);
}

html[data-theme="light"] .crm-app *::-webkit-scrollbar-corner {
  background: rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] .tasks-chat-messages {
  scrollbar-color: rgba(100, 116, 148, 0.55) rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-track {
  background: rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.55), rgba(100, 116, 139, 0.65));
  border: 2px solid rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .tasks-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.45);
}

html[data-theme="light"] body.ac-page {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 148, 0.55) rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] body.ac-page::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html[data-theme="light"] body.ac-page::-webkit-scrollbar-track {
  background: rgba(226, 232, 245, 0.95);
  border-radius: 8px;
}

html[data-theme="light"] body.ac-page::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.55), rgba(100, 116, 139, 0.65));
  border-radius: 8px;
  border: 2px solid rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] body.ac-page::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.45);
}

html[data-theme="light"] body.ac-page::-webkit-scrollbar-corner {
  background: rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] .sov-shell,
html[data-theme="light"] .sov-modal,
html[data-theme="light"] .sov-defaults-scroll,
html[data-theme="light"] .sov-table-wrap {
  scrollbar-color: rgba(100, 116, 148, 0.55) rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] .sov-shell::-webkit-scrollbar-track,
html[data-theme="light"] .sov-modal::-webkit-scrollbar-track,
html[data-theme="light"] .sov-defaults-scroll::-webkit-scrollbar-track,
html[data-theme="light"] .sov-table-wrap::-webkit-scrollbar-track {
  background: rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .sov-shell::-webkit-scrollbar-thumb,
html[data-theme="light"] .sov-modal::-webkit-scrollbar-thumb,
html[data-theme="light"] .sov-defaults-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .sov-table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.55), rgba(100, 116, 139, 0.65));
  border: 2px solid rgba(226, 232, 245, 0.95);
}

html[data-theme="light"] .sov-shell::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .sov-modal::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .sov-defaults-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .sov-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.45);
}

html[data-theme="light"] .sov-shell::-webkit-scrollbar-corner,
html[data-theme="light"] .sov-modal::-webkit-scrollbar-corner,
html[data-theme="light"] .sov-defaults-scroll::-webkit-scrollbar-corner,
html[data-theme="light"] .sov-table-wrap::-webkit-scrollbar-corner {
  background: rgba(237, 242, 252, 0.98);
}

html[data-theme="light"] body.ac-wait-dept-page .ac-mesh {
  background:
    radial-gradient(ellipse 100% 80% at 10% -10%, rgba(255, 77, 46, 0.1), transparent 50%),
    radial-gradient(ellipse 80% 60% at 90% 10%, rgba(34, 211, 238, 0.12), transparent 45%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(168, 85, 247, 0.08), transparent 40%),
    linear-gradient(185deg, rgba(255, 255, 255, 0.55) 0%, rgba(226, 232, 246, 0.45) 45%, rgba(212, 224, 245, 0.65) 100%);
}

html[data-theme="light"] body.ac-wait-dept-page .ac-grid-noise {
  opacity: 0.26;
  mix-blend-mode: multiply;
}

html[data-theme="light"] body.ac-wait-dept-page .ac-btn {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--ac-line);
  color: var(--ac-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

html[data-theme="light"] body.ac-wait-dept-page .ac-btn:hover {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.ac-wait-dept-page .ac-login-err {
  color: #b91c1c;
}
