
/* =============================================
   LIGHT THEME — Auditara (default / :root)
   ============================================= */
:root {
  color-scheme: light;
  /* Surfaces */
  --bg:       #f1f5f9;
  --card:     #ffffff;
  --surface:  #f8fafc;
  --surface-2:#f1f5f9;
  /* Text */
  --fg:     #1e293b;
  --fg-2:   #0f172a;
  --muted:  #64748b;
  --muted-2:#94a3b8;
  --muted-3:#7c8fa6;
  --muted-4:#8e9eb5;
  --muted-5:#e2e8f0;
  /* Brand */
  --brand:    #6366f1;
  --brand-2:  #4f46e5;
  --brand-bg: #eef2ff;
  --tab-active-label: #1e1b4b;
  --tpl-card-bg:           var(--card);
  --tpl-card-border:       var(--border-2);
  --tpl-cat-bg:            rgba(99,102,241,.12);
  --tpl-cat-color:         var(--brand-2);
  --tpl-tag-bg:            var(--surface);
  --tpl-tag-color:         var(--text);
  --tpl-btn-hover:         rgba(99,102,241,.2);
  --tpl-btn-danger-bg:     rgba(239,68,68,.1);
  --tpl-btn-danger-color:  #dc2626;
  --tpl-btn-danger-hover:  rgba(239,68,68,.2);
  /* Border */
  --border:   #e2e8f0;
  --border-2: #cbd5e1;
  /* Warning */
  --warning-bg:     #fffbeb;
  --warning-border: #fcd34d;
  --warning-text:   #92400e;
  /* Shadow */
  --shadow-sm:      0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 8px 24px rgba(0,0,0,.10);
  --shadow-lg:      0 24px 60px rgba(0,0,0,.13);
  --shadow-overlay: rgba(15,23,42,.45);
  /* Status colors */
  --c-pending-bg:  #fffbeb;  --c-pending:  #d97706;
  --c-info-bg:     #fef2f2;  --c-info:     #dc2626;
  --c-uploaded-bg: #eff6ff;  --c-uploaded: #2563eb;
  --c-review-bg:   #f5f3ff;  --c-review:   #7c3aed;
  --c-accepted-bg: #f0fdf4;  --c-accepted: #16a34a;
  --c-rejected-bg: #fef2f2;  --c-rejected: #dc2626;
  --c-orange-bg:   #fff7ed;  --c-orange:   #ea580c;
  --c-red-bg:      #fef2f2;  --c-red:      #dc2626;
  /* Progress */
  --progress-bg: #e2e8f0;
  /* UI tokens */
  --ui-bg:       #f1f5f9;
  --ui-surface:  #ffffff;
  --ui-text:     #1e293b;
  --ui-muted:    #64748b;
  --ui-primary:  #6366f1;
  --ui-border:   rgba(0,0,0,.08);
  --ui-shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --ui-shadow-lg:0 12px 30px rgba(0,0,0,.1);
  /* Table */
  --tbl-border:      #e2e8f0;
  --tbl-border-head: #c7d2fe;
  --tbl-bg-head:     #eef2ff;
  --tbl-color-head:  #4f46e5;
  --tbl-bg-row:      #ffffff;
  --tbl-bg-row-alt:  #f8fafc;
  --tbl-bg-hover:    #f1f5f9;
  --tbl-color-row:   #1e293b;
  --tbl-color-muted: #64748b;
  --tbl-shadow:      0 4px 16px rgba(0,0,0,.06);
  /* DATEV table */
  --datev-border:      #e2e8f0;
  --datev-border-head: #c7d2fe;
  --datev-bg-head:     #eef2ff;
  --datev-color-head:  #4f46e5;
  --datev-bg-row:      #ffffff;
  --datev-bg-row-alt:  #f8fafc;
  --datev-bg-hover:    #f1f5f9;
  --datev-color-row:   #1e293b;
}

