/* ==============================================
   DARK THEME - тёмная тема для всего приложения
   Применяется через класс .dark-theme на <body>
   ============================================== */

/* ── Общее ── */
body.dark-theme {
    background: #181818;
    color: #e1e1e1;
    --card-bg: #212121;
    --input-bg: #181818;
    --text-primary: #e1e1e1;
    --text-secondary: #94a3b8;
}

/* ── Шапка (header) ── */
body.dark-theme .header {
    background: rgba(24, 24, 24, 0.95);
    color: #e1e1e1;
    border-color: #3a3a3a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark-theme .header-subtitle {
    color: #aaaaaa;
}

body.dark-theme .header-title {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── User-info (шапка, все страницы) ── */
body.dark-theme .user-info {
    background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%) !important;
    box-shadow: 0 4px 12px rgba(55, 48, 163, 0.4) !important;
}
body.dark-theme .user-info:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    transform: translateY(-2px);
}
body.dark-theme .user-info.active {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
}
body.dark-theme .user-avatar {
    background: rgba(255, 255, 255, 0.15) !important;
}
body.dark-theme .user-name {
    color: #e2e8f0 !important;
}

/* ── Карточки (main.css) ── */
body.dark-theme .card {
    background: rgba(24, 24, 24, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-color: #3a3a3a;
}

body.dark-theme .card-header {
    border-bottom-color: #3a3a3a;
}

body.dark-theme .card-title {
    color: #e1e1e1;
}

body.dark-theme .card-body {
    color: #cccccc;
}

/* ── Карточки статуса (.status-card / .status-item) ── */
body.dark-theme .status-card {
    background: linear-gradient(135deg, #0f2028 0%, #0d2018 100%) !important;
    border-color: #1e4a30 !important;
}

body.dark-theme .status-icon {
    background: #212121 !important;
}

body.dark-theme .status-text {
    color: #86efac !important;
}

body.dark-theme .status-value {
    color: #4ade80 !important;
}

/* ── Информационные блоки (.info-box) ── */
body.dark-theme .info-box {
    background: linear-gradient(135deg, #0c1a2e 0%, #0f2041 100%) !important;
    border-color: #1e3a5f !important;
}

body.dark-theme .info-box-title,
body.dark-theme .info-box-icon {
    color: #93c5fd !important;
}

body.dark-theme .info-box-content {
    color: #bfdbfe !important;
}

body.dark-theme .info-item {
    color: #93c5fd !important;
}

body.dark-theme .info-item code {
    background: #212121 !important;
    color: #818cf8 !important;
    border-color: #3a3a3a !important;
}

/* ── Сайдбар ── */
body.dark-theme .sidebar-drawer {
    background: #181818;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
}

body.dark-theme .sidebar-nav::-webkit-scrollbar-thumb {
    background: #555555;
}

body.dark-theme .sidebar-nav-item {
    color: #cccccc;
}

body.dark-theme .sidebar-nav-item:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #1a1b3a 100%);
    color: #818cf8;
}

body.dark-theme .sidebar-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-theme .sidebar-nav-item.active:hover {
    color: white;
}

body.dark-theme.sidebar-collapsed .sidebar-nav-item::after {
    background: #e1e1e1;
    color: #181818;
}

/* ── Рассылка в Kaspi чат (/kaspi-chat/) ── */
body.dark-theme .kchat-stat,
body.dark-theme .kchat-card,
body.dark-theme .kchat-savebar,
body.dark-theme .kchat-datebar {
    background: #212121;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

body.dark-theme .kchat-datebar-label {
    color: #94a3b8;
}

/* input[type="text"].kchat-date-input (не просто .kchat-date-input) - иначе
   проигрывает по специфичности общему body.dark-theme input[type="text"]
   (см. "Формы" выше в этом файле): у него !important и на элемент, и на
   атрибут разом, значит и переопределять его нужно селектором не менее
   специфичным - иначе не только цвета, но и background-image (иконка
   календаря, у shorthand background своего в общем правиле нет, поэтому
   без явного переопределения она пропадает) откатываются к тому правилу. */
body.dark-theme input[type="text"].kchat-date-input {
    background-color: #181818 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 10px center !important;
    background-size: 14px 14px !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
    color-scheme: dark;
}

body.dark-theme input[type="text"].kchat-date-input:hover {
    background-color: #1f1f1f !important;
    border-color: #4a4a4a !important;
}

body.dark-theme input[type="text"].kchat-date-input:focus {
    border-color: #6366f1 !important;
    background-color: #1f1f1f !important;
}

body.dark-theme .kchat-stat-val,
body.dark-theme .kchat-card-title,
body.dark-theme .kchat-log-order,
body.dark-theme .kchat-phone-name {
    color: #e1e1e1;
}

body.dark-theme .kchat-stat-lbl,
body.dark-theme .kchat-card-when,
body.dark-theme .kchat-note,
body.dark-theme .kchat-log-text {
    color: #94a3b8;
}

body.dark-theme .kchat-card-head {
    border-bottom-color: #3a3a3a;
}

/* Пастельные плашки иконок в тёмной теме слепят - гасим до глубоких тонов */
body.dark-theme .kchat-stat-violet .kchat-stat-ico,
body.dark-theme .kchat-ico-violet  { background: linear-gradient(135deg, #2e1065, #4c1d95) !important; }
body.dark-theme .kchat-stat-blue   .kchat-stat-ico,
body.dark-theme .kchat-card-ico,
body.dark-theme .kchat-log-ico     { background: linear-gradient(135deg, #172554, #1e3a8a); }
body.dark-theme .kchat-stat-green  .kchat-stat-ico,
body.dark-theme .kchat-done .kchat-card-ico,
body.dark-theme .kchat-log-done .kchat-log-ico { background: linear-gradient(135deg, #052e16, #14532d); }
body.dark-theme .kchat-stat-red    .kchat-stat-ico,
body.dark-theme .kchat-cancelled   .kchat-card-ico,
body.dark-theme .kchat-log-cancelled .kchat-log-ico { background: linear-gradient(135deg, #450a0a, #7f1d1d); }
body.dark-theme .kchat-stat-amber  .kchat-stat-ico,
body.dark-theme .kchat-ico-amber   { background: linear-gradient(135deg, #451a03, #78350f) !important; }
body.dark-theme .kchat-ico-slate   { background: linear-gradient(135deg, #1f2937, #374151) !important; }

body.dark-theme .kchat-text,
body.dark-theme .kchat-pause input,
body.dark-theme .kchat-test-row input,
body.dark-theme .kchat-test-row select {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .kchat-text:focus,
body.dark-theme .kchat-pause input:focus,
body.dark-theme .kchat-test-row input:focus,
body.dark-theme .kchat-test-row select:focus {
    border-color: #6366f1 !important;
    background: #212121 !important;
}

body.dark-theme .kchat-chip {
    background: #1e1b4b;
    border-color: #3730a3;
    color: #a5b4fc;
}

body.dark-theme .kchat-chip:hover:not(:disabled) {
    background: #312e81;
    border-color: #4338ca;
}

body.dark-theme .kchat-badge {
    background: #1e1b4b;
    color: #a5b4fc;
}

body.dark-theme .kchat-phone {
    background: #181818;
    border-color: #3a3a3a;
}

body.dark-theme .kchat-phone-bar {
    background: #212121;
    border-bottom-color: #3a3a3a;
}

body.dark-theme .kchat-phone-avatar {
    background: #3a3a3a;
}

body.dark-theme .kchat-slider {
    background: #4a4a4a;
}

body.dark-theme .kchat-btn-ghost {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e1e1e1;
}

body.dark-theme .kchat-btn-ghost:hover:not(:disabled) {
    background: #333333;
}

body.dark-theme .kchat-warn {
    background: rgba(120, 53, 15, 0.28);
    border-color: #78350f;
    color: #fcd34d;
}

body.dark-theme .kchat-log-item {
    border-bottom-color: #2e2e2e;
}

body.dark-theme .kchat-empty-title {
    color: #cbd5e1;
}

body.dark-theme .kchat-log::-webkit-scrollbar-thumb {
    background: #555555;
}

/* ── Текст ── */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #e1e1e1;
}

body.dark-theme .subtitle,
body.dark-theme .text-muted {
    color: #aaaaaa;
}

/* ── Формы ── */
body.dark-theme input[type="text"],
body.dark-theme input[type="password"],
body.dark-theme input[type="email"],
body.dark-theme input[type="number"],
body.dark-theme input[type="search"],
body.dark-theme select,
body.dark-theme textarea {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="password"]:focus,
body.dark-theme input[type="email"]:focus,
body.dark-theme input[type="number"]:focus,
body.dark-theme input[type="search"]:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    border-color: #818cf8 !important;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #777777 !important;
}

body.dark-theme select option {
    background: #212121;
    color: #e1e1e1;
}

/* ── Таблицы ── */
body.dark-theme table {
    background: rgba(24, 24, 24, 0.95);
}

body.dark-theme th {
    background: #212121;
    color: #aaaaaa;
    border-color: #3a3a3a;
}

body.dark-theme td {
    border-color: #3a3a3a;
    color: #cccccc;
}

body.dark-theme tr:hover td {
    background: rgba(33, 33, 33, 0.8);
}

body.dark-theme tbody tr:nth-child(even) {
    background: rgba(24, 24, 24, 0.5);
}

/* ── Разделители ── */
body.dark-theme hr,
body.dark-theme .divider {
    border-color: #3a3a3a;
}

/* ── Кнопки ── */
body.dark-theme .btn-secondary,
body.dark-theme .btn-outline {
    background: #212121;
    border-color: #555555;
    color: #e1e1e1;
}

body.dark-theme .btn-secondary:hover,
body.dark-theme .btn-outline:hover {
    background: #3a3a3a;
    border-color: #777777;
}

/* ── Модальные окна ── */
body.dark-theme .modal-content,
body.dark-theme .modal-card,
body.dark-theme #hdrModalCard {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .modal-header {
    border-bottom-color: #3a3a3a;
}

body.dark-theme .modal-footer {
    border-top-color: #3a3a3a;
}

/* ── Страница настроек ── */
body.dark-theme .settings-container {
    background: transparent;
}

body.dark-theme .setting-card {
    background: rgba(24, 24, 24, 0.95) !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .setting-header {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .setting-title {
    color: #e1e1e1 !important;
}

body.dark-theme .setting-description {
    color: #aaaaaa !important;
}

/* ── Тогл-контейнер ── */
body.dark-theme .toggle-container {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .toggle-label {
    color: #e1e1e1 !important;
}

body.dark-theme .toggle-hint {
    color: #aaaaaa !important;
}

/* ── VDS/VPS блоки ── */
body.dark-theme .vds-uptime-bar {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .vds-uptime-label {
    color: #aaaaaa !important;
}

body.dark-theme .vds-uptime-value {
    color: #e1e1e1 !important;
}

body.dark-theme .vds-metric-card {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .vds-metric-card:hover {
    border-color: #818cf8 !important;
}

body.dark-theme .vds-metric-title {
    color: #e1e1e1 !important;
}

body.dark-theme .vds-metric-details {
    color: #aaaaaa !important;
}

body.dark-theme .vds-progress-bar {
    background: #3a3a3a !important;
}

body.dark-theme .vds-progress-label {
    color: #e1e1e1 !important;
}

body.dark-theme .vds-network-bar {
    background: linear-gradient(135deg, #0c1a2e 0%, #0f2041 100%) !important;
    border-color: #1e3a5f !important;
}

body.dark-theme .vds-network-label,
body.dark-theme .vds-network-value {
    color: #93c5fd !important;
}

body.dark-theme .vds-controls {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .vds-collector-label {
    color: #aaaaaa !important;
}

body.dark-theme .vds-collector-running {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%) !important;
    color: #86efac !important;
}

body.dark-theme .vds-collector-stopped {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%) !important;
    color: #fca5a5 !important;
}

body.dark-theme .vds-btn-secondary {
    background: linear-gradient(135deg, #212121 0%, #3a3a3a 100%) !important;
    color: #e1e1e1 !important;
    border-color: #555555 !important;
}

body.dark-theme .vds-btn-secondary:hover {
    border-color: #777777 !important;
}

body.dark-theme .vds-error {
    background: linear-gradient(135deg, #1c0a0a 0%, #2d0f0f 100%) !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

body.dark-theme .vds-loading {
    color: #aaaaaa !important;
}

body.dark-theme .vds-loading-spinner {
    border-color: #3a3a3a !important;
    border-top-color: #818cf8 !important;
}

/* ── Таблица аккаунтов (inline styles override) ── */
/* Обёртка таблицы аккаунтов */
body.dark-theme .accounts-table-wrapper {
    border-color: #3a3a3a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme #accountsTable {
    background: #1a1a1a !important;
}

body.dark-theme #accountsTable tbody tr {
    border-bottom-color: #2a2a2a !important;
    background: #1a1a1a !important;
    color: #cccccc !important;
}

body.dark-theme #accountsTable tbody tr:hover {
    background: #242424 !important;
}

body.dark-theme #accountsTable td {
    color: #cccccc !important;
}

body.dark-theme .acc-name {
    color: #e1e1e1 !important;
}

body.dark-theme .acc-added-by,
body.dark-theme .acc-date {
    color: #666666 !important;
}

body.dark-theme .acc-no-perm {
    color: #555555 !important;
}

/* Badges ролей */
body.dark-theme .acc-role-admin {
    background: rgba(109, 40, 217, 0.25) !important;
    color: #c4b5fd !important;
}

body.dark-theme .acc-role-sub {
    background: rgba(3, 105, 161, 0.25) !important;
    color: #7dd3fc !important;
}

body.dark-theme .acc-role-default {
    background: rgba(80, 80, 80, 0.35) !important;
    color: #aaaaaa !important;
}

/* Badges разрешений (perm-badge) */
body.dark-theme .perm-edit {
    background: rgba(22, 101, 52, 0.35) !important;
    color: #86efac !important;
}

body.dark-theme .perm-view {
    background: rgba(30, 64, 175, 0.3) !important;
    color: #93c5fd !important;
}

body.dark-theme .perm-none {
    background: rgba(80, 80, 80, 0.3) !important;
    color: #777777 !important;
}

/* perm-dot (секции с правами в таблице аккаунтов) */
body.dark-theme .perm-dot-edit {
    background: rgba(22, 101, 52, 0.3) !important;
    color: #6ee7b7 !important;
}

body.dark-theme .perm-dot-view {
    background: rgba(30, 64, 175, 0.25) !important;
    color: #93c5fd !important;
}

/* Кнопки действий */
body.dark-theme .acc-btn-perms {
    background: rgba(55, 48, 163, 0.3) !important;
    color: #a5b4fc !important;
}

body.dark-theme .acc-btn-pass {
    background: rgba(120, 53, 15, 0.3) !important;
    color: #fcd34d !important;
}

body.dark-theme .acc-btn-delete {
    background: rgba(153, 27, 27, 0.3) !important;
    color: #fca5a5 !important;
}

/* ── Поле ввода пароля (.my-pass-input) ── */
body.dark-theme .my-pass-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .my-pass-input:focus {
    border-color: #818cf8 !important;
    background: #212121 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
}

body.dark-theme .my-pass-field label {
    color: #aaaaaa !important;
}

body.dark-theme .my-pass-eye {
    color: #777777 !important;
}

body.dark-theme .my-pass-eye:hover {
    color: #818cf8 !important;
}

/* ── Карточки курсов валют (.rate-card) - inline-style override ── */
body.dark-theme .rate-card {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .rate-card * {
    color: #e1e1e1 !important;
}

/* ── Блок последнего обновления (.last-update-container) - inline-style override ── */
body.dark-theme .last-update-container {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%) !important;
    border-color: #166534 !important;
}

body.dark-theme .last-update-container * {
    color: #86efac !important;
}

/* ── auto-refresh badge ── */
body.dark-theme .auto-refresh {
    background: #212121 !important;
    color: #aaaaaa !important;
}

/* ── Страница редактора (ag-grid) ── */
body.dark-theme .ag-theme-alpine,
body.dark-theme .ag-root-wrapper {
    background: #181818 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .ag-header {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .ag-header-cell {
    color: #aaaaaa !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .ag-row {
    background: #181818 !important;
    border-color: #212121 !important;
    color: #cccccc !important;
}

body.dark-theme .ag-row-odd {
    background: #0d1526 !important;
}

body.dark-theme .ag-row:hover,
body.dark-theme .ag-row-hover {
    background: #212121 !important;
}

body.dark-theme .ag-row-selected {
    background: rgba(102, 126, 234, 0.2) !important;
}

body.dark-theme .ag-cell {
    border-color: #212121 !important;
}

body.dark-theme .ag-input-field-input {
    background: #212121 !important;
    color: #e1e1e1 !important;
    border-color: #555555 !important;
}

body.dark-theme .ag-popup-editor {
    background: #212121 !important;
    border-color: #555555 !important;
}

body.dark-theme .ag-side-bar {
    background: #181818 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .ag-paging-panel {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}

/* ── Бейджи / теги ── */
body.dark-theme .badge,
body.dark-theme .tag {
    background: #212121;
    color: #aaaaaa;
    border-color: #3a3a3a;
}

/* ── Прогресс-бары ── */
body.dark-theme .progress-track {
    background: #3a3a3a;
}

/* ── Уведомления ── */
body.dark-theme .alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark-theme .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

body.dark-theme .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

body.dark-theme .alert-danger,
body.dark-theme .error {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

/* ── Панель пользователя (user menu) ── */
body.dark-theme #userMenuContent {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme #userMenuContent > div:first-child {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme #userMenuContent > div:first-child > div:first-child {
    color: #e1e1e1 !important;
}

body.dark-theme #userMenuContent > div:first-child > div:last-child {
    color: #aaaaaa !important;
}

body.dark-theme #userMenuContent a,
body.dark-theme #userMenuContent button,
body.dark-theme .user-menu-item {
    color: #cccccc !important;
    background: none !important;
}

body.dark-theme #userMenuContent a:hover,
body.dark-theme #userMenuContent button:hover,
body.dark-theme .user-menu-item:hover {
    background: rgba(102, 126, 234, 0.12) !important;
    color: #e1e1e1 !important;
}

body.dark-theme .user-menu-header {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .user-menu-username {
    color: #e1e1e1 !important;
}

body.dark-theme .user-menu-role {
    color: #aaaaaa !important;
}

body.dark-theme .user-menu-divider,
body.dark-theme #userMenuContent > div:last-child > div[style*="height: 2px"] {
    background: #3a3a3a !important;
}

/* Модалка смены пароля */
body.dark-theme #hdrModalCard {
    background: #212121 !important;
}

body.dark-theme #hdrModalCard input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme #hdrModalCard label,
body.dark-theme #hdrModalCard p,
body.dark-theme #hdrModalCard span:not(.eye-btn) {
    color: #cccccc !important;
}

/* ── Страница логина ── */
body.dark-theme .login-container {
    background: rgba(24, 24, 24, 0.95);
    border: 1px solid #3a3a3a;
}

body.dark-theme .login-container h1 {
    color: #e1e1e1;
}

body.dark-theme .login-container .subtitle {
    color: #aaaaaa;
}

body.dark-theme .login-container .form-group label {
    color: #cccccc;
}

/* ── Скроллбар ── */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #181818;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #777777;
}

/* ── Переключатель темы ── */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 2px solid #e1e1e1;
    background: transparent;
    color: #212121;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

body.dark-theme .theme-toggle-btn {
    border-color: #555555;
    color: #e1e1e1;
}

.theme-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #667eea;
}

body.dark-theme .theme-toggle-btn:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: #818cf8;
    color: #818cf8;
}

/* ── Inline-style progress bar в модалке обновления ── */
body.dark-theme div[style*="background:#e2e8f0"][style*="height:6px"],
body.dark-theme div[style*="background: #e2e8f0"][style*="height: 6px"] {
    background: #3a3a3a !important;
}

/* ── acc-modal-header (уже colorful, ok) ── */

/* ── Прочие inline-style блоки в settings.html ── */

/* Блок "Последнее обновление" у автообновления min_price */
body.dark-theme [style*="#f0fdf4"] {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%) !important;
    border-color: #166534 !important;
}

body.dark-theme [style*="#dcfce7"] {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%) !important;
}

/* Блок с синим фоном */
body.dark-theme [style*="#dbeafe"],
body.dark-theme [style*="#bfdbfe"],
body.dark-theme [style*="#eff6ff"] {
    background: linear-gradient(135deg, #0c1a2e 0%, #0f2041 100%) !important;
    border-color: #1e3a5f !important;
}

/* Жёлтый блок */
body.dark-theme [style*="#fef3c7"],
body.dark-theme [style*="#fde68a"] {
    background: linear-gradient(135deg, #1a1200 0%, #291e00 100%) !important;
    border-color: #3d2e00 !important;
}

/* Фиолетовый блок */
body.dark-theme [style*="#ede9fe"],
body.dark-theme [style*="#ddd6fe"],
body.dark-theme [style*="#f5f3ff"],
body.dark-theme [style*="#fdf4ff"] {
    background: linear-gradient(135deg, #1a0a2e 0%, #240f3d 100%) !important;
    border-color: #3b1f5e !important;
}

/* Оранжевый/кремовый блок (напр. иконка "Настройки" на дашборде) */
body.dark-theme [style*="#fff7ed"] {
    background: linear-gradient(135deg, #2e1a0a 0%, #3d240f 100%) !important;
    border-color: #5e3b1f !important;
}

/* Зелёный блок */
body.dark-theme [style*="#ecfdf5"],
body.dark-theme [style*="#d1fae5"] {
    background: linear-gradient(135deg, #052e16 0%, #0f3320 100%) !important;
    border-color: #166534 !important;
}

/* ── Все inline-style тексты с тёмными цветами ── */
body.dark-theme [style*="color: #1e293b"],
body.dark-theme [style*="color:#1e293b"] {
    color: #e1e1e1 !important;
}

body.dark-theme [style*="color: #64748b"],
body.dark-theme [style*="color:#64748b"] {
    color: #aaaaaa !important;
}

body.dark-theme [style*="color: #065f46"],
body.dark-theme [style*="color:#065f46"] {
    color: #6ee7b7 !important;
}

body.dark-theme [style*="color: #047857"],
body.dark-theme [style*="color:#047857"] {
    color: #4ade80 !important;
}

body.dark-theme [style*="color: #6b7280"],
body.dark-theme [style*="color:#6b7280"] {
    color: #aaaaaa !important;
}

/* Разделители в inline-style */
body.dark-theme [style*="background: #e2e8f0"],
body.dark-theme [style*="background:#e2e8f0"] {
    background: #3a3a3a !important;
}

body.dark-theme [style*="background: #f1f5f9"],
body.dark-theme [style*="background:#f1f5f9"] {
    background: #212121 !important;
}

body.dark-theme [style*="background: #f8fafc"],
body.dark-theme [style*="background:#f8fafc"] {
    background: #181818 !important;
}

/* ── Inline border colors ── */
body.dark-theme [style*="border: 2px solid #86efac"],
body.dark-theme [style*="border: 2px solid #e2e8f0"] {
    border-color: #3a3a3a !important;
}

/* ── Глобальный контейнер миниатюрных окон ── */
body.dark-theme .global-minimized-container {
    background: transparent;
}

body.dark-theme .global-minimized-window {
    background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(129, 140, 248, 0.25) !important;
}

body.dark-theme .global-minimized-window:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(129, 140, 248, 0.4) !important;
}

body.dark-theme .global-minimized-title {
    color: #e1e1e1 !important;
}

body.dark-theme .global-minimized-subtitle {
    color: rgba(225, 225, 225, 0.75) !important;
}

body.dark-theme .global-minimized-close {
    color: rgba(225, 225, 225, 0.7) !important;
}

body.dark-theme .global-minimized-close:hover {
    color: #e1e1e1 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
}

/* ── Локальное (старое) миниатюрное окно внутри модалок ── */
body.dark-theme .modal-minimized-window {
    background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(129, 140, 248, 0.25) !important;
}

body.dark-theme .modal-minimized-window:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .modal-minimized-title {
    color: #e1e1e1 !important;
}

body.dark-theme .modal-minimized-subtitle {
    color: rgba(225, 225, 225, 0.75) !important;
}

body.dark-theme .modal-minimized-close {
    color: rgba(225, 225, 225, 0.8) !important;
}

/* ── Модальные окна аккаунтов (.acc-modal-*) ── */
body.dark-theme .acc-modal {
    background: #212121 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .acc-modal-body {
    background: #212121 !important;
}

body.dark-theme .acc-field label {
    color: #aaaaaa !important;
}

body.dark-theme .acc-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .acc-input:focus {
    border-color: #818cf8 !important;
    background: #212121 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
}

body.dark-theme .acc-input::placeholder {
    color: #555555 !important;
}

body.dark-theme .acc-divider {
    background: #3a3a3a !important;
}

body.dark-theme .acc-section-label {
    color: #aaaaaa !important;
}

body.dark-theme .acc-section-label::after {
    background: #3a3a3a !important;
}

body.dark-theme .acc-perms-grid .acc-perm-row {
    background: #181818 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .acc-perm-row:hover {
    background: #212121 !important;
    border-color: #4f46e5 !important;
}

body.dark-theme .acc-perm-title {
    color: #cccccc !important;
}

body.dark-theme .acc-perm-url {
    color: #777777 !important;
}

body.dark-theme .acc-toggle-label {
    color: #777777 !important;
}

body.dark-theme .acc-toggle-slider {
    background: #3a3a3a !important;
}

body.dark-theme .acc-toggle-slider::before {
    background: #aaaaaa !important;
}

body.dark-theme .acc-toggle input:checked + .acc-toggle-slider {
    background: #667eea !important;
}

body.dark-theme .acc-toggle.edit-toggle input:checked + .acc-toggle-slider {
    background: #10b981 !important;
}

body.dark-theme .acc-toggle input:checked + .acc-toggle-slider::before {
    background: #fff !important;
}

body.dark-theme .acc-modal-footer {
    background: #181818 !important;
    border-top-color: #3a3a3a !important;
}

body.dark-theme .acc-btn-cancel {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}

body.dark-theme .acc-btn-cancel:hover {
    border-color: #777777 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .acc-pass-eye {
    color: #777777 !important;
}

body.dark-theme .acc-pass-eye:hover {
    color: #818cf8 !important;
}

/* Тело модала "Удалить" и "CNY" - внутренние элементы с белым фоном */
body.dark-theme .acc-modal [style*="background: white"],
body.dark-theme .acc-modal [style*="background:white"],
body.dark-theme .acc-modal [style*="background: #fff"],
body.dark-theme .acc-modal [style*="background:#fff"] {
    background: #212121 !important;
}

body.dark-theme .acc-modal [style*="color: #1e293b"],
body.dark-theme .acc-modal [style*="color:#1e293b"],
body.dark-theme .acc-modal [style*="color: #334155"],
body.dark-theme .acc-modal [style*="color:#334155"] {
    color: #e1e1e1 !important;
}

body.dark-theme .acc-modal [style*="color: #64748b"],
body.dark-theme .acc-modal [style*="color:#64748b"],
body.dark-theme .acc-modal [style*="color: #94a3b8"],
body.dark-theme .acc-modal [style*="color:#94a3b8"] {
    color: #aaaaaa !important;
}

/* Inline div разделителей внутри модалов */
body.dark-theme .acc-modal [style*="background: #f1f5f9"],
body.dark-theme .acc-modal [style*="background:#f1f5f9"],
body.dark-theme .acc-modal [style*="background: #f8fafc"],
body.dark-theme .acc-modal [style*="background:#f8fafc"] {
    background: #3a3a3a !important;
}

/* ── Дружественные магазины / Telegram элементы ── */
body.dark-theme .merchant-item {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .merchant-item:hover {
    border-color: #555555 !important;
}

body.dark-theme .merchant-name {
    color: #e1e1e1 !important;
}

body.dark-theme .merchant-id {
    color: #aaaaaa !important;
}

body.dark-theme .merchant-strategy-select {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

/* ── Форма добавления (магазины/telegram) ── */
body.dark-theme .friendly-merchants-form {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .friendly-merchants-form-title {
    color: #e1e1e1 !important;
}

body.dark-theme .form-field-label {
    color: #aaaaaa !important;
}

body.dark-theme .form-field-input {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .form-field-select {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .friendly-merchants-form label {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .friendly-merchants-form label span {
    color: #e1e1e1 !important;
}

/* ── Модал загрузки обновления ── */
body.dark-theme #updateModal .acc-modal-body > div:first-child {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme #updateModal .acc-modal-body > div:first-child > div {
    border-right-color: #3a3a3a !important;
}
body.dark-theme #updateModal .acc-modal-body > div:first-child > div > div:first-child {
    background: #1e3a5f !important;
    color: #93c5fd !important;
}
body.dark-theme #updateModal .acc-modal-body > div:first-child > div > div:last-child {
    color: #aaaaaa !important;
}
body.dark-theme #updateFileLabel {
    background: #1a2436 !important;
    border-color: #3d5a8a !important;
}
body.dark-theme #updateFileLabel:hover {
    background: #1e2d45 !important;
    border-color: #5b8dd9 !important;
}
body.dark-theme #updateFileLabel.has-file {
    background: #0f2a1e !important;
    border-color: #10b981 !important;
}
body.dark-theme #updateFileText {
    color: #93c5fd !important;
}
body.dark-theme #updateError {
    background: #2d1515 !important;
    border-color: #7f1d1d !important;
}
body.dark-theme #updateProgressLabel {
    color: #aaaaaa !important;
}
body.dark-theme #updateProgress > div:last-child {
    background: #2a2a2a !important;
}

/* ── Китайский новый год - блок дней ── */
body.dark-theme .cny-days-container {
    background: linear-gradient(135deg, #1a0800 0%, #291200 100%) !important;
    border-color: #7c2d12 !important;
}

body.dark-theme .cny-days-label span:first-child {
    color: #fb923c !important;
}

body.dark-theme .cny-days-hint {
    color: #f97316 !important;
}

body.dark-theme .cny-days-btn {
    background: #212121 !important;
    border-color: #7c2d12 !important;
    color: #fb923c !important;
}

body.dark-theme .cny-days-input {
    background: #212121 !important;
    border-color: #7c2d12 !important;
    color: #fb923c !important;
}

/* ══════════════════════════════════════════════════════════════
   КУРСЫ ВАЛЮТ И ДОСТАВКА - Kaspi Delivery тарифы
   ══════════════════════════════════════════════════════════════ */

/* НДС строка */
body.dark-theme .kd-vat-row {
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: #0369a1 !important;
}
body.dark-theme .kd-vat-label { color: #7dd3fc !important; }
body.dark-theme .kd-vat-pct  { color: #7dd3fc !important; }
body.dark-theme .kd-vat-badge {
    background: rgba(14, 165, 233, 0.15) !important;
    color: #7dd3fc !important;
}
body.dark-theme .kd-vat-input {
    background: #181818 !important;
    border-color: #0369a1 !important;
    color: #7dd3fc !important;
}

/* Блок "до 10 000 ₸" */
body.dark-theme .kd-tier-block--small {
    border-color: #78350f !important;
}
body.dark-theme .kd-tier-header--small {
    background: linear-gradient(135deg, #1c1000 0%, #261500 100%) !important;
    border-bottom-color: #78350f !important;
}
body.dark-theme .kd-tier-badge--small {
    background: rgba(217, 119, 6, 0.25) !important;
    color: #fbbf24 !important;
}

/* Блок "10 000 ₸ и более" */
body.dark-theme .kd-tier-block--large {
    border-color: #065f46 !important;
}
body.dark-theme .kd-tier-header--large {
    background: linear-gradient(135deg, #011c10 0%, #022515 100%) !important;
    border-bottom-color: #065f46 !important;
}
body.dark-theme .kd-tier-badge--large {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

/* Общий заголовок тира */
body.dark-theme .kd-tier-title { color: #cccccc !important; }

/* Заголовки колонок */
body.dark-theme .kd-col-headers { color: #666666 !important; }
body.dark-theme .kd-col-headers > div { color: #666666 !important; }

/* Строки тарифной сетки */
body.dark-theme .kd-tier-body { background: #1a1a1a !important; }
body.dark-theme .kd-tier-row  {
    background: #1e1e1e !important;
}

/* Все инпуты таблицы */
body.dark-theme .kd-input--minmax {
    background: #141414 !important;
    border-color: #3a3a3a !important;
    color: #cccccc !important;
}
body.dark-theme .kd-input--rate-small {
    background: rgba(180, 100, 0, 0.12) !important;
    border-color: #78350f !important;
    color: #fbbf24 !important;
}
body.dark-theme .kd-input--rate-large {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: #065f46 !important;
    color: #34d399 !important;
}

/* Налог, комиссия, стоимость доставки - инпуты */
body.dark-theme .kd-default-input {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #cccccc !important;
}
body.dark-theme .kd-pct-text    { color: #888888 !important; }
body.dark-theme .kd-delivery-label { color: #aaaaaa !important; }

/* Кнопка «Сбросить к умолчаниям» */
body.dark-theme .kd-reset-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}
body.dark-theme .kd-reset-btn:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: #ef4444 !important;
}

/* Блок описания тарифов (#f8fafc фон) */
body.dark-theme .kd-info-note {
    background: #1a1a1a !important;
    border-left-color: #555555 !important;
    color: #888888 !important;
}

/* ══════════════════════════════════════════════════════════════
   АВТООЧИСТКА ЛОГОВ (/settings/ - секция Автоочистка логов)
   ══════════════════════════════════════════════════════════════ */

/* Строка интервала (серо-белый фон) */
body.dark-theme .lc-interval-row {
    background: #1e1e1e !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .lc-interval-text {
    color: #aaaaaa !important;
}

body.dark-theme .lc-section-title {
    color: #666666 !important;
}

body.dark-theme .lc-badge {
    background: #2a2a2a !important;
    color: #888888 !important;
}

/* Кнопки +/- для интервала (без onmouseover, только CSS) */
body.dark-theme .lc-days-btn {
    background: #212121 !important;
    border-color: #667eea !important;
    color: #818cf8 !important;
}

body.dark-theme .lc-days-btn:hover {
    background: #667eea !important;
    color: #ffffff !important;
}

/* Разделы: Репрайсинг (purple) */
body.dark-theme .lc-section-label--reprice {
    background: rgba(103, 58, 183, 0.12) !important;
    border-color: #4c1d95 !important;
}

body.dark-theme .lc-section-label--reprice:hover {
    border-color: #7c3aed !important;
}

/* Разделы: Kaspi Upload (yellow/amber) */
body.dark-theme .lc-section-label--upload {
    background: rgba(180, 120, 0, 0.12) !important;
    border-color: #78350f !important;
}

body.dark-theme .lc-section-label--upload:hover {
    border-color: #f59e0b !important;
}

/* Разделы: Заказы (green) */
body.dark-theme .lc-section-label--orders {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #065f46 !important;
}

body.dark-theme .lc-section-label--orders:hover {
    border-color: #10b981 !important;
}

/* Название раздела */
body.dark-theme .lc-item-name {
    color: #cccccc !important;
}

/* Последняя очистка */
body.dark-theme .lc-last-run-box {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #065f46 !important;
}

body.dark-theme .lc-last-run-label {
    color: #6ee7b7 !important;
}

body.dark-theme .lc-last-run-date {
    color: #34d399 !important;
}

/* ── Разделы очистки логов (light purple inline styles) ── */
body.dark-theme [style*="#faf5ff"],
body.dark-theme [style*="#f3e8ff"] {
    background: linear-gradient(135deg, #1e0a2e 0%, #281239 100%) !important;
    border-color: #4c1d95 !important;
}

/* ── НДС строка (inline #f0f9ff) ── */
body.dark-theme [style*="#f0f9ff"] {
    background: linear-gradient(135deg, #0c1a2e 0%, #0f2041 100%) !important;
    border-color: #1e3a5f !important;
}

/* ── Inline text colors overrides ── */
body.dark-theme [style*="color: #0c4a6e"],
body.dark-theme [style*="color:#0c4a6e"],
body.dark-theme [style*="color: #0369a1"],
body.dark-theme [style*="color:#0369a1"],
body.dark-theme [style*="color: #1e40af"],
body.dark-theme [style*="color:#1e40af"] {
    color: #7dd3fc !important;
}

body.dark-theme [style*="color: #475569"],
body.dark-theme [style*="color:#475569"] {
    color: #aaaaaa !important;
}

/* ── Inline badge #e0f2fe (применяется к тарифу) ── */
body.dark-theme [style*="background: #e0f2fe"],
body.dark-theme [style*="background:#e0f2fe"] {
    background: rgba(3, 105, 161, 0.25) !important;
    color: #7dd3fc !important;
}

/* ── Inputs с inline белым фоном ── */
body.dark-theme input[style*="background: #fff"],
body.dark-theme input[style*="background:#fff"],
body.dark-theme input[style*="background: white"],
body.dark-theme input[style*="background:white"] {
    background: #212121 !important;
    color: #e1e1e1 !important;
    border-color: #555555 !important;
}

/* ── Inline text dark gray labels ── */
body.dark-theme [style*="color: #94a3b8"],
body.dark-theme [style*="color:#94a3b8"] {
    color: #777777 !important;
}

/* ── Секция "ПОЛУЧАТЕЛИ УВЕДОМЛЕНИЙ" и прочие uppercase labels ── */
body.dark-theme [style*="color: #64748b"][style*="text-transform"],
body.dark-theme [style*="color:#64748b"][style*="text-transform"] {
    color: #aaaaaa !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА РЕДАКТОРА (/edit/price, /edit/config)
   ══════════════════════════════════════════════════════════════ */

body.dark-theme .editor-container {
    background: #212121 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

/* ── Кнопки тулбара ── */
/* Базовая .tool-btn без цветового класса (напр. "Сбросить ширину") */
body.dark-theme .tool-btn {
    background: #2e2e2e !important;
    color: #cccccc !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}
body.dark-theme .tool-btn:hover:not(:disabled) {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}
/* Цветные варианты - восстанавливаем их собственные градиенты */
body.dark-theme .tool-btn.add-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
}
body.dark-theme .tool-btn.delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #fff !important;
}
body.dark-theme .tool-btn.master-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
}
body.dark-theme .tool-btn.upload-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
}
body.dark-theme .tool-btn.compare-btn {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: #fff !important;
}
body.dark-theme .file-dropdown-btn {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 100%) !important;
    color: #fff !important;
}
body.dark-theme .file-dropdown-menu {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}
body.dark-theme .file-dropdown-item {
    color: #cccccc !important;
}
body.dark-theme .file-dropdown-item:hover {
    background: #2a2a2a !important;
}

body.dark-theme .master-dropdown-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
}
body.dark-theme .master-dropdown-menu {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}
body.dark-theme .master-dropdown-item {
    color: #cccccc !important;
}
body.dark-theme .master-dropdown-item:hover {
    background: #2a2a2a !important;
}
body.dark-theme .tool-btn:disabled {
    opacity: 0.4 !important;
}

/* back-btn (← Назад) */
body.dark-theme .back-btn {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #818cf8 !important;
}
body.dark-theme .back-btn:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}

body.dark-theme .toolbar {
    background: #2a2a2a !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .search-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .search-input::placeholder {
    color: #777777 !important;
}

body.dark-theme .search-input:focus {
    border-color: #667eea !important;
    background: #212121 !important;
}

body.dark-theme .search-filter-select {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .search-filter-select:focus {
    border-color: #667eea !important;
}

body.dark-theme .pagination-wrapper {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important;
}

body.dark-theme .pagination-info {
    color: #aaaaaa !important;
}

body.dark-theme .pagination-btn {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #cccccc !important;
}

body.dark-theme .pagination-btn:hover:not(.disabled) {
    background: #3a3a3a !important;
    border-color: #667eea !important;
    color: #e1e1e1 !important;
}

body.dark-theme .pagination-btn.disabled {
    background: #212121 !important;
    color: #555555 !important;
}

body.dark-theme .pagination-page {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #cccccc !important;
}

body.dark-theme .pagination-page:hover {
    background: #3a3a3a !important;
    border-color: #667eea !important;
}

body.dark-theme .pagination-page.active {
    background: #667eea !important;
    border-color: #667eea !important;
    color: #fff !important;
}

body.dark-theme .pagination-rpp {
    color: #aaaaaa !important;
}

body.dark-theme .pagination-rpp-select {
    background-color: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaaaaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
}

body.dark-theme .pagination-rpp-select:hover {
    border-color: #6366f1 !important;
}

body.dark-theme .pagination-rpp-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

body.dark-theme .pagination-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .pagination-input:focus {
    border-color: #667eea !important;
}

body.dark-theme .pagination-goto-btn {
    background: #667eea !important;
    color: #fff !important;
}

body.dark-theme .form-actions {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important;
}

body.dark-theme .cancel-btn {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}

body.dark-theme .cancel-btn:hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

/* ── Заголовки столбцов таблицы в редакторе ── */
body.dark-theme .col-header-text {
    color: #aaaaaa !important;
}

body.dark-theme .col-sub-text {
    color: #777777 !important;
}

/* ── Таблица данных редактора ── */
body.dark-theme .data-table tbody tr {
    border-bottom-color: #2a2a2a !important;
    background: #1a1a1a !important;
}

body.dark-theme .data-table tbody tr:hover {
    background: #222222 !important;
}

body.dark-theme .data-table tbody tr.selected {
    background: rgba(102, 126, 234, 0.15) !important;
}

body.dark-theme .data-table tbody tr.new-row-highlight {
    background: rgba(16, 185, 129, 0.12) !important;
    box-shadow: inset 0 0 0 2px #10b981 !important;
}

body.dark-theme .data-table td {
    border-right-color: #2a2a2a !important;
    background-color: #1a1a1a !important;
}

body.dark-theme .row-num,
body.dark-theme .row-num-col {
    color: #555555 !important;
}

/* Ячейки-инпуты */
body.dark-theme .cell-input,
body.dark-theme input.cell-input,
body.dark-theme input[type="text"].cell-input {
    background: #1f1f1f !important;
    background-color: #1f1f1f !important;
    border-color: #3a3a3a !important;
    color: #cccccc !important;
}

body.dark-theme .cell-input:focus,
body.dark-theme input.cell-input:focus {
    background: #262626 !important;
    background-color: #262626 !important;
    border-color: #667eea !important;
    color: #e1e1e1 !important;
}

body.dark-theme .cell-input::placeholder {
    color: #555555 !important;
}

/* Ячейки read-only (min_price, kaspi_delivery) */
body.dark-theme .cell-input.min-price-cell,
body.dark-theme input.min-price-cell {
    background: #162420 !important;
    background-color: #162420 !important;
    color: #6ee7b7 !important;
}

body.dark-theme .cell-input.kaspi-delivery-readonly,
body.dark-theme input.kaspi-delivery-readonly {
    background: #162420 !important;
    background-color: #162420 !important;
    color: #6ee7b7 !important;
    font-weight: 600 !important;
}

body.dark-theme .cell-input.product-code-readonly,
body.dark-theme input.product-code-readonly {
    background: #1e2535 !important;
    background-color: #1e2535 !important;
    color: #94a3b8 !important;
}

/* select внутри ячеек (markup_type, cost_currency) */
body.dark-theme .cell-input option,
body.dark-theme select.cell-input,
body.dark-theme .cell-select,
body.dark-theme select.cell-select {
    background: #1f1f1f !important;
    background-color: #1f1f1f !important;
    color: #cccccc !important;
    border-color: #3a3a3a !important;
}

body.dark-theme select.cost-currency-select,
body.dark-theme select.markup-type-select {
    background: #1f1f1f !important;
    background-color: #1f1f1f !important;
    color: #cccccc !important;
    border-color: #3a3a3a !important;
}

/* Excel fill highlight */
body.dark-theme td.fill-highlight {
    background: rgba(59, 130, 246, 0.2) !important;
    outline-color: #3b82f6 !important;
}

/* ── Объединённый столбец "Склады" (PP1-PP5) на /edit/price ── */
body.dark-theme .wh-summary-total {
    color: #cccccc !important;
}

body.dark-theme .wh-summary:hover {
    background: #262626 !important;
}

body.dark-theme .wh-summary-chevron {
    color: #777777 !important;
}

body.dark-theme .wh-panel {
    border-top-color: #3a3a3a !important;
}

body.dark-theme .wh-tile {
    background: #1f1f1f !important;
}

body.dark-theme .wh-tile-label {
    color: #999999 !important;
}

/* Маленькие тумблеры "Понижение"/"Повышение"/"Экспресс" - неактивный трек.
   Только :not(:checked) - иначе (как было раньше) этот !important бил
   поверх цветных состояний "включено" из editor.css (.mini-toggle-down/
   -up/-express), и все три тумблера в тёмной теме выглядели одинаково
   серыми независимо от того, включены они или нет. */
body.dark-theme .mini-toggle input:not(:checked) + .mini-toggle-track {
    background: #3a3a3a !important;
}

/* ── "Настроить товар" (/edit/price) - кнопка и панель истории цены ── */
body.dark-theme .product-settings-btn {
    background: #1f1f1f !important;
    border-color: #3a3a3a !important;
    color: #cccccc !important;
}

body.dark-theme .product-settings-btn:hover {
    background: #262626 !important;
    border-color: #667eea !important;
    color: #a5b4fc !important;
}

body.dark-theme #product-settings-drawer {
    background: #1a1a1a !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .5) !important;
}

body.dark-theme .psd-header {
    border-bottom-color: #2a2a2a !important;
}

body.dark-theme .psd-title {
    color: #e1e1e1 !important;
}

body.dark-theme .psd-section-toggle {
    background: #1f1f1f !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .psd-section-toggle:hover {
    background: #262626 !important;
    border-color: #4a4a4a !important;
}

body.dark-theme .psd-section-toggle.expanded {
    background: #1e2a3d !important;
    border-color: #2f4a70 !important;
}

body.dark-theme .psd-section-toggle-label {
    color: #e1e1e1 !important;
}

body.dark-theme .psd-section-toggle-icon-wrap {
    background: #2a2a2a !important;
    color: #999999 !important;
}

body.dark-theme .psd-section-toggle.expanded .psd-section-toggle-icon-wrap {
    background: #2f4a70 !important;
    color: #93c5fd !important;
}

body.dark-theme .psd-history-count-badge {
    background: #2a2a2a !important;
    color: #999999 !important;
}

body.dark-theme .psd-section-toggle.expanded .psd-history-count-badge {
    background: #2f4a70 !important;
    color: #93c5fd !important;
}

body.dark-theme .psd-section-toggle .psd-section-toggle-icon {
    color: #777777 !important;
}

body.dark-theme .psd-section-toggle.expanded .psd-section-toggle-icon {
    color: #93c5fd !important;
}

body.dark-theme #psd-history-list.expanded {
    border-color: #2f4a70 !important;
}

body.dark-theme .psd-history-row:hover {
    background: #262626 !important;
    border-color: #4a4a4a !important;
}

body.dark-theme .psd-subtitle {
    color: #777777 !important;
}

body.dark-theme .psd-close-btn {
    background: rgba(38, 38, 38, .85) !important;
    color: #999999 !important;
}

body.dark-theme .psd-close-btn:hover {
    background: #333333 !important;
    color: #cccccc !important;
}

body.dark-theme .psd-photo-wrap {
    background: #1f1f1f !important;
}

body.dark-theme .psd-info-box {
    background: #1f1f1f !important;
}

body.dark-theme .psd-info-label {
    color: #999999 !important;
}

body.dark-theme .psd-info-value {
    color: #e1e1e1 !important;
}

body.dark-theme .psd-history-loading,
body.dark-theme .psd-history-empty {
    background: #1f1f1f !important;
    color: #999999 !important;
}

body.dark-theme .psd-history-row {
    background: #1f1f1f !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .psd-price-new {
    color: #e1e1e1 !important;
}

body.dark-theme .psd-price-old {
    color: #666666 !important;
}

body.dark-theme .psd-history-date {
    color: #666666 !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА СКЛАДА (/warehouse/)
   ══════════════════════════════════════════════════════════════ */

body.dark-theme .product-card {
    background: #212121 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .product-card:hover {
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .product-card .product-name,
body.dark-theme .product-card [style*="color: #667eea"],
body.dark-theme .product-card [style*="color:#667eea"] {
    color: #818cf8 !important;
}

/* Поле поиска на складе (inline style="background: white") */
body.dark-theme #searchInput {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme #searchInput::placeholder {
    color: #777777 !important;
}

/* Контейнер поиска на складе */
body.dark-theme [style*="background: white;"] {
    background: #212121 !important;
}

/* Кнопка "Товары от которых отказались" (inactive) */
body.dark-theme .section-btn:not(.active) {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА РЕПРАЙСИНГА (/reprice/) и KASPI-UPLOAD (/kaspi-upload/)
   ══════════════════════════════════════════════════════════════ */

body.dark-theme .setting-item {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .setting-item label {
    color: #cccccc !important;
}

body.dark-theme .setting-item input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .setting-item input:focus {
    border-color: #667eea !important;
}

body.dark-theme .setting-item p,
body.dark-theme .setting-item small,
body.dark-theme .setting-item span:not(.emoji) {
    color: #aaaaaa !important;
}

/* Формат файла (XML/XLSX) */
body.dark-theme .format-option {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #cccccc !important;
}

body.dark-theme .format-option:hover {
    border-color: #667eea !important;
}

body.dark-theme .format-option.selected {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: #10b981 !important;
}

body.dark-theme .format-name {
    color: #e1e1e1 !important;
}

body.dark-theme .format-description {
    color: #777777 !important;
}

/* Info boxes в kaspi-upload */
body.dark-theme .info-box.success {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

body.dark-theme .info-box.warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: #f59e0b !important;
    color: #fcd34d !important;
}

body.dark-theme .info-box-title {
    color: inherit !important;
}

/* Кнопки внутри setting-item (без отдельного класса: Сохранить, Изменить и пр.) */
body.dark-theme .setting-item button {
    background: #4f46e5 !important;
    color: #fff !important;
}
body.dark-theme .setting-item button:hover:not(:disabled) {
    background: #6366f1 !important;
}
body.dark-theme .setting-item button:disabled {
    opacity: 0.4 !important;
}

/* info-box.info (Как это работает, orders) */
body.dark-theme .info-box.info {
    background: rgba(56, 189, 248, 0.08) !important;
    border-color: #0ea5e9 !important;
    color: #7dd3fc !important;
}

/* ── Окно «Учетные данные» ── */
body.dark-theme .cred-modal-content {
    background: #212121;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

body.dark-theme .cred-modal-body {
    background: #212121;
}

body.dark-theme .cred-modal-body .cred-label {
    color: #8b95a5;
}

body.dark-theme .cred-state {
    color: #8b95a5;
}

body.dark-theme .cred-field-group.is-filled .cred-state {
    color: #4ade80;
}

body.dark-theme .cred-input {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .cred-input:focus {
    border-color: #6366f1 !important;
    background: #1c1c1c !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22) !important;
}

body.dark-theme .cred-input::placeholder {
    color: #6b7280 !important;
}

body.dark-theme .cred-eye-btn:hover {
    background: #312e81;
}

body.dark-theme .cred-notice {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #94a3b8;
}

/* Учетные данные Kaspi (credentials display) */
body.dark-theme .credentials-display--ok {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}
body.dark-theme .credentials-display--ok .cred-label {
    color: #6ee7b7 !important;
}
body.dark-theme .credentials-display--ok .cred-value {
    color: #a7f3d0 !important;
}
body.dark-theme .credentials-display--empty {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
}
body.dark-theme .credentials-display--empty .cred-empty-text {
    color: #fca5a5 !important;
}

/* .credentials-display (legacy) */
body.dark-theme .credentials-display {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}

/* .form-input в модальном окне kaspi-upload */
body.dark-theme .form-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .form-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}
body.dark-theme .form-input::placeholder {
    color: #666666 !important;
}

/* ══════════════════════════════════════════════════════════════
   МОДАЛЬНЫЕ ОКНА - ДРУГИЕ СТРАНИЦЫ
   ══════════════════════════════════════════════════════════════ */

/* ── orders.html: таблица истории заказов ── */
body.dark-theme .orders-table-wrapper {
    border-color: #3a3a3a !important;
}

body.dark-theme .orders-table th {
    background: #2a2a2a !important;
    color: #cccccc !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .orders-table td {
    color: #cccccc !important;
    border-bottom-color: #3a3a3a !important;
}

/* tr-level: убираем светлый фон при hover чтобы rgba в td не пробивался */
body.dark-theme .orders-table tr:hover {
    background: #2a2a2a !important;
}
body.dark-theme .orders-table tr:hover td {
    background: #2a2a2a !important;
}

/* Строки по статусу - tr и td оба задаём, чтобы rgba не просвечивал */
body.dark-theme .orders-table tr.status-row-green {
    background: #1a2e24 !important;
}
body.dark-theme .orders-table tr.status-row-green td {
    background: transparent !important;
}
body.dark-theme .orders-table tr.status-row-green:hover {
    background: #1e3a2c !important;
}
body.dark-theme .orders-table tr.status-row-green:hover td {
    background: transparent !important;
}

body.dark-theme .orders-table tr.status-row-red,
body.dark-theme .orders-table tr.cancelled-row {
    background: #2e1a1a !important;
}
body.dark-theme .orders-table tr.status-row-red td,
body.dark-theme .orders-table tr.cancelled-row td {
    background: transparent !important;
    color: #fca5a5 !important;
}
body.dark-theme .orders-table tr.status-row-red:hover,
body.dark-theme .orders-table tr.cancelled-row:hover {
    background: #3a1e1e !important;
}
body.dark-theme .orders-table tr.status-row-red:hover td,
body.dark-theme .orders-table tr.cancelled-row:hover td {
    background: transparent !important;
}

body.dark-theme .orders-table tr.status-row-yellow {
    background: #2a2210 !important;
}
body.dark-theme .orders-table tr.status-row-yellow td {
    background: transparent !important;
}
body.dark-theme .orders-table tr.status-row-yellow:hover {
    background: #332a14 !important;
}
body.dark-theme .orders-table tr.status-row-yellow:hover td {
    background: transparent !important;
}

/* Бейджи статусов */
body.dark-theme .status-badge-default {
    background: #3a3a3a !important;
    color: #aaaaaa !important;
}

body.dark-theme .status-badge-green {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

body.dark-theme .status-badge-red {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

body.dark-theme .status-badge-yellow {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
}

body.dark-theme .orders-table .badge {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

/* ── orders.html: .clr-modal (подтверждение очистки) ── */
body.dark-theme .clr-modal {
    background: #212121 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .clr-body {
    background: #212121 !important;
}

body.dark-theme .clr-body label {
    color: #aaaaaa !important;
}

body.dark-theme .clr-body input[type="text"],
body.dark-theme .clr-body input[type="number"],
body.dark-theme .clr-body input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .clr-body input:focus {
    border-color: #ef4444 !important;
    background: #212121 !important;
}

body.dark-theme .clr-footer {
    background: #212121 !important;
}

body.dark-theme .clr-btn-cancel {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}

body.dark-theme .clr-btn-cancel:hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

/* ── statistics.html: .rev-modal, .sku-modal, .compare-modal ── */
body.dark-theme .rev-modal {
    background: rgba(24, 24, 24, 0.97) !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .rev-modal-head {
    background: transparent !important;
    border-bottom-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .rev-modal-close {
    color: #aaaaaa !important;
}

body.dark-theme .rev-modal-close:hover {
    color: #e1e1e1 !important;
}

body.dark-theme .rev-total-label {
    color: #aaaaaa !important;
}

body.dark-theme .rev-modal-body {
    background: transparent !important;
}

body.dark-theme .rev-status-row {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .sku-modal {
    background: rgba(24, 24, 24, 0.97) !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

/* ── Фильтр дат продаж (тёмная тема) ── */
body.dark-theme .sales-date-filter {
    border-bottom-color: #2e2e2e !important;
}
body.dark-theme .sales-date-preset {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}
body.dark-theme .sales-date-preset:hover,
body.dark-theme .sales-date-preset.active {
    background: #1e1a40 !important;
    border-color: #6366f1 !important;
    color: #818cf8 !important;
}
body.dark-theme .sales-date-inputs,
body.dark-theme .date-range-row {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .sales-date-inputs:focus-within,
body.dark-theme .date-range-row:focus-within {
    border-color: #6366f1 !important;
    background: #1e1a40 !important;
}
/* input[type="text"].sales-date-input (не просто .sales-date-input) - иначе
   проигрывает по специфичности общему body.dark-theme input[type="text"]
   (см. "Формы" в начале файла): у него !important и на элемент, и на
   атрибут разом, значит и переопределять его нужно селектором не менее
   специфичным - иначе не только цвета, но и background-image (иконка
   календаря, у shorthand background своего в общем правиле нет, поэтому
   без явного переопределения она пропадает) откатываются к тому правилу. */
body.dark-theme input[type="text"].sales-date-input {
    background-color: #212121 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 6px center !important;
    background-size: 12px 12px !important;
    border-color: transparent !important;
    color: #e1e1e1 !important;
    color-scheme: dark;
}
body.dark-theme input[type="text"].sales-date-input:hover { background-color: #262626 !important; }
body.dark-theme input[type="text"].sales-date-input:focus {
    border-color: #6366f1 !important;
    background-color: #212121 !important;
}
body.dark-theme .sales-date-sep {
    color: #555555 !important;
}

body.dark-theme .sku-modal-head {
    background: transparent !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .sku-modal-title {
    color: #e1e1e1 !important;
}

body.dark-theme .sku-modal-sub {
    color: #aaaaaa !important;
}

body.dark-theme .sku-modal-close {
    color: #aaaaaa !important;
}

body.dark-theme .sku-modal-close:hover {
    color: #e1e1e1 !important;
}

body.dark-theme .sku-modal-body {
    background: transparent !important;
}

body.dark-theme .sku-modal-loading {
    color: #aaaaaa !important;
}

body.dark-theme .compare-modal {
    background: rgba(24, 24, 24, 0.97) !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .compare-head {
    background: transparent !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .compare-title {
    color: #e1e1e1 !important;
}

body.dark-theme .compare-search-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .compare-body {
    background: transparent !important;
}

body.dark-theme .compare-right {
    background: #181818 !important;
}

body.dark-theme .compare-item {
    color: #cccccc !important;
}

/* ── kaspi_upload.html: .modal, .modal-content, .form-input ── */
body.dark-theme .modal-content {
    background: #212121 !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .modal-header {
    background: transparent !important;
    border-bottom-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .modal-header h2,
body.dark-theme .modal-header h3 {
    color: #e1e1e1 !important;
}

body.dark-theme .modal-body {
    background: transparent !important;
    color: #cccccc !important;
}

body.dark-theme .modal-footer {
    background: #181818 !important;
    border-top-color: #3a3a3a !important;
}

body.dark-theme .form-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .form-input:focus {
    border-color: #818cf8 !important;
    background: #212121 !important;
}

body.dark-theme .close-modal {
    color: #aaaaaa !important;
}

body.dark-theme .close-modal:hover {
    color: #e1e1e1 !important;
}

/* ── warehouse.html: inline-style modal containers ── */
body.dark-theme [style*="rgba(255, 255, 255, 0.95)"],
body.dark-theme [style*="rgba(255,255,255,0.95)"],
body.dark-theme [style*="rgba(255, 255, 255, 0.98)"],
body.dark-theme [style*="rgba(255,255,255,0.98)"] {
    background: rgba(24, 24, 24, 0.97) !important;
}

body.dark-theme .close-history {
    color: #aaaaaa !important;
}

body.dark-theme .close-history:hover {
    color: #e1e1e1 !important;
}

body.dark-theme .close-edit {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* History modal items styling */
body.dark-theme .history-item {
    background: linear-gradient(135deg, #212121 0%, #2a2a2a 100%) !important;
    border-left-color: #667eea !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .history-change {
    color: #e1e1e1 !important;
}

body.dark-theme .history-date {
    color: #999999 !important;
}

/* Preorder/Warehouse current-value display boxes (white/light bg) */
body.dark-theme [id="editPreorderModal"] [style*="background: linear-gradient(135deg, #f8fafc"],
body.dark-theme [id="editWarehouseModal"] [style*="background: linear-gradient(135deg, #f8fafc"] {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

/* Warehouse modal: checkbox labels for "Репрайсинг и экспресс-доставка" */
body.dark-theme [id="editWarehouseModal"] label:has(#editWarehouseRepriceEnabled),
body.dark-theme [id="editWarehouseModal"] label:has(#editWarehouseExpress) {
    background: linear-gradient(135deg, #2a2a2a 0%, #212121 100%) !important;
    border-color: #444444 !important;
}

body.dark-theme [id="editWarehouseModal"] label:has(#editWarehouseRepriceEnabled) span,
body.dark-theme [id="editWarehouseModal"] label:has(#editWarehouseExpress) span {
    color: #e1e1e1 !important;
}

/* ── editor.html: .modal, .wizard-modal ── */
body.dark-theme .modal-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fcd34d !important;
}

body.dark-theme .wizard-modal .modal-content,
body.dark-theme .wizard-modal-content {
    background: #212121 !important;
    border: 1px solid #3a3a3a !important;
}

body.dark-theme .wizard-steps {
    background: #212121 !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .wizard-step .step-circle {
    background: #3a3a3a !important;
    color: #aaaaaa !important;
    border-color: #555555 !important;
}

body.dark-theme .wizard-step.active .step-circle {
    background: #667eea !important;
    color: #fff !important;
    border-color: #667eea !important;
}

body.dark-theme .wizard-step .step-label {
    color: #aaaaaa !important;
}

body.dark-theme .wizard-step.active .step-label {
    color: #818cf8 !important;
}

body.dark-theme .step-content {
    background: transparent !important;
    color: #cccccc !important;
}

body.dark-theme .form-group-wizard label {
    color: #aaaaaa !important;
}

body.dark-theme .form-group-wizard input,
body.dark-theme .form-group-wizard select,
body.dark-theme .form-group-wizard textarea {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme .help-text {
    color: #777777 !important;
}

/* ── editor.html: мастер добавления (config) ── */
body.dark-theme .master-stat-item {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .master-stat-label {
    color: #aaaaaa !important;
}

body.dark-theme .master-stat-value {
    color: #e1e1e1 !important;
}

body.dark-theme .master-stat-value.highlight {
    color: #a78bfa !important;
}

body.dark-theme .master-option-group {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .master-option-label {
    color: #cccccc !important;
}

body.dark-theme .master-option-label .option-title {
    color: #e1e1e1 !important;
}

body.dark-theme .master-info-box {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: #93c5fd !important;
}

body.dark-theme .custom-price-input {
    background: #1a1a1a !important;
    border-color: #7c3aed !important;
}

body.dark-theme .currency-label {
    color: #aaaaaa !important;
}

body.dark-theme .category-card {
    background: #181818 !important;
    border-color: #3a3a3a !important;
    color: #cccccc !important;
}

body.dark-theme .category-card:hover {
    border-color: #667eea !important;
    background: #212121 !important;
}

body.dark-theme .category-card.selected {
    background: linear-gradient(135deg, #1e1b4b 0%, #2a1f63 100%) !important;
    border-color: #818cf8 !important;
}
body.dark-theme .category-card-image { background: #2a2a2a !important; }
body.dark-theme .category-card.selected .category-card-image { background: #312e81 !important; }
body.dark-theme .category-card-title { color: #e2e8f0 !important; }
body.dark-theme .category-card-desc { color: #94a3b8 !important; }
body.dark-theme .category-card.selected .category-card-title { color: #c4b5fd !important; }
body.dark-theme .category-card.selected .category-card-desc { color: #a5b4fc !important; }

body.dark-theme .size-type-card {
    background: #181818 !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .size-type-card:hover {
    background: #202020 !important;
    border-color: #667eea !important;
}
body.dark-theme .size-type-card.selected {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
    border-color: #818cf8 !important;
}
body.dark-theme .size-type-card-icon { background: #2a2a2a !important; }
body.dark-theme .size-type-card.selected .size-type-card-icon { background: #3730a3 !important; }
body.dark-theme .size-type-card-title { color: #e2e8f0 !important; }
body.dark-theme .size-type-card-desc { color: #94a3b8 !important; }

body.dark-theme .size-checkbox {
    background: #181818 !important;
    border-color: #4b5563 !important;
}
body.dark-theme .size-checkbox:hover {
    background: #202020 !important;
    border-color: #818cf8 !important;
}
body.dark-theme .size-checkbox:has(input:checked) {
    background: #312e81 !important;
    border-color: #818cf8 !important;
}
body.dark-theme .size-checkbox span { color: #d1d5db !important; }
body.dark-theme .size-checkbox input[type="checkbox"]:checked + span { color: #c4b5fd !important; }

body.dark-theme .color-item {
    background: #1b1b1b !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .color-item:hover {
    background: #232323 !important;
    border-color: #64748b !important;
}
body.dark-theme .color-item.selected {
    background: rgba(16, 185, 129, 0.16) !important;
    border-color: #34d399 !important;
}

/* Контейнер грида цветов */
body.dark-theme .colors-grid-container {
    background: #151515 !important;
    border-color: #3a3a3a !important;
}

/* Текст названия цвета и галочка */
body.dark-theme .color-item .color-name {
    color: #e2e8f0 !important;
}
body.dark-theme .color-item.selected .color-name {
    color: #6ee7b7 !important;
}
body.dark-theme .color-item .color-checkmark {
    color: #34d399 !important;
}

/* Граница свотча цвета */
body.dark-theme .color-swatch {
    border-color: rgba(255,255,255,0.15) !important;
}

/* Счётчик выбранных цветов */
body.dark-theme .wizard-colors-counter {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}
body.dark-theme .wizard-colors-counter strong {
    color: #e2e8f0 !important;
}

/* Разделитель "Добавить свой цвет" */
body.dark-theme .wizard-colors-footer {
    border-top-color: #334155 !important;
}

/* Метка "Выбранные цвета:" */
body.dark-theme .selected-colors-label {
    color: #94a3b8 !important;
}

/* ── archive.html: .confirm-box ── */
body.dark-theme .confirm-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

body.dark-theme .confirm-box {
    background: #212121 !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .confirm-title {
    color: #e1e1e1 !important;
}

body.dark-theme .confirm-msg {
    color: #aaaaaa !important;
}

body.dark-theme .confirm-cancel {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}

body.dark-theme .confirm-cancel:hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА СТАТИСТИКИ (/statistics/)
   ══════════════════════════════════════════════════════════════ */

/* ── Карточки метрик (Оборот, Продажи, Ср. в день, ...) ── */
body.dark-theme .metric-card {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2) !important;
}
body.dark-theme .metric-card.top-city-card .metric-detail-hint {
    color: #9ca3af !important;
    opacity: 0.7 !important;
}
body.dark-theme .metric-card.top-city-card:hover .metric-detail-hint {
    color: #60a5fa !important;
    opacity: 1 !important;
}

body.dark-theme .metric-label {
    color: #aaaaaa !important;
}

body.dark-theme .metric-value {
    color: #e1e1e1 !important;
}

body.dark-theme .metric-sub {
    color: #777777 !important;
}

/* Иконки в карточках */
body.dark-theme .ic-green  { background: rgba(16,185,129,0.15) !important; }
body.dark-theme .ic-blue   { background: rgba(59,130,246,0.15) !important; }
body.dark-theme .ic-purple { background: rgba(139,92,246,0.15) !important; }
body.dark-theme .ic-amber  { background: rgba(245,158,11,0.15) !important; }
body.dark-theme .ic-red    { background: rgba(239,68,68,0.15) !important; }

/* ── Блоки с графиками ── */
body.dark-theme .chart-section {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

body.dark-theme .chart-title {
    color: #e1e1e1 !important;
}

body.dark-theme .chart-legend-item {
    color: #aaaaaa !important;
}
body.dark-theme .chart-subtitle {
    color: #8b97ab !important;
}
body.dark-theme .chart-insight-card {
    background: linear-gradient(180deg, #252525 0%, #1f1f1f 100%) !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .chart-insight-title {
    color: #9ca3af !important;
}
body.dark-theme .chart-insight-value {
    color: #e5e7eb !important;
}
body.dark-theme .chart-insight-value.is-good {
    color: #34d399 !important;
}
body.dark-theme .chart-insight-value.is-bad {
    color: #f87171 !important;
}
body.dark-theme .chart-insight-sub,
body.dark-theme .chart-insight-empty {
    color: #6b7280 !important;
}
body.dark-theme .chart-insight-sub.is-bad {
    color: #f87171 !important;
}
body.dark-theme .chart-insight-sub-bad {
    color: #f87171 !important;
}

/* ── Топ-карточки (Топ по продажам, Топ маржальных, ...) ── */
body.dark-theme .top-card {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

body.dark-theme .top-card-head {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .top-card-title {
    color: #e1e1e1 !important;
}

body.dark-theme .top-item:hover {
    background: #2a2a2a !important;
}

body.dark-theme .top-item-clickable:hover {
    background: rgba(59,130,246,0.1) !important;
}

body.dark-theme .top-name {
    color: #cccccc !important;
}

body.dark-theme .top-value {
    color: #cccccc !important;
}

body.dark-theme .top-detail {
    color: #777777 !important;
}

/* Ранги */
body.dark-theme .rank-1  { background: rgba(245,158,11,0.2)  !important; color: #fcd34d !important; }
body.dark-theme .rank-2  { background: #2a2a2a !important; color: #aaaaaa !important; }
body.dark-theme .rank-3  { background: rgba(251,146,60,0.2)  !important; color: #fb923c !important; }
body.dark-theme .rank-other { background: #2a2a2a !important; color: #777777 !important; }

/* Кнопка-тоггл в топ-карточке */
body.dark-theme .top-card-toggle {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
}
body.dark-theme .top-card-toggle:hover { background: #3a3a3a !important; }

/* Кнопка "Показать топ-50" */
body.dark-theme .top-list-more-btn {
    background: #262626 !important;
    border-top-color: #3a3a3a !important;
    color: #60a5fa !important;
}
body.dark-theme .top-list-more-btn:hover { background: #2a2a2a !important; }

/* ── Модал оборота (.rev-modal) ── */
body.dark-theme .rev-modal-head {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .rev-modal-title {
    color: #e1e1e1 !important;
}

body.dark-theme .rev-modal-sub {
    color: #aaaaaa !important;
}

body.dark-theme .rev-modal-close {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
}
body.dark-theme .rev-modal-close:hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .rev-modal-total {
    background: rgba(16,185,129,0.1) !important;
    border-bottom-color: rgba(16,185,129,0.2) !important;
}

body.dark-theme #retModalTotal {
    background: rgba(225,29,72,0.1) !important;
    border-bottom-color: rgba(225,29,72,0.2) !important;
}

body.dark-theme .rev-status-row {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .rev-status-row:hover {
    background: #2a2a2a !important;
}

body.dark-theme .rev-status-label {
    color: #cccccc !important;
}
body.dark-theme .rev-status-sum {
    color: #e1e1e1 !important;
}
body.dark-theme .rev-status-count {
    color: #777777 !important;
}
body.dark-theme .rev-status-desc {
    color: #777777 !important;
}

/* Бейджи статусов в rev-modal */
body.dark-theme .rev-badge-orange {
    background: rgba(194,65,12,0.2) !important;
    border-color: rgba(194,65,12,0.3) !important;
    color: #fb923c !important;
}
body.dark-theme .rev-badge-blue {
    background: rgba(29,78,216,0.2) !important;
    border-color: rgba(29,78,216,0.3) !important;
    color: #93c5fd !important;
}
body.dark-theme .rev-badge-green {
    background: rgba(21,128,61,0.2) !important;
    border-color: rgba(21,128,61,0.3) !important;
    color: #6ee7b7 !important;
}

body.dark-theme .rev-modal-list-body {
    border-top-color: #3a3a3a !important;
}

/* Ряды в модальном окне "Топ 10 городов" */
body.dark-theme .rev-row {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .rev-row:hover {
    background: #2a2a2a !important;
}
body.dark-theme .rev-row-label {
    color: #e1e1e1 !important;
}
body.dark-theme .rev-row-desc {
    color: #9ca3af !important;
}
body.dark-theme .rev-row-right {
    color: #e1e1e1 !important;
}

body.dark-theme #topCitiesModalTotal {
    background: rgba(59,130,246,0.12) !important;
    border-bottom-color: rgba(59,130,246,0.25) !important;
}
body.dark-theme #topCitiesModalTotal .rev-total-label {
    color: #93c5fd !important;
}
body.dark-theme #topCitiesModalTotal .rev-total-value {
    color: #dbeafe !important;
}

/* ── Таблица продаж в SKU-модале (.sales-table) ── */
body.dark-theme .sales-th {
    background: #2a2a2a !important;
    color: #777777 !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .sales-td {
    color: #cccccc !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .sales-table tbody tr:hover .sales-td {
    background: #2a2a2a !important;
}

body.dark-theme .sales-td-id {
    color: #777777 !important;
}

body.dark-theme .sales-td-names {
    color: #aaaaaa !important;
}

/* Бейджи статусов в таблице продаж */
body.dark-theme .sales-badge-green {
    background: rgba(21,128,61,0.2) !important;
    border-color: rgba(21,128,61,0.3) !important;
    color: #6ee7b7 !important;
}
body.dark-theme .sales-badge-orange {
    background: rgba(194,65,12,0.2) !important;
    border-color: rgba(194,65,12,0.3) !important;
    color: #fb923c !important;
}
body.dark-theme .sales-badge-blue {
    background: rgba(29,78,216,0.2) !important;
    border-color: rgba(29,78,216,0.3) !important;
    color: #93c5fd !important;
}
body.dark-theme .sales-badge-amber {
    background: rgba(180,83,9,0.2) !important;
    border-color: rgba(180,83,9,0.3) !important;
    color: #fcd34d !important;
}
body.dark-theme .sales-badge-gray {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}
body.dark-theme .sales-badge-red {
    background: rgba(190,18,60,0.2) !important;
    border-color: rgba(190,18,60,0.3) !important;
    color: #fca5a5 !important;
}
body.dark-theme .sales-badge-purple {
    background: rgba(109,40,217,0.2) !important;
    border-color: rgba(109,40,217,0.3) !important;
    color: #c4b5fd !important;
}
body.dark-theme .sales-badge-teal {
    background: rgba(15,118,110,0.2) !important;
    border-color: rgba(15,118,110,0.3) !important;
    color: #5eead4 !important;
}

/* ── SKU-модал (список покупок) ── */
body.dark-theme .sku-modal-close {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
}
body.dark-theme .sku-modal-close:hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .sku-modal-summary {
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .sku-summary-chip {
    background: #2a2a2a !important;
}

body.dark-theme .sku-summary-chip-val {
    color: #e1e1e1 !important;
}
body.dark-theme .sku-summary-chip-lbl {
    color: #777777 !important;
}

body.dark-theme .sku-purchase-item {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .sku-purchase-price {
    color: #e1e1e1 !important;
}
body.dark-theme .sku-purchase-qty {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
}

/* ── Модал сравнения (.compare-modal) ── */
body.dark-theme .compare-head {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .compare-title {
    color: #e1e1e1 !important;
}
body.dark-theme .compare-sub {
    color: #aaaaaa !important;
}
body.dark-theme .compare-close:hover {
    background: #2a2a2a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .compare-search-row {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .compare-search-input {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .compare-search-input:focus {
    border-color: #8b5cf6 !important;
    background: #212121 !important;
}

body.dark-theme .compare-ctrl-btn {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}
body.dark-theme .compare-ctrl-btn:hover {
    background: #2a2a2a !important;
    border-color: #777777 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .compare-ctrl-clear {
    background: rgba(225,29,72,0.1) !important;
    border-color: rgba(225,29,72,0.3) !important;
    color: #fca5a5 !important;
}

body.dark-theme .compare-status-row {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .compare-status-btn {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}
body.dark-theme .compare-status-btn:hover {
    background: rgba(139,92,246,0.1) !important;
    border-color: #c4b5fd !important;
    color: #a78bfa !important;
}

body.dark-theme .compare-left {
    border-right-color: #3a3a3a !important;
}

body.dark-theme .compare-item {
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .compare-item:hover {
    background: #2a2a2a !important;
}
body.dark-theme .compare-item.selected {
    background: rgba(139,92,246,0.1) !important;
}
body.dark-theme .compare-item-name {
    color: #cccccc !important;
}
body.dark-theme .compare-item-meta {
    color: #777777 !important;
}

body.dark-theme .compare-placeholder {
    color: #555555 !important;
}
body.dark-theme .compare-empty-state {
    color: #555555 !important;
}

/* Summary chips в правой панели */
body.dark-theme .cmp-summary-chip {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .cmp-chip-val {
    color: #e1e1e1 !important;
}
body.dark-theme .cmp-chip-lbl {
    color: #777777 !important;
}

/* Sort button */
body.dark-theme .cmp-sort-btn {
    background: #212121 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}
body.dark-theme .cmp-sort-btn:hover {
    background: rgba(139,92,246,0.1) !important;
    border-color: #c4b5fd !important;
    color: #a78bfa !important;
}

/* Строки товаров в правой панели */
body.dark-theme .cmp-row {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .cmp-row-name {
    color: #cccccc !important;
}
body.dark-theme .cmp-rows-label {
    color: #777777 !important;
}

/* Breakdown section */
body.dark-theme .cmp-breakdown-section {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .cmp-breakdown-title {
    color: #777777 !important;
}
body.dark-theme .cmp-breakdown-lbl {
    color: #9ca3af !important;
}
body.dark-theme .cmp-breakdown-val {
    color: #e1e1e1 !important;
}
body.dark-theme .cmp-row-cost {
    color: #94a3b8 !important;
}
body.dark-theme .cmp-cost-lbl {
    color: #9ca3af !important;
}
body.dark-theme .cmp-cost-val {
    color: #cbd5e1 !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА АРХИВА (/archive/)
   ══════════════════════════════════════════════════════════════ */

/* ── Тулбар с фильтрами ── */
body.dark-theme .arc-toolbar {
    background: #212121 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

body.dark-theme .arc-tab {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #aaaaaa !important;
}
body.dark-theme .arc-tab:hover {
    border-color: #667eea !important;
    color: #818cf8 !important;
}
body.dark-theme .arc-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(102,126,234,0.4) !important;
}
body.dark-theme .arc-toolbar-count {
    color: #777777 !important;
}

body.dark-theme .arc-toolbar-label {
    color: #aaaaaa !important;
}
body.dark-theme .arc-toolbar-count {
    color: #777777 !important;
}

/* ── Таблица архивов ── */
body.dark-theme .arc-list-table {
    background: #212121 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important;
}

body.dark-theme .arc-list-table thead th {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .arc-list-table tbody td {
    color: #cccccc !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .arc-list-table tbody tr:hover td {
    background: #2a2a2a !important;
}

/* ── Мобильные карточки архива (archive-mobile.css переопределяет tr как карточку) ── */
@media (max-width: 768px) {
    body.dark-theme .arc-list-table tbody tr {
        background: #212121 !important;
        border-color: #3a3a3a !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    }
    body.dark-theme .arc-list-table tbody tr:hover {
        background: #2a2a2a !important;
    }
    body.dark-theme .arc-list-table tbody td:nth-child(3),
    body.dark-theme .arc-list-table tbody td:nth-child(4) {
        color: #777777 !important;
    }
    body.dark-theme .arcv-meta-item {
        border-bottom-color: #3a3a3a !important;
    }
}

/* Бейджи типов */
body.dark-theme .badge-price {
    background: rgba(29,78,216,0.2) !important;
    color: #93c5fd !important;
}
body.dark-theme .badge-config {
    background: rgba(124,58,237,0.2) !important;
    color: #c4b5fd !important;
}

/* Имя файла и создатель */
body.dark-theme .arc-filename {
    color: #aaaaaa !important;
}
body.dark-theme .arc-creator {
    color: #cccccc !important;
}

/* Кнопки действий */
body.dark-theme .arc-btn-view {
    background: #181818 !important;
    border-color: rgba(129,140,248,0.4) !important;
    color: #818cf8 !important;
}
body.dark-theme .arc-btn-view:hover {
    background: rgba(99,102,241,0.1) !important;
    border-color: #818cf8 !important;
}

body.dark-theme .arc-btn-dl {
    background: #181818 !important;
    border-color: rgba(74,222,128,0.4) !important;
    color: #4ade80 !important;
}
body.dark-theme .arc-btn-dl:hover {
    background: rgba(16,185,129,0.1) !important;
    border-color: #4ade80 !important;
}

body.dark-theme .arc-btn-del {
    background: #181818 !important;
    border-color: rgba(252,165,165,0.4) !important;
    color: #fca5a5 !important;
}
body.dark-theme .arc-btn-del:hover {
    background: rgba(239,68,68,0.1) !important;
    border-color: #fca5a5 !important;
}

body.dark-theme .arc-search-wrap {
    background: #181818 !important;
    border-color: #3a3a48 !important;
}
body.dark-theme .arc-search-wrap:focus-within {
    border-color: #6366f1 !important;
    background: #1e1e2a !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
body.dark-theme .arc-search-icon { color: #4b5563 !important; }
body.dark-theme .arc-search-input { color: #e1e1e1 !important; }
body.dark-theme .arc-search-input::placeholder { color: #4b5563 !important; }
body.dark-theme .arc-search-clear { color: #4b5563 !important; }
body.dark-theme .arc-search-clear:hover { color: #94a3b8 !important; }

/* ── Страница просмотра архива (archive_view.html) ── */
body.dark-theme .arcv-topcard {
    background: #212121 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

body.dark-theme .arcv-meta {
    background: #212121 !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .arcv-meta-item {
    border-right-color: #3a3a3a !important;
}
body.dark-theme .arcv-meta-label {
    color: #777777 !important;
}
body.dark-theme .arcv-meta-value,
body.dark-theme .arcv-meta-value-mono {
    color: #e1e1e1 !important;
}

body.dark-theme .arcv-toolbar {
    background: #2a2a2a !important;
}
body.dark-theme .arcv-toolbar-label {
    color: #aaaaaa !important;
}

/* Фильтры-чипы */
body.dark-theme .fchip-all {
    background: #3a3a3a !important;
    color: #cccccc !important;
}
body.dark-theme .fchip-changed {
    background: rgba(194,65,12,0.2) !important;
    color: #fb923c !important;
}
body.dark-theme .fchip-deleted {
    background: rgba(185,28,28,0.2) !important;
    color: #fca5a5 !important;
}
body.dark-theme .fchip-new {
    background: rgba(21,128,61,0.2) !important;
    color: #4ade80 !important;
}
body.dark-theme .fchip-same {
    background: rgba(22,101,52,0.15) !important;
    color: #6ee7b7 !important;
    border-color: rgba(22,101,52,0.3) !important;
}
body.dark-theme .fchip.active {
    border-color: #e1e1e1 !important;
    box-shadow: 0 0 0 3px rgba(225,225,225,0.1) !important;
}

/* Легенда */
body.dark-theme .arcv-legend-item {
    color: #aaaaaa !important;
}

/* Обёртка таблицы просмотра */
body.dark-theme .arcv-wrap {
    background: #212121 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

body.dark-theme .arcv-table {
    background: #212121 !important;
}

body.dark-theme .arcv-table thead th {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
    border-bottom-color: #3a3a3a !important;
}

body.dark-theme .arcv-table tbody td {
    color: #cccccc !important;
    border-bottom-color: #3a3a3a !important;
}

/* Строки по статусу изменений */
body.dark-theme .row-changed td {
    background: rgba(245,158,11,0.08) !important;
}
body.dark-theme .row-deleted td {
    background: rgba(185,28,28,0.1) !important;
    color: #fca5a5 !important;
}
body.dark-theme .row-new td {
    background: rgba(16,185,129,0.08) !important;
}

/* Изменённые ячейки */
body.dark-theme .cell-changed {
    background: rgba(194,65,12,0.25) !important;
    color: #fb923c !important;
}
body.dark-theme .cell-diff-old {
    color: #fca5a5 !important;
}
body.dark-theme .cell-diff-new {
    color: #4ade80 !important;
}
body.dark-theme .cell-diff-arrow {
    color: #777777 !important;
}

/* Бейджи статуса строк */
body.dark-theme .sbadge-changed {
    background: rgba(194,65,12,0.2) !important;
    border-color: rgba(194,65,12,0.3) !important;
    color: #fb923c !important;
}
body.dark-theme .sbadge-deleted {
    background: rgba(185,28,28,0.2) !important;
    border-color: rgba(185,28,28,0.3) !important;
    color: #fca5a5 !important;
}
body.dark-theme .sbadge-new {
    background: rgba(21,128,61,0.2) !important;
    border-color: rgba(21,128,61,0.3) !important;
    color: #4ade80 !important;
}
body.dark-theme .sbadge-same {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    color: #777777 !important;
}

/* Кнопка скачать в header */
body.dark-theme .arcv-dl-btn {
    background: #181818 !important;
    border-color: rgba(74,222,128,0.4) !important;
    color: #4ade80 !important;
}
body.dark-theme .arcv-dl-btn:hover {
    background: rgba(16,185,129,0.1) !important;
}

/* ══════════════════════════════════════════════════════════════
   STATISTICS - кнопки периода и экспорта
   ══════════════════════════════════════════════════════════════ */

body.dark-theme .period-toggle {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .period-btn {
    color: #aaaaaa !important;
}

body.dark-theme .period-btn:not(.active):hover {
    background: #3a3a3a !important;
    color: #e1e1e1 !important;
}

/* В светлой теме активная кнопка периода стала белой плашкой, т.к. на
   светлом фоне страницы фиолетовый градиент сливался с фоном. В тёмной
   теме страница и так тёмная, поэтому фиолетовый градиент с прошлого
   поведения остаётся - контраст был не при чём. */
body.dark-theme .period-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    box-shadow: none;
}

/* ── Пикер дат (глобальный) ── */
body.dark-theme .date-range-dropdown {
    background: #212121 !important;
    border-color: #3a3a3a !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
body.dark-theme .date-range-label {
    color: #aaaaaa !important;
}
body.dark-theme .date-range-hint {
    color: #666666 !important;
}
body.dark-theme .date-range-preset-btn {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
    color: #aaaaaa !important;
}
body.dark-theme .date-range-preset-btn:hover,
body.dark-theme .date-range-preset-btn.active {
    background: #1e1a40 !important;
    border-color: #6366f1 !important;
    color: #818cf8 !important;
}
body.dark-theme .date-range-dropdown::before {
    background: #444444 !important;
}

/* ══════════════════════════════════════════════════════════════
   WAREHOUSE - содержимое карточек товаров
   ══════════════════════════════════════════════════════════════ */

body.dark-theme .product-sku {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.dark-theme .product-info-label {
    color: #777777 !important;
}

body.dark-theme .product-info-value {
    color: #e1e1e1 !important;
}

body.dark-theme .product-prices {
    border-top-color: #3a3a3a !important;
}

body.dark-theme .price-badge.available {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border-color: rgba(110, 231, 183, 0.3) !important;
}

body.dark-theme .price-badge.unavailable {
    background: rgba(153, 27, 27, 0.15) !important;
    color: #fca5a5 !important;
    border-color: rgba(252, 165, 165, 0.3) !important;
}

body.dark-theme .price-badge.quantity {
    background: rgba(30, 64, 175, 0.2) !important;
    color: #93c5fd !important;
    border-color: rgba(147, 197, 253, 0.3) !important;
}

body.dark-theme .preorder-badge {
    background: rgba(252, 211, 77, 0.15) !important;
    color: #fcd34d !important;
    border-color: rgba(252, 211, 77, 0.3) !important;
}

/* ── Модалка сравнения SKU ── */
body.dark-theme .compare-modal-header {
    background: linear-gradient(135deg, #1e1e2e 0%, #252540 100%) !important;
    border-bottom-color: #3a3a3a !important;
}
body.dark-theme .compare-modal-title-text { color: #e1e1e1 !important; }
body.dark-theme .compare-modal-subtitle { color: #aaaaaa !important; }
body.dark-theme .compare-close-btn {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
    border: 1px solid #3a3a3a !important;
}
body.dark-theme .compare-close-btn:hover { background: #333 !important; color: #e1e1e1 !important; }

body.dark-theme .compare-stat-card {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .compare-stat-card.danger { background: rgba(220,38,38,0.12) !important; border-color: rgba(220,38,38,0.3) !important; }
body.dark-theme .compare-stat-card.success { background: rgba(22,163,74,0.12) !important; border-color: rgba(22,163,74,0.3) !important; }
body.dark-theme .compare-stat-number { color: #e1e1e1 !important; }
body.dark-theme .compare-stat-card.danger .compare-stat-number { color: #f87171 !important; }
body.dark-theme .compare-stat-card.success .compare-stat-number { color: #4ade80 !important; }
body.dark-theme .compare-stat-label { color: #aaaaaa !important; }

body.dark-theme .compare-warning-banner {
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.1)) !important;
    border-color: rgba(245,158,11,0.4) !important;
    color: #fcd34d !important;
}
body.dark-theme .compare-sku-item {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .compare-sku-item:hover { background: #333 !important; border-color: #555 !important; }
body.dark-theme .compare-sku-code { color: #e1e1e1 !important; }
body.dark-theme .compare-sku-badge {
    background: rgba(220,38,38,0.2) !important;
    border-color: rgba(220,38,38,0.35) !important;
    color: #f87171 !important;
}

body.dark-theme .compare-success-title { color: #4ade80 !important; }
body.dark-theme .compare-success-desc { color: #aaaaaa !important; }
body.dark-theme .compare-loading { color: #aaaaaa !important; }
body.dark-theme .compare-spinner { border-color: #3a3a3a !important; border-top-color: #818cf8 !important; }
body.dark-theme .compare-error {
    background: rgba(220,38,38,0.12) !important;
    border-color: rgba(220,38,38,0.3) !important;
    color: #f87171 !important;
}
body.dark-theme .compare-modal-footer {
    background: #212121 !important;
    border-top-color: #3a3a3a !important;
}

/* ── editor.html: мастер добавления - недостающие элементы ── */
body.dark-theme .master-preview {
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
}

/* Заголовок «Примеры SKU для добавления:» - той же яркости, что и подписи
   счётчиков выше (.master-stat-label): в светлой теме у него тёмно-серый
   #374151, и на тёмной подложке он выпадал из общего ряда. */
body.dark-theme .master-preview-title {
    color: #aaaaaa !important;
}

/* Сами SKU: в светлой теме это белые плашки, поэтому в тёмной они оставались
   белыми прямоугольниками. */
body.dark-theme .sku-badge {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .sku-badge.more {
    background: rgba(139, 92, 246, 0.25) !important;
    border-color: rgba(167, 139, 250, 0.4) !important;
    color: #c4b5fd !important;
}

body.dark-theme #masterCalcPreview {
    background: rgba(16,185,129,0.1) !important;
    border-color: rgba(16,185,129,0.3) !important;
    color: #6ee7b7 !important;
}

/* Скроллбар master-modal-content */
body.dark-theme .master-modal-content::-webkit-scrollbar-track {
    background: #1a1a1a !important;
}
body.dark-theme .master-modal-content::-webkit-scrollbar-thumb {
    background: #3a3a3a !important;
}
body.dark-theme .master-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555555 !important;
}

/* ── Калькулятор min_price: hardcoded inline-style блоки ── */
body.dark-theme .calc-formula-box {
    background: rgba(16,185,129,0.08) !important;
    border-color: rgba(16,185,129,0.25) !important;
}
body.dark-theme .calc-formula-title {
    color: #6ee7b7 !important;
}
body.dark-theme .calc-formula-text {
    color: #a7f3d0 !important;
}

body.dark-theme .calc-kaspi-box {
    background: rgba(245,158,11,0.1) !important;
    border-color: rgba(245,158,11,0.3) !important;
}
body.dark-theme .calc-kaspi-label,
body.dark-theme .calc-kaspi-hint {
    color: #fcd34d !important;
}
body.dark-theme .calc-kaspi-value {
    color: #fbbf24 !important;
}

body.dark-theme .calc-rates-box {
    background: #1a1a1a !important;
}
body.dark-theme .calc-rates-label {
    color: #777777 !important;
}

body.dark-theme .timezone-label {
    color: #cbd5e1 !important;
}

/* ── Расписание тёмной темы ── */
body.dark-theme .theme-schedule-toggle {
    background: linear-gradient(135deg, #1e1b4b 0%, #1a1a3a 100%) !important;
    border-color: #3730a3 !important;
}

body.dark-theme .theme-schedule-panel {
    background: linear-gradient(135deg, #181818 0%, #212121 100%) !important;
    border-color: #3a3a3a !important;
}

body.dark-theme .theme-time-label {
    color: #94a3b8 !important;
}

body.dark-theme .theme-time-input {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    color: #e1e1e1 !important;
}

body.dark-theme .theme-time-input:hover {
    border-color: #6366f1 !important;
}

body.dark-theme .theme-time-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

body.dark-theme .theme-schedule-arrow {
    color: #4b5563 !important;
}

body.dark-theme .theme-schedule-tz {
    color: #4b5563 !important;
}

body.dark-theme .theme-schedule-tz strong {
    color: #94a3b8 !important;
}

/* ── Hamburger button (dark theme) ── */
body.dark-theme .hamburger-btn {
    background: rgba(102, 126, 234, 0.12) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

body.dark-theme .hamburger-btn:hover {
    background: rgba(102, 126, 234, 0.25) !important;
    border-color: rgba(102, 126, 234, 0.55) !important;
}

body.dark-theme .hamburger-btn span {
    background: #818cf8 !important;
}

/* ── Card collapse button (dark theme) ── */
body.dark-theme .card-collapse-btn {
    background: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .card-collapse-btn:hover {
    background: #475569 !important;
}

body.dark-theme .card-collapse-chevron {
    stroke: #94a3b8;
}

/* ── История VDS/VPS модал ── */

/* Оверлей и базовый фон карточки */
body.dark-theme #statsHistoryModal .acc-modal {
    background: #1a1a2e !important;
}

/* Тело модала (inline style="background:#fff") */
body.dark-theme #statsHistoryModal > div > div:nth-child(2) {
    background: #1a1a2e !important;
}

/* Состояние загрузки и пустое состояние */
body.dark-theme #statsHistoryLoading,
body.dark-theme #statsHistoryEmpty {
    background: #1a1a2e !important;
    color: #94a3b8 !important;
}
/* Иконка пустого состояния */
body.dark-theme #statsHistoryEmpty > div:first-child {
    background: #252540 !important;
}
/* Заголовок пустого состояния */
body.dark-theme #statsHistoryEmptyText {
    color: #e2e8f0 !important;
}

/* Сводная полоса метрик */
body.dark-theme #statsHistorySummaryBar {
    border-bottom-color: #2a2a3a !important;
}
body.dark-theme #statsHistorySummaryBar > div {
    background: #1e1e30 !important;
    border-right: 1px solid #2a2a3a !important;
}
/* Иконки-плашки (colored backgrounds) */
body.dark-theme #statsHistorySummaryBar [style*="background:#eef2ff"] { background: #1e1b4b !important; }
body.dark-theme #statsHistorySummaryBar [style*="background:#f0fdf4"] { background: #052e16 !important; }
body.dark-theme #statsHistorySummaryBar [style*="background:#fffbeb"] { background: #1c1408 !important; }
body.dark-theme #statsHistorySummaryBar [style*="background:#f5f3ff"] { background: #1e1340 !important; }
body.dark-theme #statsHistorySummaryBar [style*="background:#f0f9ff"] { background: #0c1a2e !important; }
body.dark-theme #statsHistorySummaryBar [style*="background:#f0fdfa"] { background: #022c22 !important; }
/* Метки и подписи */
body.dark-theme #statsHistorySummaryBar [style*="color:#64748b"] { color: #64748b !important; }
body.dark-theme #statsHistorySummaryBar [style*="color:#94a3b8"] { color: #4a5568 !important; }

/* Область легенды + графика */
body.dark-theme #statsHistoryContent > div:last-child {
    background: #1a1a2e !important;
}

/* Обёртка canvas (background:#fafbff, border:#e8eaf0) */
body.dark-theme #statsHistoryContent > div:last-child > div:last-child {
    background: #1e1e2e !important;
    border-color: #2a2a3a !important;
}

/* Чипы легенды */
body.dark-theme .chart-chip-on {
    background: color-mix(in srgb, var(--chip-color) 18%, #1e1e2e) !important;
    border-color: color-mix(in srgb, var(--chip-color) 45%, transparent) !important;
    color: #e2e8f0 !important;
}
body.dark-theme .chart-chip-off {
    background: #2a2a3a !important;
    border-color: #3a3a4a !important;
    color: #64748b !important;
}

/* Футер */
body.dark-theme #statsHistoryModal > div > div:last-child {
    background: #141420 !important;
    border-top: 1px solid #2a2a3a !important;
}
/* Кнопка "Очистить историю" */
body.dark-theme #statsHistoryModal > div > div:last-child button:first-child {
    background: transparent !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}
body.dark-theme #statsHistoryModal > div > div:last-child button:first-child:hover {
    background: #1c0a0a !important;
}

/* ── Карточки складов в "Названия складов" ── */
body.dark-theme #tgWarehouseNamesContainer > div {
    background: #212121 !important;
    border-color: #3a3a3a !important;
}

body.dark-theme #tgWarehouseNamesContainer > div span[style*="background:#ede9fe"] {
    background: #2e1a5e !important;
}

body.dark-theme #tgWarehouseNamesContainer input {
    background: #2a2a2a !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

/* ── Карточка "Обновление проекта" - нижняя полоска ── */
body.dark-theme #restartCard > div:last-child {
    background: #181818 !important;
    border-top-color: #3a3a3a !important;
}

body.dark-theme #restartCard > div:last-child span:first-child {
    color: #64748b !important;
}

/* ── Кнопка "Входы" в таблице аккаунтов ── */
body.dark-theme .acc-btn-logins {
    background: #0c3a5e !important;
    color: #38bdf8 !important;
}

/* ── Модал истории входов по аккаунту ── */
body.dark-theme #accountIpHistoryModal .acc-modal-body {
    background: #212121 !important;
}
body.dark-theme #accountIpHistoryModal #accIpModalLoading {
    color: #777777 !important;
}
body.dark-theme #accountIpHistoryModal #accIpModalEmpty div:nth-child(2) {
    color: #cccccc !important;
}
body.dark-theme #accountIpHistoryModal #accIpModalEmpty div:nth-child(3) {
    color: #666666 !important;
}
body.dark-theme #accountIpHistoryModal .ip-history-table {
    background: #212121 !important;
}

/* ── История входов по IP ── */
body.dark-theme .iph-row {
    border-bottom-color: #2e2e2e !important;
}
body.dark-theme .iph-row:hover {
    background: #1a2a35 !important;
}
body.dark-theme .iph-ip {
    color: #38bdf8 !important;
}
body.dark-theme .iph-geo {
    color: #cccccc !important;
}
body.dark-theme .iph-date {
    color: #888888 !important;
}
body.dark-theme .iph-empty {
    color: #555555 !important;
}
body.dark-theme #ipHistoryModal .acc-modal-body {
    background: #212121 !important;
}
body.dark-theme #ipHistoryModal .ip-history-table {
    background: #212121 !important;
}

/* ══════════════════════════════════════════════════════════════
   СТРАНИЦА АВТООБНОВЛЕНИЯ ПРЕДЗАКАЗА (/preorder-update/)
   ══════════════════════════════════════════════════════════════ */

/* Модал редактирования времени запуска - внутренний контейнер */
body.dark-theme #time-editor-overlay > div {
    background: #212121 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

/* Поле ввода времени */
body.dark-theme #input-run-time {
    background: #181818 !important;
    border-color: #555555 !important;
    color: #e1e1e1 !important;
}

body.dark-theme #input-run-time:focus {
    border-color: #667eea !important;
}

/* Подсказка "В часовом поясе из настроек" */
body.dark-theme #time-editor-overlay div[style*="color:#64748b"] {
    color: #64748b !important;
}

/* Кнопка "Отмена" в модале */
body.dark-theme #time-editor-overlay div[style*="display:flex"] button:first-child {
    border-color: #3a3a3a !important;
    color: #94a3b8 !important;
    background: transparent !important;
}

body.dark-theme #time-editor-overlay div[style*="display:flex"] button:first-child:hover {
    background: #2a2a2a !important;
}

/* Модал выбора режима откладки */
body.dark-theme #postpone-editor-overlay > div {
    background: #212121 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .pde-btn {
    border-color: #3a3a3a !important;
}

body.dark-theme .pde-btn:hover {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.08) !important;
}

body.dark-theme .pde-btn.active {
    border-color: #667eea !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

body.dark-theme .pde-title { color: #e1e1e1 !important; }
body.dark-theme .pde-desc  { color: #94a3b8 !important; }
body.dark-theme .pde-num   { color: #818cf8 !important; }

body.dark-theme .pde-btn.active .pde-title,
body.dark-theme .pde-btn.active .pde-desc,
body.dark-theme .pde-btn.active .pde-num { color: #fff !important; }

body.dark-theme .pde-cancel {
    border-color: #3a3a3a !important;
    color: #94a3b8 !important;
}

body.dark-theme .pde-cancel:hover {
    background: #2a2a2a !important;
}

/* ══════════════════════════════════════════════════════════
   Современные карточки заказов (orders.css)
   ══════════════════════════════════════════════════════════ */

/* Общий фон всех карточек/панелей */
body.dark-theme .orders-control-panel,
body.dark-theme .orders-tabs,
body.dark-theme .orders-settings-card,
body.dark-theme .orders-order-card,
body.dark-theme .orders-detail-card,
body.dark-theme .orders-filter-bar {
    background: rgba(30, 30, 34, 0.97) !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45) !important;
}

body.dark-theme .orders-order-card:hover {
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.6) !important;
    border-color: #3a3a48 !important;
}

/* Таблетки-метрики */
body.dark-theme .orders-metric-pill {
    background: linear-gradient(180deg, #232329 0%, #1a1a20 100%) !important;
    border-color: #2e2e38 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .orders-metric-pill strong { color: #f0f0f0 !important; }
body.dark-theme .orders-metric-pill span  { color: #6b7280 !important; }

body.dark-theme .orders-auto-pill {
    background: #0d2e20 !important;
    border-color: #0f5c38 !important;
    color: #34d399 !important;
}
body.dark-theme .orders-auto-pill strong,
body.dark-theme .orders-auto-pill span { color: #34d399 !important; }

/* Табы */
body.dark-theme .orders-tab { color: #6b7280 !important; }
body.dark-theme .orders-tab.active {
    background: #2a2a32 !important;
    color: #e1e1e1 !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .orders-tab b {
    background: #1e1a40 !important;
    color: #818cf8 !important;
}

/* Разделитель дат */
body.dark-theme .orders-date-chip {
    background: rgba(30, 30, 38, 0.9) !important;
    border-color: #2e2e3a !important;
    color: #6b7280 !important;
}
body.dark-theme .orders-date-chip b {
    background: #252530 !important;
    color: #818cf8 !important;
}

/* Внутри карточки заказа */
body.dark-theme .orders-order-top {
    border-bottom-color: #2e2e38 !important;
}
body.dark-theme .orders-order-id  { color: #e1e1e1 !important; }
body.dark-theme .orders-order-price { color: #f0f0f0 !important; }
body.dark-theme .orders-order-time  { color: #6b7280 !important; }
body.dark-theme .orders-order-arrow { color: #3a3a48 !important; }
body.dark-theme .orders-product-line { color: #b0b8c8 !important; }
body.dark-theme .orders-more-products { color: #6b7280 !important; }

/* Позиция, удалённая из заказа */
body.dark-theme .orders-product-line-removed > span:first-of-type { color: #6b7280 !important; }
body.dark-theme .orders-product-removed-tag {
    background: rgba(220, 38, 38, 0.16) !important;
    color: #fca5a5 !important;
}

/* Значки статуса */
body.dark-theme .orders-status-blue   { background: rgba(37, 99, 235, 0.18) !important; color: #93c5fd !important; }
body.dark-theme .orders-status-green  { background: rgba(21, 128, 61, 0.2)  !important; color: #6ee7b7 !important; }
body.dark-theme .orders-status-red    { background: rgba(185, 28, 28, 0.22) !important; color: #fca5a5 !important; }
body.dark-theme .orders-status-yellow { background: rgba(146, 64, 14, 0.22) !important; color: #fcd34d !important; }
body.dark-theme .orders-status-purple { background: rgba(109, 40, 217, 0.22) !important; color: #c4b5fd !important; }
body.dark-theme .orders-status-teal   { background: rgba(15, 118, 110, 0.22)  !important; color: #5eead4 !important; }

/* Строка поиска и дата-инпуты */
body.dark-theme .orders-filter-bar .orders-search-input {
    background: #111116 !important;
    border-color: #2e2e38 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .orders-filter-bar .orders-search-input:focus {
    border-color: #3b82ff !important;
    background: #18181f !important;
}
body.dark-theme .orders-filter-bar .orders-search-input::placeholder { color: #4b5563 !important; }

body.dark-theme .orders-date-range {
    background: #111116 !important;
    border-color: #2e2e38 !important;
}
body.dark-theme .orders-date-range:focus-within {
    border-color: #3b82ff !important;
    background: #16233b !important;
}
/* input[type="text"].orders-date-input (не просто .orders-date-input) - иначе
   проигрывает по специфичности общему body.dark-theme input[type="text"]
   (см. "Формы" в начале файла): у него !important и на элемент, и на
   атрибут разом, значит и переопределять его нужно селектором не менее
   специфичным - иначе не только цвета (в т.ч. чужая серая рамка вместо
   прозрачной), но и background-image (иконка календаря, у shorthand
   background своего в общем правиле нет, поэтому без явного
   переопределения она пропадает) откатываются к тому правилу. */
body.dark-theme input[type="text"].orders-date-input {
    background-color: #18181f !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 8px center !important;
    background-size: 13px 13px !important;
    border-color: transparent !important;
    color: #e1e1e1 !important;
    color-scheme: dark;
}
body.dark-theme input[type="text"].orders-date-input:hover { background-color: #1d1d26 !important; }
body.dark-theme input[type="text"].orders-date-input:focus {
    border-color: #3b82ff !important;
    background-color: #18181f !important;
}
body.dark-theme .orders-date-sep { color: #4b5563 !important; }

body.dark-theme .orders-search-clear {
    background: #2a2a32 !important;
    color: #9ca3af !important;
}
body.dark-theme .orders-search-clear:hover { background: #3a3a44 !important; }
body.dark-theme .orders-search-icon { color: #4b5563 !important; }

/* Кнопка "Расширенный поиск" */
body.dark-theme .orders-adv-search-btn {
    background: #111116 !important;
    border-color: #2e2e38 !important;
    color: #8a9bb0 !important;
}
body.dark-theme .orders-adv-search-btn:hover {
    background: #1a1a22 !important;
    border-color: #3a3a48 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .orders-adv-search-btn.active {
    background: #1e1a40 !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}
body.dark-theme .advsearch-modal .clr-body input:focus { border-color: #6366f1 !important; }
body.dark-theme .orders-adv-search-btn.expanded {
    background: #1e1a40 !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}
body.dark-theme .orders-adv-search-panel .clr-body--grid,
body.dark-theme .orders-adv-search-panel .clr-footer {
    background: #1a1a22 !important;
    border-color: #2e2e38 !important;
}

/* Чипы фильтра статуса */
body.dark-theme .orders-filter-chip {
    background: #111116 !important;
    border-color: #2e2e38 !important;
    color: #8a9bb0 !important;
}
body.dark-theme .orders-filter-chip:hover {
    background: #1a1a22 !important;
    border-color: #3a3a48 !important;
}
body.dark-theme .orders-filter-chip.active {
    background: #1e1a40 !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}
body.dark-theme .orders-filter-chip-green.active {
    background: #0d2e20 !important;
    border-color: #059669 !important;
    color: #6ee7b7 !important;
}
body.dark-theme .orders-filter-chip-red.active {
    background: #2e1a1a !important;
    border-color: #dc2626 !important;
    color: #fca5a5 !important;
}
body.dark-theme .orders-filter-chip-yellow.active {
    background: #2a1f0a !important;
    border-color: #d97706 !important;
    color: #fcd34d !important;
}
body.dark-theme .orders-filter-chip-purple.active {
    background: #241a3d !important;
    border-color: #7c3aed !important;
    color: #c4b5fd !important;
}

/* Блок настроек */
body.dark-theme .orders-storage-summary {
    border-bottom-color: #2e2e38 !important;
}
body.dark-theme .orders-storage-item {
    background: linear-gradient(180deg, #1e1e26 0%, #17171e 100%) !important;
    border-color: #2e2e38 !important;
}
body.dark-theme .orders-storage-item span,
body.dark-theme .orders-storage-item small { color: #6b7280 !important; }
body.dark-theme .orders-storage-item strong { color: #e1e1e1 !important; }

body.dark-theme .orders-settings-block {
    border-bottom-color: #2e2e38 !important;
}
body.dark-theme .orders-settings-block label,
body.dark-theme .orders-logs-head h2 { color: #e1e1e1 !important; }
body.dark-theme .orders-settings-block p,
body.dark-theme .orders-logs-head span { color: #6b7280 !important; }

body.dark-theme .orders-input-row input {
    background: #111116 !important;
    border-color: #2e2e38 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .orders-input-row input:focus {
    border-color: #3b82ff !important;
    background: #18181f !important;
}
body.dark-theme .orders-input-row > span { color: #6b7280 !important; }

body.dark-theme .orders-help-box {
    background: #1e1a40 !important;
    border-color: #3730a3 !important;
    color: #a5b4fc !important;
}

/* Кнопки логов */
body.dark-theme .orders-log-btn {
    background: #1a1a22 !important;
    border-color: #2e2e38 !important;
    color: #8a9bb0 !important;
}
body.dark-theme .orders-log-btn:hover:not(:disabled) {
    background: #252530 !important;
    border-color: #3a3a48 !important;
    color: #e1e1e1 !important;
}
body.dark-theme .orders-log-btn-danger {
    background: #1e1010 !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

/* Кнопка «Очистить» (danger outline) */
body.dark-theme .orders-btn-danger {
    background: #1e1010 !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

/* Пустое состояние */
body.dark-theme .orders-empty-state {
    background: rgba(24, 24, 30, 0.92) !important;
    border-color: #2e2e38 !important;
    color: #6b7280 !important;
}

/* ── Детальная страница заказа ── */

body.dark-theme .orders-detail-card h2 {
    color: #e1e1e1 !important;
    border-bottom-color: #2e2e38 !important;
}
body.dark-theme .orders-detail-card-header {
    border-bottom-color: #2e2e38 !important;
}
body.dark-theme .orders-track-btn {
    background: #181818 !important;
    border-color: rgba(129,140,248,0.4) !important;
    color: #818cf8 !important;
}
body.dark-theme .orders-track-btn:hover {
    background: rgba(99,102,241,0.1) !important;
    border-color: #818cf8 !important;
}
body.dark-theme .orders-detail-label  { color: #6b7280 !important; }
body.dark-theme .orders-detail-value  { color: #e1e1e1 !important; }
body.dark-theme .orders-detail-value.success { color: #34d399 !important; }
body.dark-theme .orders-detail-subtle { color: #9ca3af !important; }

body.dark-theme .orders-detail-product {
    border-top-color: #2e2e38 !important;
}
body.dark-theme .orders-detail-product-name  { color: #e1e1e1 !important; }
body.dark-theme .orders-detail-product-sku   {
    border-color: #2e2e38 !important;
    color: #6b7280 !important;
}
body.dark-theme .orders-detail-product-price  { color: #f0f0f0 !important; }
body.dark-theme .orders-detail-product-removed .orders-detail-product-name,
body.dark-theme .orders-detail-product-removed .orders-detail-product-price { color: #6b7280 !important; }
body.dark-theme .orders-detail-product-removed-badge {
    background: rgba(220, 38, 38, 0.16) !important;
    color: #fca5a5 !important;
}

body.dark-theme .orders-detail-product-qty-badge {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #fcd34d !important;
}
body.dark-theme .orders-detail-product-profit { color: #34d399 !important; }

body.dark-theme .orders-product-img { background: #1e1e26 !important; }

/* ── Dashboard price calculator - dark styles via shared classes ──
   .modal-content, .modal-header, .modal-footer → lines 242-256
   .form-group-wizard input/select              → lines 2346-2352
   .calc-formula-box/title/text                 → lines 3380-3389
   .calc-kaspi-box/label/value/hint             → lines 3391-3401
   .calc-rates-box/label                        → lines 3403-3408
   .cancel-btn                                  → lines 1642-1651
   ── no extra overrides needed ── */
body.dark-theme .dc-close-btn { color: #aaaaaa !important; }
body.dark-theme .dc-weight-hint { color: #777777 !important; }
body.dark-theme .dc-weight-cost { color: #34d399 !important; }

/* ── KD Zone groups - dark theme ── */
body.dark-theme .kd-zone-group {
    border-color: #2e2e40 !important;
}
body.dark-theme .kd-zone-toggle--city {
    background: linear-gradient(135deg, #1e2a45 0%, #1e3a5f 100%) !important;
    color: #93c5fd !important;
}
body.dark-theme .kd-zone-toggle--kz {
    background: linear-gradient(135deg, #14291a 0%, #1a3a22 100%) !important;
    color: #86efac !important;
}
body.dark-theme .kd-zone-toggle--express {
    background: linear-gradient(135deg, #2d1515 0%, #3d1a1a 100%) !important;
    color: #fca5a5 !important;
}
body.dark-theme .kd-zone-body {
    background: #16161e !important;
}

/* ── Модальное окно "Заполнить productCode" ── */
body.dark-theme #fillPcModal .modal-body {
    color: #e1e1e1 !important;
}
body.dark-theme #fillPcModal label {
    color: #e1e1e1 !important;
}
body.dark-theme #fillPcModal .fill-pc-warning {
    background: rgba(245,158,11,0.1) !important;
    border-color: rgba(245,158,11,0.3) !important;
    color: #fcd34d !important;
}
body.dark-theme #fillPcModal .fill-pc-warning code {
    color: #fbbf24 !important;
}
body.dark-theme #fillPcProgressLabel {
    color: #e1e1e1 !important;
}
body.dark-theme #fillPcProgressCount {
    color: #aaaaaa !important;
}
body.dark-theme #fillPcModal .fill-pc-track {
    background: #3a3a3a !important;
}
body.dark-theme #fillPcResultList {
    scrollbar-color: #3a3a3a #212121;
}

/* ── НКТ РК (/nct/) - dark theme ── */
body.dark-theme .nct-notice {
    background: rgba(14,165,233,0.1) !important;
    border-color: rgba(14,165,233,0.3) !important;
    color: #7dd3fc !important;
}
body.dark-theme .nct-stat-card {
    box-shadow: 0 4px 14px rgba(0,0,0,0.35) !important;
}
body.dark-theme .nct-step-badge {
    background: #3a3a4a !important;
}
body.dark-theme .nct-count-badge {
    color: #999999 !important;
}
body.dark-theme .nct-pill-loading {
    background: #262636 !important;
    border-color: #2e2e40 !important;
    color: #999999 !important;
}
body.dark-theme .nct-pill-ok {
    background: rgba(34,197,94,0.12) !important;
    border-color: rgba(34,197,94,0.35) !important;
    color: #86efac !important;
}
body.dark-theme .nct-pill-none {
    background: rgba(220,38,38,0.12) !important;
    border-color: rgba(220,38,38,0.35) !important;
    color: #f87171 !important;
}
body.dark-theme .nct-modal {
    background: #1a1a24 !important;
}
body.dark-theme .nct-modal-header {
    border-bottom-color: #2e2e40 !important;
}
body.dark-theme .nct-modal-header-text h3 {
    color: #e1e1e1 !important;
}
body.dark-theme .nct-modal-header-text p {
    color: #999999 !important;
}
body.dark-theme .nct-modal-close {
    color: #777777 !important;
}
body.dark-theme .nct-modal-close:hover {
    color: #aaaaaa !important;
}
body.dark-theme .nct-extra-attrs {
    background: #1a1a24 !important;
    border-color: #2e2e40 !important;
}
body.dark-theme .nct-extra-attrs-title,
body.dark-theme .nct-extra-attrs-hint {
    color: #999999 !important;
}
body.dark-theme .nct-oktru-crumb {
    color: #c4b5fd !important;
}
body.dark-theme .nct-oktru-crumb:hover {
    background: rgba(139,92,246,0.15) !important;
}
body.dark-theme .nct-oktru-crumb-sep {
    color: #666666 !important;
}
body.dark-theme .nct-oktru-list {
    background: #1a1a24 !important;
    border-color: #2e2e40 !important;
}
body.dark-theme .nct-oktru-item {
    background: #212130 !important;
    border-color: #2e2e40 !important;
}
body.dark-theme .nct-oktru-item-main {
    color: #e1e1e1 !important;
}
body.dark-theme .nct-oktru-item-code,
body.dark-theme .nct-oktru-item-path {
    color: #777777 !important;
}
body.dark-theme .nct-oktru-select-btn {
    background: #7c3aed !important;
}
body.dark-theme .nct-oktru-select-btn:hover {
    background: #6d28d9 !important;
}
body.dark-theme .nct-selected-oktru {
    background: rgba(139,92,246,0.15) !important;
    border-color: rgba(139,92,246,0.35) !important;
    color: #c4b5fd !important;
}
body.dark-theme .nct-oktru-clear-btn {
    color: #c4b5fd !important;
}
body.dark-theme .nct-empty {
    color: #777777 !important;
}
body.dark-theme .nct-empty-error {
    color: #f87171 !important;
}
body.dark-theme .nct-checkbox-label {
    color: #aaaaaa !important;
}
body.dark-theme .nct-table-wrap {
    border-color: #2e2e40 !important;
}
body.dark-theme .nct-table thead th {
    background: #1a1a24 !important;
    color: #999999 !important;
    border-bottom-color: #2e2e40 !important;
}
body.dark-theme .nct-table tbody td {
    border-bottom-color: #262636 !important;
}
body.dark-theme .nct-table tbody tr:hover td {
    background: #1e1e2a !important;
}
body.dark-theme .nct-sku {
    color: #aaaaaa !important;
}
body.dark-theme .nct-badge-none {
    background: #262636 !important;
    color: #777777 !important;
}
body.dark-theme .nct-badge-neutral {
    background: #262636 !important;
    color: #aaaaaa !important;
}
body.dark-theme .nct-badge-progress {
    background: rgba(245,158,11,0.15) !important;
    color: #fcd34d !important;
}
body.dark-theme .nct-badge-warn {
    background: rgba(249,115,22,0.15) !important;
    color: #fdba74 !important;
}
body.dark-theme .nct-badge-error {
    background: rgba(220,38,38,0.15) !important;
    color: #f87171 !important;
}
body.dark-theme .nct-badge-success {
    background: rgba(34,197,94,0.15) !important;
    color: #86efac !important;
}
body.dark-theme .nct-actions #nctSelectedCount {
    color: #999999 !important;
}
body.dark-theme .nct-progress {
    background: #262636 !important;
}
body.dark-theme .nct-mobile-sendbar {
    background: #181818 !important;
    border-top-color: #3a3a3a !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .nct-mobile-sendbar-count {
    color: #aaaaaa !important;
}
body.dark-theme .nct-mobile-sendbar-btn:disabled {
    background: #3a3a3a !important;
}
@media (max-width: 768px) {
    /* Мобильная трансформация таблицы в карточки (nct-mobile.css) задаёт
       строке белый фон напрямую - .nct-table tbody td уже покрыт тёмной
       темой выше, но сама "карточка"-строка (tr) в тёмной теме оставалась
       белым прямоугольником на тёмном фоне. */
    body.dark-theme .nct-table tbody tr {
        background: #212121 !important;
        border-color: #3a3a3a !important;
    }
    /* nct-mobile.css задаёт этим ячейкам жёсткий тёмный цвет текста
       (#334155/#1e293b) в расчёте на белую карточку - на новом тёмном
       фоне строки (см. выше) он становился практически нечитаемым
       (тёмный текст на тёмном фоне). */
    body.dark-theme .nct-table tbody td:nth-child(3) {
        color: #cccccc !important;
        border-top-color: #3a3a3a !important;
    }
    body.dark-theme .nct-table tbody td:nth-child(4),
    body.dark-theme .nct-table tbody td:nth-child(6),
    body.dark-theme .nct-table tbody td:nth-child(7) {
        color: #e1e1e1 !important;
        border-top-color: #333333 !important;
    }
    body.dark-theme .nct-table tbody td:nth-child(4)::before,
    body.dark-theme .nct-table tbody td:nth-child(6)::before,
    body.dark-theme .nct-table tbody td:nth-child(7)::before {
        color: #777777 !important;
    }
}

/* ── Панель периода и выгрузки на /statistics/ (новый вид) ──
   Кнопка периода и группа выгрузки в светлой теме - белые плашки на
   фиолетовой шапке. В тёмной теме белый фон слепил бы, поэтому те же
   элементы собираются на тёмной поверхности; цвет формата остаётся на
   иконке, как и в светлой. */
body.dark-theme .period-btn.period-date-btn,
body.dark-theme .period-btn.period-date-btn.active {
    background: #2a2a35 !important;
    border-color: #3a3a48 !important;
    color: #e1e1e1 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35) !important;
}
body.dark-theme .period-btn.period-date-btn:hover {
    background: #32323f !important;
}
body.dark-theme .period-date-icon { color: #a5b4fc !important; }
body.dark-theme .period-date-caption { color: #6b7280 !important; }
body.dark-theme #periodDateBtnLabel,
body.dark-theme #periodDateBtnMobLabel { color: #f0f0f0 !important; }
body.dark-theme .period-date-caret { color: #6b7280 !important; }
body.dark-theme .period-btn.period-date-btn:hover .period-date-caret { color: #a5b4fc !important; }

body.dark-theme .stat-export-group {
    background: #2a2a35 !important;
    border-color: #3a3a48 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35) !important;
}
body.dark-theme .stat-export-group .stat-export-btn,
body.dark-theme .stat-export-group .stat-export-btn.stat-csv-btn {
    background: transparent !important;
    color: #b0b8c8 !important;
    box-shadow: none !important;
}
body.dark-theme .stat-export-group .stat-export-btn + .stat-export-btn {
    border-left-color: #3a3a48 !important;
}
body.dark-theme .stat-export-group .stat-export-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #6ee7b7 !important;
}
body.dark-theme .stat-export-group .stat-csv-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.16) !important;
    color: #93c5fd !important;
}

/* ──────────────────────────────────────────────────────────────
   Окна подтверждения и уведомлений редактора
   ──────────────────────────────────────────────────────────────
   Разметка этих окон собирается в JS и раньше в тёмной теме не
   участвовала вовсе: белое полотно и светлая шапка били по глазам
   поверх тёмной страницы. Цветные шапки (предупреждение, ошибка,
   успех, справка) оставляем цветными, но приглушаем до заливки
   тем же цветом с низкой прозрачностью - смысл читается, яркость
   не слепит. */

body.dark-theme .confirm-modal,
body.dark-theme .alert-modal {
    background: #212121 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

/* Шапка «внимание» - у обоих окон одна и та же */
body.dark-theme .confirm-modal-header,
body.dark-theme .alert-header-warning {
    background: rgba(245, 158, 11, 0.16) !important;
    border-bottom-color: rgba(245, 158, 11, 0.4) !important;
}
body.dark-theme .confirm-modal-title,
body.dark-theme .alert-header-warning .alert-modal-title {
    color: #fcd34d !important;
}

body.dark-theme .alert-header-error {
    background: rgba(239, 68, 68, 0.16) !important;
    border-bottom-color: rgba(239, 68, 68, 0.4) !important;
}
body.dark-theme .alert-header-error .alert-modal-title { color: #fca5a5 !important; }

body.dark-theme .alert-header-info {
    background: rgba(59, 130, 246, 0.16) !important;
    border-bottom-color: rgba(59, 130, 246, 0.4) !important;
}
body.dark-theme .alert-header-info .alert-modal-title { color: #93c5fd !important; }

body.dark-theme .alert-header-success {
    background: rgba(16, 185, 129, 0.16) !important;
    border-bottom-color: rgba(16, 185, 129, 0.4) !important;
}
body.dark-theme .alert-header-success .alert-modal-title { color: #6ee7b7 !important; }

body.dark-theme .confirm-modal-message,
body.dark-theme .alert-modal-message {
    color: #cccccc !important;
}

/* Нейтральная кнопка «Отмена» - на тёмном фоне светлая заливка неуместна */
body.dark-theme .confirm-btn-cancel {
    background: #2a2a2a !important;
    color: #cccccc !important;
    border-color: #3a3a3a !important;
}
body.dark-theme .confirm-btn-cancel:hover {
    background: #333333 !important;
    border-color: #4a4a4a !important;
}

/* Крестик закрытия в окне несохранённых изменений */
body.dark-theme .unsaved-modal-close-btn { color: #777777 !important; }
body.dark-theme .unsaved-modal-close-btn:hover {
    background: #2a2a2a !important;
    color: #cccccc !important;
}

/* ── Окно «Загрузить файл Excel» (/edit/price, /edit/config) ──
   Общее правило выше гасит фон у любой .modal-header, поэтому шапку
   этого окна возвращаем явно - двойным классом, чтобы не зависеть от
   порядка правил. */
body.dark-theme .upl-header.modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    border-bottom: none !important;
}

body.dark-theme .upl-header-title,
body.dark-theme .upl-header.modal-header h2 {
    color: #fff !important;
}

body.dark-theme .upl-header-sub {
    color: rgba(255, 255, 255, 0.72) !important;
}

body.dark-theme .upload-drop-zone {
    background: #1a1a1a;
    border-color: #4338ca;
}

body.dark-theme .upload-drop-zone:hover,
body.dark-theme .upload-drop-zone.upload-drop-active {
    background: #1e1b4b;
    border-color: #6366f1;
}

body.dark-theme .upload-drop-zone.upload-drop-selected {
    background: #052e16;
    border-color: #16a34a;
}

body.dark-theme .upl-drop-title {
    color: #a5b4fc;
}

body.dark-theme .upload-drop-zone.upload-drop-selected .upl-drop-title {
    color: #4ade80;
}

body.dark-theme .upl-drop-sub {
    color: #8b95a5;
}

body.dark-theme .upl-warn {
    background: rgba(120, 53, 15, 0.28);
    border-color: #78350f;
}

body.dark-theme .upl-warn-text {
    color: #fcd34d;
}

body.dark-theme .upl-footer.modal-footer {
    background: #181818 !important;
}