/* =============================================
   DARK THEME — Auditara
   Переключается через data-theme="dark" на <html>
   ============================================= */

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

  /* Surfaces */
  --bg:       #0f1117;
  --card:     #1a1d27;
  --surface:  #1e2130;
  --surface-2:#252838;

  /* Text */
  --fg:     #e2e8f0;
  --fg-2:   #f1f5f9;
  --muted:  #94a3b8;
  --muted-2:#64748b;
  --muted-3:#7c8fa6;
  --muted-4:#8e9eb5;
  --muted-5:#334155;

  /* Brand */
  --brand:    #6366f1;
  --brand-2:  #818cf8;
  --brand-bg: #1e1b4b;
  --tab-active-label: #fff;
  --tpl-card-bg:           #1e2235;
  --tpl-card-border:       rgba(255,255,255,.08);
  --tpl-cat-bg:            rgba(99,102,241,.15);
  --tpl-cat-color:         #818cf8;
  --tpl-tag-bg:            rgba(255,255,255,.05);
  --tpl-tag-color:         #e2e8f0;
  --tpl-btn-hover:         rgba(99,102,241,.28);
  --tpl-btn-danger-bg:     rgba(239,68,68,.12);
  --tpl-btn-danger-color:  #f87171;
  --tpl-btn-danger-hover:  rgba(239,68,68,.25);

  /* Border */
  --border:   #2d3148;
  --border-2: #323654;
  /* Warning */
  --warning-bg:     #2d2500;
  --warning-border: #854d0e;
  --warning-text:   #fde68a;

  /* Shadow */
  --shadow-sm:      0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:      0 24px 60px rgba(0,0,0,.5);
  --shadow-overlay: rgba(0,0,0,.7);

  /* Status colors — чуть приглушённее для тёмного фона */
  --c-pending-bg:  #2d2008;  --c-pending:  #fbbf24;
  --c-info-bg:     #2d0a0a;  --c-info:     #f87171;
  --c-uploaded-bg: #0a1628;  --c-uploaded: #60a5fa;
  --c-review-bg:   #1a0f3d;  --c-review:   #a78bfa;
  --c-accepted-bg: #052e16;  --c-accepted: #4ade80;
  --c-rejected-bg: #2d0a0a;  --c-rejected: #f87171;
  --c-orange-bg:   #2d1200;  --c-orange:   #fb923c;
  --c-red-bg:      #2d0a0a;  --c-red:      #f87171;

  /* Progress */
  --progress-bg: #2d3148;

  /* UI tokens */
  --ui-bg:       #0f1117;
  --ui-surface:  #1a1d27;
  --ui-text:     #e2e8f0;
  --ui-muted:    #94a3b8;
  --ui-primary:  #6366f1;
  --ui-border:   rgba(255,255,255,.07);
  --ui-shadow-sm:0 1px 2px rgba(0,0,0,.3);
  --ui-shadow-lg:0 12px 30px rgba(0,0,0,.4);

  /* Table */
  --tbl-border:      #2d3148;
  --tbl-border-head: #3d3f6e;
  --tbl-bg-head:     #1e1b4b;
  --tbl-color-head:  #818cf8;
  --tbl-bg-row:      #1a1d27;
  --tbl-bg-row-alt:  #1e2130;
  --tbl-bg-hover:    #252838;
  --tbl-color-row:   #e2e8f0;
  --tbl-color-muted: #94a3b8;
  --tbl-shadow:      0 4px 16px rgba(0,0,0,.3);

  /* DATEV table */
  --datev-border:      #2d3148;
  --datev-border-head: #3d3f6e;
  --datev-bg-head:     #1e1b4b;
  --datev-color-head:  #818cf8;
  --datev-bg-row:      #1a1d27;
  --datev-bg-row-alt:  #1e2130;
  --datev-bg-hover:    #252838;
  --datev-color-row:   #e2e8f0;
}

/* ---- Общие переопределения для тёмной темы ---- */

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--fg);
}

[data-theme="dark"] .card,
[data-theme="dark"] .surface,
[data-theme="dark"] .section-card,
[data-theme="dark"] .security-card,
[data-theme="dark"] .nav-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

[data-theme="dark"] .nav-card.is-active {
  background: #1e1b4b !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #252838 !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted) !important;
}

[data-theme="dark"] .form-label {
  color: var(--fg-2) !important;
}

/* Модальные окна */
[data-theme="dark"] .ds-modal,
[data-theme="dark"] .ds-modal-overlay {
  background: rgba(0,0,0,.7) !important;
}

[data-theme="dark"] .ds-modal {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

/* Dropdown */
[data-theme="dark"] .ds-dropdown {
  background: var(--card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .ds-dropdown-item {
  color: var(--fg) !important;
}

[data-theme="dark"] .ds-dropdown-item:hover {
  background: var(--surface-2) !important;
}

/* Таблицы */
[data-theme="dark"] .ds-list-head {
  background: var(--tbl-bg-head) !important;
  border-color: var(--tbl-border-head) !important;
  color: var(--tbl-color-head) !important;
}

[data-theme="dark"] .ds-row {
  background: var(--tbl-bg-row) !important;
  border-color: var(--tbl-border) !important;
  color: var(--tbl-color-row) !important;
}

[data-theme="dark"] .ds-row:hover {
  background: var(--tbl-bg-hover) !important;
}

[data-theme="dark"] .ds-row-cell {
  color: var(--tbl-color-muted) !important;
}

/* Тулбар фильтров */
[data-theme="dark"] .ds-toolbar {
  background: var(--card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .ds-filter-btn {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--muted-4) !important;
}

[data-theme="dark"] .ds-filter-btn.active {
  background: var(--brand-bg) !important;
  color: var(--brand-2) !important;
  border-color: var(--brand) !important;
}

/* Поиск */
[data-theme="dark"] .ds-search {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .ds-search input {
  background: transparent !important;
  color: var(--fg) !important;
}

/* Чат */
[data-theme="dark"] .dok-chat-messages {
  background: var(--surface) !important;
}

[data-theme="dark"] .dok-msg-staff {
  background: #1e1b4b !important;
  color: var(--fg) !important;
}

[data-theme="dark"] .dok-msg-client {
  background: var(--surface-2) !important;
  color: var(--fg) !important;
}

/* Header */
[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #243060 0%, #1a2448 100%) !important;
  border-bottom-color: var(--border) !important;
}

/* Левая панель навигации дашборда */
[data-theme="dark"] .dash-left {
  border-right-color: var(--border) !important;
}

/* Toast */
[data-theme="dark"] .ds-toast {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

/* Статистика */
[data-theme="dark"] .ds-stats .ds-stat-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
}

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--surface);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}

/* Левая навигация — заголовки карточек */
[data-theme="dark"] .nav-title {
  color: var(--fg) !important;
}
[data-theme="dark"] .nav-desc {
  color: var(--muted) !important;
}
[data-theme="dark"] .nav-card .nav-title {
  color: #e2e8f0 !important;
}
/* Welcome секция */
[data-theme="dark"] .dash-welcome,
[data-theme="dark"] .welcome-section {
  background: linear-gradient(135deg, #1e2130, #252838) !important;
  color: var(--fg) !important;
}
/* Stat cards */
[data-theme="dark"] .dok-counter,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .overview-stat {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

/* Разделители */
[data-theme="dark"] hr,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom {
  border-color: var(--border) !important;
}

/* Текстовые мутированные */
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary {
  color: var(--muted) !important;
}

/* Кнопка переключения темы */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  font-size: 1rem;
}

.theme-toggle:hover {
  background: var(--surface-2);
  transform: rotate(20deg);
}

/* ---- Nav cards ---- */
[data-theme="dark"] .nav-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .nav-card:hover {
  background: var(--surface-2) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.3) !important;
}
[data-theme="dark"] .nav-card.is-active {
  background: linear-gradient(180deg, #1e1b4b, #1a1840) !important;
}
[data-theme="dark"] .nav-card .nav-title {
  color: var(--fg) !important;
}
[data-theme="dark"] .nav-card .nav-desc {
  color: var(--muted) !important;
}
[data-theme="dark"] .nav-card .nav-icon {
  color: var(--brand-2) !important;
}
[data-theme="dark"] .dashboard .nav-card {
  background: var(--card) !important;
}

/* ---- Filter buttons ---- */
[data-theme="dark"] .ds-filter-btn {
  background: var(--surface) !important;
  border-color: var(--border-2) !important;
  color: var(--muted-4) !important;
}
[data-theme="dark"] .ds-filter-btn:hover,
[data-theme="dark"] .ds-filter-btn.active {
  background: var(--brand-bg) !important;
  border-color: var(--brand-2) !important;
  color: var(--brand-2) !important;
}

/* ---- Search ---- */
[data-theme="dark"] .ds-search {
  background: var(--surface) !important;
  border-color: var(--border-2) !important;
}
[data-theme="dark"] .ds-search input {
  color: var(--fg) !important;
  background: transparent !important;
}
[data-theme="dark"] .ds-search i {
  color: var(--muted) !important;
}

/* ---- Chip ---- */
[data-theme="dark"] .chip {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--fg) !important;
}

/* ---- Site header ---- */
[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #243060 0%, #1a2448 100%) !important;
  border-bottom-color: #2d3148 !important;
}

/* ---- Nav cards (dashboard.css hardcoded #ffffff) ---- */
[data-theme="dark"] .nav-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .nav-card:hover {
  background: #252838 !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .dash-left .nav-card.active {
  background: #1e1b4b !important;
  border-color: #6366f1 !important;
}
[data-theme="dark"] .nav-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .nav-desc {
  color: #94a3b8 !important;
}
[data-theme="dark"] .nav-icon {
  color: #818cf8 !important;
}
[data-theme="dark"] .nav-chevron {
  color: #64748b !important;
}

/* ---- Filter buttons (hardcoded в custom.css) ---- */
[data-theme="dark"] .ds-filter-btn {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .ds-filter-btn:hover,
[data-theme="dark"] .ds-filter-btn.active {
  background: #1e1b4b !important;
  border-color: #6366f1 !important;
  color: #818cf8 !important;
}

/* ---- Search ---- */
[data-theme="dark"] .ds-search {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .ds-search input {
  background: transparent !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .ds-search i {
  color: #64748b !important;
}

/* ---- dashboard.css hardcoded backgrounds ---- */
[data-theme="dark"] .dash-right .surface,
[data-theme="dark"] .dash-right .card,
[data-theme="dark"] .dash-right .widget {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .hero,
[data-theme="dark"] .surface.hero {
  background: linear-gradient(180deg, #1a1d2e 0%, #13151f 100%) !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .hero-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .hero-sub {
  color: #94a3b8 !important;
}
[data-theme="dark"] .overview-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- dokumente.css ---- */
[data-theme="dark"] .dok-badge-cancelled,
[data-theme="dark"] .dok-icon-cancelled,
[data-theme="dark"] .ds-badge-closed {
  background: #252838 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .dok-chat-msg.system .dok-chat-bubble,
[data-theme="dark"] .ds-chat-msg.system .ds-chat-bubble {
  background: #1e2130 !important;
  color: #64748b !important;
}
[data-theme="dark"] .dok-chat-file-btn:hover {
  background: #252838 !important;
}
[data-theme="dark"] .ds-chat-textarea {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .ds-modal-body,
[data-theme="dark"] .ds-panel {
  background: #1a1d27 !important;
}

/* ---- overview.css ---- */
[data-theme="dark"] .overview-section,
[data-theme="dark"] .overview-block {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- security.css ---- */
[data-theme="dark"] .security-card,
[data-theme="dark"] .security-section,
[data-theme="dark"] .security-block {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- einstellungen.css ---- */
[data-theme="dark"] .settings-card,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .einst-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- custom.css ---- */
[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #243060 0%, #1a2448 100%) !important;
  border-bottom-color: #2d3148 !important;
}
[data-theme="dark"] .chip {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .strip-section,
[data-theme="dark"] .strip__item {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .trust {
  background: linear-gradient(180deg, #1a1d27, #161923) !important;
}
[data-theme="dark"] .faq details {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .meter {
  background: #2d3148 !important;
}

/* ---- register.css ---- */
[data-theme="dark"] #documents_btn,
[data-theme="dark"] #registration-card label#documents_btn.btn,
[data-theme="dark"] label#documents_btn.btn {
  background-color: #1e2130 !important;
  color: #818cf8 !important;
  border-color: #6366f1 !important;
}
[data-theme="dark"] #documents_btn:hover {
  background-color: #252838 !important;
  color: #a5b4fc !important;
}

/* ---- profil.css ---- */
[data-theme="dark"] .profil-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .modal {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- einstellungen.css ---- */
[data-theme="dark"] .einst-card,
[data-theme="dark"] .settings-block,
[data-theme="dark"] .pref-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- auth страницы (login, forgot password, reset) ---- */
[data-theme="dark"] .auth-card,
[data-theme="dark"] .auth-box,
[data-theme="dark"] .login-card,
[data-theme="dark"] .register-card,
[data-theme="dark"] .auth-form-wrap {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .auth-card label,
[data-theme="dark"] .login-card label {
  color: #94a3b8 !important;
}

/* ---- compliance.css ---- */
[data-theme="dark"] .rc-tier-badge.t1 {
  background: #252838 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .rc-table tr:hover td {
  background: #252838 !important;
}
[data-theme="dark"] .rc-table td,
[data-theme="dark"] .rc-table th {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .rc-integrity,
[data-theme="dark"] .rc-integrity.check,
[data-theme="dark"] .rc-sealed-menu {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .rc-sealed-menu-item:hover {
  background: #252838 !important;
}
[data-theme="dark"] .rc-card,
[data-theme="dark"] [style*="card-bg"] {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .rc-tier-badge[style*="fefce8"],
[data-theme="dark"] .rc-tier-badge[style*="f0fdf4"],
[data-theme="dark"] .rc-tier-badge[style*="fff7ed"],
[data-theme="dark"] .rc-tier-badge[style*="fef2f2"] {
  background: #252838 !important;
  border-color: #3d3f6e !important;
}

/* ---- employee_profile.css ---- */
[data-theme="dark"] .ep-card,
[data-theme="dark"] .ep-section,
[data-theme="dark"] .ep-block,
[data-theme="dark"] .ep-edit-field .form-control {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .ep-edit-field .form-control:disabled {
  background: #252838 !important;
  color: #64748b !important;
}
[data-theme="dark"] .wt-table tbody tr:hover {
  background: #252838 !important;
}
[data-theme="dark"] .wt-table,
[data-theme="dark"] .wt-row {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}

/* ---- team.css / team_table.css ---- */
[data-theme="dark"] .team-card,
[data-theme="dark"] .team-block,
[data-theme="dark"] .team-member {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-table-scroll::-webkit-scrollbar-track,
[data-theme="dark"] .team-table-top-scroll::-webkit-scrollbar-track {
  background: #1e2130 !important;
}
[data-theme="dark"] .team-search {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- header-mobile.css ---- */
[data-theme="dark"] .mobile-drawer,
[data-theme="dark"] .mobile-menu {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}

/* ---- PWA banner (base.html inline) ---- */
[data-theme="dark"] #pwa-push-banner {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #pwa-push-dismiss {
  background: #252838 !important;
  color: #94a3b8 !important;
}

/* ---- overview_advisor.html inline styles ---- */
[data-theme="dark"] .overview-advisor-card,
[data-theme="dark"] [class*="overview"] > div[style*="background:#fff"] {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}

/* ---- session timeout modal (base.html inline) ---- */
[data-theme="dark"] #session-warning-modal > div,
[data-theme="dark"] #trial-modal > div,
[data-theme="dark"] #expired-modal > div {
  background: #1a1d27 !important;
  color: #e2e8f0 !important;
}

/* ---- Nav icon circles ---- */
[data-theme="dark"] .nav-icon {
  background: radial-gradient(circle at 30% 20%, #2d2f5e, #1e1b4b) !important;
  box-shadow: 0 8px 20px rgba(99,102,241,0.25) !important;
  color: #818cf8 !important;
}
[data-theme="dark"] .nav-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .nav-desc {
  color: #94a3b8 !important;
}
[data-theme="dark"] .nav-chevron {
  color: #64748b !important;
}

/* ---- security-card (custom.css hardcoded) ---- */
[data-theme="dark"] .security-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .security-card:hover {
  box-shadow: 0 14px 34px rgba(0,0,0,0.4) !important;
}
[data-theme="dark"] .sec-icon {
  background: radial-gradient(circle at 30% 20%, #2d2f5e, #1e1b4b) !important;
  box-shadow: 0 10px 20px rgba(99,102,241,0.25) !important;
}
[data-theme="dark"] .sec-icon i {
  color: #818cf8 !important;
}
[data-theme="dark"] .session-card-icon {
  background: radial-gradient(circle at 30% 20%, #2d2f5e, #1e1b4b) !important;
}
[data-theme="dark"] .session-card-icon i {
  color: #818cf8 !important;
}
[data-theme="dark"] .sec-eyebrow {
  color: #64748b !important;
}
[data-theme="dark"] .sec-card-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .sec-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .sec-subtitle {
  color: #94a3b8 !important;
}
[data-theme="dark"] .sec-text {
  color: #94a3b8 !important;
}

/* ---- overview-icon / team-card (hardcoded gradient) ---- */
[data-theme="dark"] .overview-icon,
[data-theme="dark"] .team-card-header .overview-icon {
  background: radial-gradient(circle at 30% 20%, #2d2f5e, #1e1b4b) !important;
  box-shadow: 0 10px 20px rgba(99,102,241,0.25) !important;
}
[data-theme="dark"] .overview-icon i,
[data-theme="dark"] .team-card-header .overview-icon i {
  color: #818cf8 !important;
}
[data-theme="dark"] .team-card-eyebrow {
  color: #64748b !important;
}
[data-theme="dark"] .team-card-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-card-description,
[data-theme="dark"] .team-metric-label {
  color: #94a3b8 !important;
}
[data-theme="dark"] .team-metric-value {
  color: #e2e8f0 !important;
}

/* ---- einst-icon / einst-card ---- */
[data-theme="dark"] .einst-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .einst-icon {
  background: radial-gradient(circle at 30% 20%, #2d2f5e, #1e1b4b) !important;
  box-shadow: 0 10px 20px rgba(99,102,241,0.25) !important;
}
[data-theme="dark"] .einst-icon i {
  color: #818cf8 !important;
}
[data-theme="dark"] .einst-eyebrow {
  color: #64748b !important;
}
[data-theme="dark"] .einst-card-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .einst-text {
  color: #94a3b8 !important;
}

/* ---- mf-btn (mandanten filters, no CSS file) ---- */
[data-theme="dark"] .mf-btn {
  background: #1e2130 !important;
  border: 1.5px solid #2d3148 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .mf-btn:hover,
[data-theme="dark"] .mf-btn--active {
  background: #1e1b4b !important;
  border-color: #6366f1 !important;
  color: #818cf8 !important;
}

/* ---- mandanten search ---- */
[data-theme="dark"] #mandanten-search {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #mandanten-search::placeholder {
  color: #64748b !important;
}

/* ---- country/staff filter selects ---- */
[data-theme="dark"] #filter-country,
[data-theme="dark"] #filter-staff {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}

/* ---- overview-card (overview.css hardcoded) ---- */
[data-theme="dark"] .overview-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .overview-card:hover {
  box-shadow: 0 14px 34px rgba(0,0,0,0.4) !important;
}
[data-theme="dark"] .overview-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .overview-subtitle {
  color: #94a3b8 !important;
}
[data-theme="dark"] .overview-card-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .overview-eyebrow {
  color: #64748b !important;
}
[data-theme="dark"] .overview-text,
[data-theme="dark"] .overview-desc {
  color: #94a3b8 !important;
}

/* ---- team-card (team.css hardcoded) ---- */
[data-theme="dark"] .team-card,
[data-theme="dark"] .team-card--full {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}

/* ---- team_table.css hardcoded borders ---- */
[data-theme="dark"] .team-table thead th:not(:last-child),
[data-theme="dark"] .team-table tbody td:not(:last-child) {
  border-right-color: #2d3148 !important;
}
[data-theme="dark"] .team-table tbody td {
  border-bottom-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-table thead th {
  border-bottom-color: #3d3f6e !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .team-table {
  box-shadow: 0 0 0 1px #2d3148 inset !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-search {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-search:focus {
  border-color: #6366f1 !important;
}
[data-theme="dark"] .no-records {
  color: #64748b !important;
}

/* ---- team_table mobile rows (hardcoded #fff, #fafbff) ---- */
[data-theme="dark"] .team-table tbody tr {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .team-table tbody tr td.col-sticky-left {
  background: #1a1d27 !important;
  border-bottom-color: #2d3148 !important;
}
[data-theme="dark"] .team-table tbody tr td.col-sticky-left::after {
  color: #64748b !important;
}
[data-theme="dark"] .team-table tbody tr.mob-expanded td:not(.col-sticky-left):not(.col-sticky-right) {
  background: #1e2130 !important;
  border-bottom-color: #2d3148 !important;
}
[data-theme="dark"] .team-table tbody tr.mob-expanded td:not(.col-sticky-left):not(.col-sticky-right)::before {
  color: #64748b !important;
}
[data-theme="dark"] .team-table tbody tr.mob-expanded td.col-sticky-right {
  background: #1a1d27 !important;
  border-top-color: #2d3148 !important;
}

/* ---- dokumente светлые артефакты ---- */
[data-theme="dark"] .ds-list-wrap,
[data-theme="dark"] .ds-section,
[data-theme="dark"] .ds-panel,
[data-theme="dark"] .ds-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .ds-row {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .ds-row:nth-child(even) {
  background: #1e2130 !important;
}
[data-theme="dark"] .ds-row:hover {
  background: #252838 !important;
}
[data-theme="dark"] .ds-cell,
[data-theme="dark"] .ds-row-cell {
  color: #e2e8f0 !important;
  border-color: #2d3148 !important;
}

/* ---- team_table.css :root variables override ---- */
[data-theme="dark"] {
  --datev-border:      #2d3148 !important;
  --datev-border-head: #3d3f6e !important;
  --datev-bg-head:     #1e1b4b !important;
  --datev-color-head:  #818cf8 !important;
  --datev-bg-row:      #1a1d27 !important;
  --datev-bg-row-alt:  #1e2130 !important;
  --datev-bg-hover:    #252838 !important;
  --datev-color-row:   #e2e8f0 !important;
}

/* ---- team_table sticky columns hardcoded ---- */
[data-theme="dark"] thead .col-sticky-left,
[data-theme="dark"] thead .col-sticky-right {
  background: #1e1b4b !important;
}
[data-theme="dark"] .team-row:hover .col-sticky-left,
[data-theme="dark"] .team-row:hover .col-sticky-right,
[data-theme="dark"] .team-table tbody tr:nth-child(even):hover .col-sticky-left,
[data-theme="dark"] .team-table tbody tr:nth-child(even):hover .col-sticky-right {
  background: #252838 !important;
}
[data-theme="dark"] .team-name {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .team-email {
  color: #94a3b8 !important;
}

/* ---- table thead hardcoded backgrounds ---- */
[data-theme="dark"] .team-table thead th {
  background: #1e1b4b !important;
  color: #818cf8 !important;
  border-color: #3d3f6e !important;
}
[data-theme="dark"] thead .col-sticky-left,
[data-theme="dark"] thead .col-sticky-right {
  background: #1e1b4b !important;
}

/* ---- btn-outline в теле страницы (не в header) ---- */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] a.btn-outline,
[data-theme="dark"] button.btn-outline {
  background: transparent !important;
  border-color: #6366f1 !important;
  color: #818cf8 !important;
}
[data-theme="dark"] .btn-outline:hover {
  background: #1e1b4b !important;
}

/* ---- dokumente modal chat (hardcoded) ---- */
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-messages {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-msg.staff .dok-chat-bubble,
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-msg.advisor .dok-chat-bubble {
  background: rgba(99,102,241,.2) !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-msg.client .dok-chat-bubble {
  color: #a7f3d0 !important;
}
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-input {
  border-color: #2d3148 !important;
  background: #1e2130 !important;
}
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-textarea {
  color: #e2e8f0 !important;
}
[data-theme="dark"] #dok-ticket-modal-body .dok-chat-actions {
  background: #1a1d27 !important;
  border-top-color: #2d3148 !important;
}
[data-theme="dark"] .dok-client-add-file-btn {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #94a3b8 !important;
}

/* ---- ds-btn-sm danger (light background) ---- */
[data-theme="dark"] .ds-btn-sm.danger {
  background: rgba(220,38,38,.15) !important;
  border-color: rgba(220,38,38,.3) !important;
  color: #f87171 !important;
}
[data-theme="dark"] .ds-btn-sm.danger:hover {
  background: rgba(220,38,38,.25) !important;
}

/* ---- ds-row артефакты — строки без фона ---- */
[data-theme="dark"] .ds-row {
  background: #1a1d27 !important;
  border-bottom-color: #2d3148 !important;
}
[data-theme="dark"] .ds-row-title {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .ds-row-desc {
  color: #94a3b8 !important;
}

/* ---- ds-ticket-num, ds-badge hardcoded ---- */
[data-theme="dark"] .ds-ticket-num {
  background: transparent !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .ds-badge-under_review {
  background: #2d1f5e !important;
  color: #a78bfa !important;
}
[data-theme="dark"] .ds-badge-closed {
  background: #252838 !important;
  color: #94a3b8 !important;
}

/* ---- steuerkalender.css dark theme ---- */
[data-theme="dark"] .sk-badge-overdue {
  background: rgba(185,28,28,.2) !important;
  color: #f87171 !important;
}
[data-theme="dark"] .sk-badge-soon {
  background: rgba(133,77,14,.2) !important;
  color: #fbbf24 !important;
}
[data-theme="dark"] .sk-table td {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .sk-toggle-slider {
  background: #2d3148 !important;
}
[data-theme="dark"] .sk-toggle-slider:before {
  background: #94a3b8 !important;
}

/* ---- steuerkalender category badge colors ---- */
[data-theme="dark"] {
  --sk-cat-ust-bg: #0a1628; --sk-cat-ust-fg: #60a5fa;
  --sk-cat-lst-bg: #1e0a3d; --sk-cat-lst-fg: #c084fc;
  --sk-cat-soz-bg: #052e16; --sk-cat-soz-fg: #4ade80;
  --sk-cat-est-bg: #2d1200; --sk-cat-est-fg: #fb923c;
  --sk-cat-kst-bg: #2d0a0a; --sk-cat-kst-fg: #f87171;
  --sk-cat-gwb-bg: #2d2000; --sk-cat-gwb-fg: #fbbf24;
  --sk-cat-son-bg: #1e2130; --sk-cat-son-fg: #94a3b8;
}

/* ---- team badges hardcoded ---- */
[data-theme="dark"] .badge-active {
  background: #052e16 !important;
  color: #4ade80 !important;
  border-color: rgba(74,222,128,.2) !important;
}
[data-theme="dark"] .badge-inactive {
  background: #2d2000 !important;
  color: #fbbf24 !important;
}
[data-theme="dark"] .badge-blocked {
  background: #1e2130 !important;
  color: #94a3b8 !important;
}

/* ---- compliance.css hardcoded colors ---- */
[data-theme="dark"] .rc-tier-badge.t1 {
  background: #1e2130 !important;
  color: #94a3b8 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .rc-tier-badge.t2 {
  background: #0a1628 !important;
  color: #60a5fa !important;
  border-color: #1e3a5f !important;
}
[data-theme="dark"] .rc-tier-badge.t3 {
  background: #1e0a3d !important;
  color: #c084fc !important;
  border-color: #3b1f6e !important;
}
[data-theme="dark"] .rc-worm-badge {
  background: #052e16 !important;
  color: #4ade80 !important;
  border-color: rgba(74,222,128,.2) !important;
}
[data-theme="dark"] .rc-btn:hover {
  background: #1e1b4b !important;
}
[data-theme="dark"] .rc-btn.success:hover {
  background: #052e16 !important;
}
[data-theme="dark"] .rc-btn.purple:hover {
  background: #1e0a3d !important;
}
[data-theme="dark"] .rc-integrity,
[data-theme="dark"] .rc-integrity.check {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .rc-sealed-pkg {
  background: linear-gradient(135deg, #1e0a3d 0%, #0a1628 100%) !important;
}
[data-theme="dark"] .rc-sealed-header {
  background: #1a1d27 !important;
  border-color: #3b1f6e !important;
}
[data-theme="dark"] .rc-activity-chart-card {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] .rc-activity-chart-title i {
  color: #818cf8 !important;
}

/* ---- compliance chart canvas background ---- */
[data-theme="dark"] .rc-activity-chart-wrap canvas,
[data-theme="dark"] #rc-tc-chart,
[data-theme="dark"] #rc-activity-chart {
  background: #1a1d27 !important;
  border-radius: 8px;
}

/* ---- compliance icon classes dark theme ---- */
[data-theme="dark"] .rc-icon-red    { background: #2d0a0a !important; color: #f87171 !important; }
[data-theme="dark"] .rc-icon-orange { background: #2d1200 !important; color: #fb923c !important; }
[data-theme="dark"] .rc-icon-green  { background: #052e16 !important; color: #4ade80 !important; }
[data-theme="dark"] .rc-icon-green2 { background: #052e16 !important; color: #34d399 !important; }
[data-theme="dark"] .rc-icon-blue   { background: #0a1628 !important; color: #818cf8 !important; }
[data-theme="dark"] .rc-icon-blue2  { background: #0a1e2d !important; color: #38bdf8 !important; }
[data-theme="dark"] .rc-icon-indigo { background: #1e1b4b !important; color: #818cf8 !important; }
[data-theme="dark"] .rc-header-icon { background: #1e1b4b !important; color: #818cf8 !important; }

[data-theme="dark"] .dok-chat-msg.staff .dok-chat-bubble,
[data-theme="dark"] .ds-chat-msg.staff .ds-chat-bubble {
  background: rgba(99,102,241,.25) !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .dok-chat-msg.client .dok-chat-bubble,
[data-theme="dark"] .ds-chat-msg.client .ds-chat-bubble {
  background: rgba(34,197,94,.25) !important;
  color: #a7f3d0 !important;
}
[data-theme="dark"] .dok-chat-msg.system .dok-chat-bubble,
[data-theme="dark"] .ds-chat-msg.system .ds-chat-bubble {
  background: #1e2130 !important;
  color: #64748b !important;
}
[data-theme="dark"] .dok-chat-file-attach {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .dok-chat-file-attach span,
[data-theme="dark"] .dok-chat-file-attach .dok-chat-file-name {
  color: #e2e8f0 !important;
}

/* Force dark header */
html[data-theme="dark"] header.site-header,
html[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #243060 0%, #1a2448 100%) !important;
}

/* === Compliance audit filters dark fix === */
[data-theme="dark"] .rc-date-wrap,
[data-theme="dark"] .rc-fi,
[data-theme="dark"] label.rc-date-wrap {
  background: #252838 !important;
  border-color: #323654 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .rc-audit-notice {
  background: #2d1f00 !important;
  border-color: #854d0e !important;
  color: #fde68a !important;
}

[data-theme="dark"] input[type="text"].rc-fi {
  background: #252838 !important;
  border-color: #323654 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] input[type="text"].rc-fi::placeholder {
  color: #64748b !important;
}
  /* Warning */
  --warning-bg:     #fffbeb;
  --warning-border: #fde68a;
  --warning-text:   #92400e;
