/**
 * Универсальная темная тема для сайта Rulate
 * Этот файл содержит все стили для темной темы, которые можно применить к любой странице
 */

/* Anti-flash: мгновенная тёмная подложка до загрузки body (класс ставится inline-скриптом в head) */
html.dark-theme-preload {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}
html.dark-theme-preload body {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* CSS переменные для темной темы */
:root {
    /* Основные цвета */
    --dark-bg-primary: #1a1a1a;
    --dark-bg-secondary: #2d2d2d;
    --dark-bg-tertiary: #3a3a3a;
    --dark-bg-card: #2a2a2a;
    --dark-bg-hover: #404040;
    
    /* Цвета текста */
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #b0b0b0;
    --dark-text-muted: #888888;
    --dark-text-disabled: #666666;
    
    /* Цвета границ */
    --dark-border-primary: #404040;
    --dark-border-secondary: #555555;
    --dark-border-light: #333333;
    
    /* Акцентные цвета */
    --dark-accent-blue: #4a9eff;
    --dark-accent-blue-hover: #6bb3ff;
    --dark-accent-green: #4caf50;
    --dark-accent-red: #f44336;
    --dark-accent-orange: #ff9800;
    --dark-accent-purple: #9c27b0;
    
    /* Тени */
    --dark-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.3);
    --dark-shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.4);
    --dark-shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.5);
    
    /* Прозрачности */
    --dark-overlay-light: rgba(255, 255, 255, 0.1);
    --dark-overlay-medium: rgba(255, 255, 255, 0.15);
    --dark-overlay-heavy: rgba(255, 255, 255, 0.2);
}

/* Применение темной темы */
body.dark-theme {
    background-color: var(--dark-bg-primary);
    color: var(--dark-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Основные элементы */
body.dark-theme .container,
body.dark-theme .content,
body.dark-theme .main-content {
    background-color: var(--dark-bg-primary);
    color: var(--dark-text-primary);
}

/* Карточки и панели */
body.dark-theme .card,
body.dark-theme .panel,
body.dark-theme .bookmarks-filters,
body.dark-theme .floating-menu-content {
    background-color: var(--dark-bg-card);
    border-color: var(--dark-border-primary);
    box-shadow: var(--dark-shadow-medium);
}

/* Кнопки */
body.dark-theme .btn,
body.dark-theme .bookmarks-filter-btn,
body.dark-theme .bookmarks-filter-btn-compact,
body.dark-theme .bookmarks-compact-btn {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text-primary);
    border-color: var(--dark-border-primary);
}

body.dark-theme .btn:hover,
body.dark-theme .bookmarks-filter-btn:hover,
body.dark-theme .bookmarks-filter-btn-compact:hover,
body.dark-theme .bookmarks-compact-btn:hover {
    background-color: var(--dark-bg-hover);
    border-color: var(--dark-border-secondary);
}

body.dark-theme .btn.active,
body.dark-theme .bookmarks-filter-btn.active,
body.dark-theme .bookmarks-filter-btn-compact.active,
body.dark-theme .bookmarks-compact-btn.active {
    background-color: var(--dark-accent-blue);
    border-color: var(--dark-accent-blue);
    color: #ffffff;
}

/* Формы */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .bookmarks-select,
body.dark-theme .bookmarks-select-compact {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text-primary);
    border-color: var(--dark-border-primary);
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus,
body.dark-theme .bookmarks-select:focus,
body.dark-theme .bookmarks-select-compact:focus {
    border-color: var(--dark-accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

/* Карточки книг */
body.dark-theme .book-cover-card {
    background-color: var(--dark-bg-card);
    box-shadow: var(--dark-shadow-medium);
}

body.dark-theme .book-cover-card:hover {
    box-shadow: var(--dark-shadow-heavy);
}

/* Обложки и метаданные */
body.dark-theme .cover-overlay {
    background: linear-gradient(
        to bottom,
        rgba(26, 26, 26, 0.1) 0%,
        rgba(26, 26, 26, 0.8) 100%
    );
}

body.dark-theme .cover-title {
    color: var(--dark-text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

body.dark-theme .cover-label {
    background: var(--dark-overlay-medium);
    color: var(--dark-text-primary);
    border: 1px solid var(--dark-border-light);
}

/* Кнопка "Продолжить чтение" */
body.dark-theme .bookmarks-continue-btn {
    background: rgba(74, 158, 255, 0.3);
    color: var(--dark-text-primary);
}

body.dark-theme .bookmarks-continue-btn:hover {
    background: rgba(74, 158, 255, 0.4);
}

body.dark-theme .bookmarks-continue-btn::before {
    background: rgba(74, 158, 255, 0.9);
}

body.dark-theme .bookmarks-continue-btn:hover::before {
    background: var(--dark-accent-blue);
}

/* Кнопка "Начать чтение" в темной теме - максимальная специфичность */
body.dark-theme .bookmarks-start-reading,
body.dark-theme a.bookmarks-start-reading,
body.dark-theme .bookmarks-item .bookmarks-start-reading,
body.dark-theme .bookmarks-grid .bookmarks-start-reading,
body.dark-theme .bookmarks-item a.bookmarks-start-reading {
    background: rgba(52, 152, 219, 0.1) !important;
    color: var(--dark-text-primary) !important;
    border-color: #3498db !important;
}

body.dark-theme .bookmarks-start-reading:hover,
body.dark-theme a.bookmarks-start-reading:hover,
body.dark-theme .bookmarks-item .bookmarks-start-reading:hover,
body.dark-theme .bookmarks-grid .bookmarks-start-reading:hover,
body.dark-theme .bookmarks-item a.bookmarks-start-reading:hover {
    background: rgba(52, 152, 219, 0.2) !important;
    color: var(--dark-text-primary) !important;
    border-color: #3498db !important;
}

body.dark-theme .bookmarks-start-reading::before,
body.dark-theme a.bookmarks-start-reading::before,
body.dark-theme .bookmarks-item .bookmarks-start-reading::before,
body.dark-theme .bookmarks-grid .bookmarks-start-reading::before,
body.dark-theme .bookmarks-item a.bookmarks-start-reading::before {
    background: transparent !important;
    width: 0% !important;
}

body.dark-theme .bookmarks-start-reading:hover::before,
body.dark-theme a.bookmarks-start-reading:hover::before,
body.dark-theme .bookmarks-item .bookmarks-start-reading:hover::before,
body.dark-theme .bookmarks-grid .bookmarks-start-reading:hover::before,
body.dark-theme .bookmarks-item a.bookmarks-start-reading:hover::before {
    background: transparent !important;
    width: 0% !important;
}

body.dark-theme .bookmarks-start-reading .continue-btn-left,
body.dark-theme a.bookmarks-start-reading .continue-btn-left,
body.dark-theme .bookmarks-item .bookmarks-start-reading .continue-btn-left,
body.dark-theme .bookmarks-grid .bookmarks-start-reading .continue-btn-left,
body.dark-theme .bookmarks-item a.bookmarks-start-reading .continue-btn-left {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .bookmarks-start-reading .continue-btn-left svg,
body.dark-theme a.bookmarks-start-reading .continue-btn-left svg,
body.dark-theme .bookmarks-item .bookmarks-start-reading .continue-btn-left svg,
body.dark-theme .bookmarks-grid .bookmarks-start-reading .continue-btn-left svg,
body.dark-theme .bookmarks-item a.bookmarks-start-reading .continue-btn-left svg {
    color: var(--dark-text-primary) !important;
}

/* Переопределяем синий цвет текста для темной темы */
body.dark-theme .bookmarks-start-reading,
body.dark-theme a.bookmarks-start-reading,
body.dark-theme .bookmarks-continue-btn.bookmarks-start-reading,
body.dark-theme a.bookmarks-continue-btn.bookmarks-start-reading,
body.dark-theme .bookmarks-item .bookmarks-start-reading,
body.dark-theme .bookmarks-grid .bookmarks-start-reading,
body.dark-theme .bookmarks-cover-card .bookmarks-start-reading {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .bookmarks-start-reading:hover,
body.dark-theme a.bookmarks-start-reading:hover,
body.dark-theme .bookmarks-continue-btn.bookmarks-start-reading:hover,
body.dark-theme a.bookmarks-continue-btn.bookmarks-start-reading:hover,
body.dark-theme .bookmarks-item .bookmarks-start-reading:hover,
body.dark-theme .bookmarks-grid .bookmarks-start-reading:hover,
body.dark-theme .bookmarks-cover-card .bookmarks-start-reading:hover {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .bookmarks-start-reading:focus,
body.dark-theme a.bookmarks-start-reading:focus,
body.dark-theme .bookmarks-item .bookmarks-start-reading:focus,
body.dark-theme .bookmarks-grid .bookmarks-start-reading:focus,
body.dark-theme .bookmarks-item a.bookmarks-start-reading:focus {
    outline: 2px solid #3498db !important;
    outline-offset: 2px !important;
    background: rgba(52, 152, 219, 0.2) !important;
    color: var(--dark-text-primary) !important;
    border-color: #3498db !important;
}

/* Заголовки */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme .bookmarks-title {
    color: var(--dark-text-primary);
}

/* Ссылки */
body.dark-theme a {
    color: #ffffff;
}

body.dark-theme a:hover {
    color: var(--dark-accent-blue-hover);
}

/* Разделители */
body.dark-theme .bookmarks-toolbar-separator {
    background: var(--dark-border-primary);
}

/* Плавающее меню */
body.dark-theme .floating-action-button {
    background: var(--dark-accent-blue);
    box-shadow: var(--dark-shadow-medium);
}

body.dark-theme .floating-action-button:hover {
    background: var(--dark-accent-blue-hover);
}

body.dark-theme .floating-menu {
    background: var(--dark-bg-card);
    border-color: var(--dark-border-primary);
}

body.dark-theme .bookmarks-tab {
    background: transparent;
    color: var(--dark-text-secondary);
}

body.dark-theme .bookmarks-tab.active {
    background: rgba(74, 158, 255, 0.3);
    color: var(--dark-text-primary);
}

/* Бейджи и индикаторы */
body.dark-theme .adult-badge {
    background: rgba(108, 117, 125, 0.9);
    border-color: var(--dark-border-light);
}

body.dark-theme .sale-badge {
    background: rgba(255, 152, 0, 0.9);
}

/* Пустое состояние */
body.dark-theme .bookmarks-empty {
    color: var(--dark-text-secondary);
}

body.dark-theme .bookmarks-empty svg {
    color: var(--dark-text-muted);
}

/* Анимации и переходы */
body.dark-theme * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Скроллбары для темной темы */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: var(--dark-bg-secondary);
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: var(--dark-border-secondary);
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--dark-text-muted);
}

/* Специальные цвета для иконок */
body.dark-theme .cover-chapters {
    color: var(--dark-accent-orange) !important;
}

body.dark-theme .cover-free {
    color: var(--dark-accent-green) !important;
}

body.dark-theme .cover-locked {
    color: var(--dark-text-muted) !important;
}

/* Градиент для огонька в темной теме */
body.dark-theme .cover-chapters svg defs linearGradient stop:nth-child(1) {
    stop-color: #ffeb3b;
}

body.dark-theme .cover-chapters svg defs linearGradient stop:nth-child(2) {
    stop-color: #ff9800;
}

body.dark-theme .cover-chapters svg defs linearGradient stop:nth-child(3) {
    stop-color: #ff5722;
}
/* Header и навигация */
body.dark-theme .main-header {
    background: var(--dark-bg-secondary);
    border-bottom: 1px solid var(--dark-border-primary);
}

body.dark-theme .main-header-inner {
    background: var(--dark-bg-secondary);
}

body.dark-theme .main-header-left_menu,
body.dark-theme .main-header-right_menu {
    background: var(--dark-bg-secondary);
}

/* Кнопки и ссылки в header */
body.dark-theme .header-item_dropbtn,
body.dark-theme .main-header-create,
body.dark-theme .main-header-notifications,
body.dark-theme .main-header-avatar {
    background: var(--dark-bg-card);
    color: var(--dark-text-primary);
    border: 1px solid var(--dark-border-primary);
}

body.dark-theme .header-item_dropbtn:hover,
body.dark-theme .main-header-create:hover,
body.dark-theme .main-header-notifications:hover,
body.dark-theme .main-header-avatar:hover {
    background: var(--dark-bg-primary);
    border-color: var(--dark-border-secondary);
}

/* Выпадающие меню */
body.dark-theme .header-item_dropdown-content,
body.dark-theme .main-header-create_dropdown-menu,
body.dark-theme .main-header-notifications_dropdown-menu,
body.dark-theme .main-header-avatar_dropdown-menu {
    background: var(--dark-bg-card);
    border: 1px solid var(--dark-border-primary);
    box-shadow: var(--dark-shadow-medium);
}

body.dark-theme .header-item_dropdown-content a,
body.dark-theme .main-header-create_dropdown-menu a,
body.dark-theme .main-header-notifications_dropdown-menu a,
body.dark-theme .main-header-avatar_dropdown-menu a {
    color: var(--dark-text-primary);
}

body.dark-theme .header-item_dropdown-content a:hover,
body.dark-theme .main-header-create_dropdown-menu a:hover,
body.dark-theme .main-header-notifications_dropdown-menu a:hover,
body.dark-theme .main-header-avatar_dropdown-menu a:hover {
    background: var(--dark-bg-primary);
    color: var(--dark-accent-blue);
}

/* Разделители в меню */
body.dark-theme .header-item_menu-divider {
    border-top: 1px solid var(--dark-border-primary);
}

/* Поиск */
body.dark-theme .form-search input[type="text"] {
    background: var(--dark-bg-card);
    color: var(--dark-text-primary);
    border: 1px solid var(--dark-border-primary);
}

body.dark-theme .form-search input[type="text"]:focus {
    border-color: var(--dark-accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

body.dark-theme .form-search input[type="submit"] {
    background: var(--dark-accent-blue);
    color: white;
    border: 1px solid var(--dark-accent-blue);
}

body.dark-theme .form-search input[type="submit"]:hover {
    background: #3a8eff;
}

/* Иконки и SVG */
body.dark-theme .header-item svg,
body.dark-theme .main-header-notifications_icon,
body.dark-theme .main-header-balance svg {
    fill: var(--dark-text-primary);
    color: var(--dark-text-primary);
}

/* Баланс */
body.dark-theme .main-header-balance a {
    color: var(--dark-text-primary);
}

body.dark-theme .main-header-balance span {
    color: var(--dark-text-primary);
}

/* Ссылки в навигации */
body.dark-theme .main-header-menu_nav-container a {
    color: var(--dark-text-primary);
}

body.dark-theme .main-header-menu_nav-container a:hover {
    color: var(--dark-accent-blue);
}
/* Унификация стилей кнопок навигации */
body.dark-theme .header-item_dropbtn {
    background: transparent !important;
    border: none !important;
    color: var(--dark-text-primary);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    font-family: 'Exo 2';
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

body.dark-theme .header-item_dropbtn:hover {
    background: transparent !important;
    color: var(--dark-accent-blue);
    border: none !important;
}

/* Также для светлой темы */
.header-item_dropbtn {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary, #333);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    font-family: 'Exo 2';
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.header-item_dropbtn:hover {
    background: transparent !important;
    color: var(--primary, #007bff);
    border: none !important;
}
/* Bootstrap кнопки для темной темы */
body.dark-theme .btn {
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    background-color: var(--dark-bg-card) !important;
    background-image: none !important;
    text-shadow: none !important;
    transition: all 0.2s ease;
}

body.dark-theme .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .btn:focus {
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3) !important;
    outline: none !important;
}

/* Цветные кнопки */
body.dark-theme .btn-default {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .btn-default:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .btn-default.active {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-danger {
    background-color: var(--dark-accent-red) !important;
    border-color: var(--dark-accent-red) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

body.dark-theme .btn-danger.active {
    background-color: var(--dark-accent-red) !important;
    border-color: var(--dark-accent-red) !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

body.dark-theme .btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-info:hover {
    background-color: #3a8eff !important;
    border-color: #3a8eff !important;
}

body.dark-theme .btn-info.active {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

body.dark-theme .btn-success {
    background-color: var(--dark-accent-green) !important;
    border-color: var(--dark-accent-green) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-success:hover {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

body.dark-theme .btn-success.active {
    background-color: var(--dark-accent-green) !important;
    border-color: var(--dark-accent-green) !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Группы кнопок */
body.dark-theme .btn-group .btn {
    border-right: 1px solid var(--dark-border-primary);
}

body.dark-theme .btn-group .btn:last-child {
    border-right: 1px solid var(--dark-border-primary);
}

body.dark-theme .btn-toolbar {
    background: transparent;
}

/* SVG иконки в кнопках */
body.dark-theme .btn svg {
    fill: currentColor;
    color: currentColor;
}
/* Дополнительные Bootstrap кнопки */
body.dark-theme .btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

body.dark-theme .btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

body.dark-theme .btn-warning.active {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

body.dark-theme .btn-primary {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-primary:hover {
    background-color: #3a8eff !important;
    border-color: #3a8eff !important;
}

body.dark-theme .btn-primary.active {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

body.dark-theme .btn-link {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--dark-accent-blue) !important;
    text-decoration: none !important;
}

body.dark-theme .btn-link:hover {
    background-color: transparent !important;
    border-color: transparent !important;
    color: #3a8eff !important;
    text-decoration: underline !important;
}

/* Исправление для активных состояний */
body.dark-theme .btn.active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}
/* Стили для главной страницы */
body.dark-theme .imged {
    background: transparent;
}

body.dark-theme .imged li {
    background-color: var(--dark-bg-card);
    border: 1px solid var(--dark-border-primary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

body.dark-theme .imged li:hover {
    background-color: var(--dark-bg-primary);
    border-color: var(--dark-border-secondary);
}

body.dark-theme .imged .title a {
    color: var(--dark-text-primary);
}

body.dark-theme .imged .title a:hover {
    color: var(--dark-accent-blue);
}

body.dark-theme .imged .muted {
    color: var(--dark-text-muted);
}

body.dark-theme .imged .muted:hover {
    color: var(--dark-text-secondary);
}

body.dark-theme .imged .info {
    color: var(--dark-text-secondary);
}

body.dark-theme .imged .show-more {
    color: var(--dark-accent-blue);
}

body.dark-theme .imged button {
    background: transparent;
    border: none;
    color: var(--dark-accent-blue);
    cursor: pointer;
}

body.dark-theme .imged button:hover {
    color: #3a8eff;
}

/* Заголовки */
body.dark-theme h1 {
    color: var(--dark-text-primary);
}

body.dark-theme h2 {
    color: var(--dark-text-primary);
}

body.dark-theme h3 {
    color: var(--dark-text-primary);
}

/* Пагинация (общая — Bootstrap + Yii CLinkPager) */
body.dark-theme .pagination {
    background: transparent !important;
}

body.dark-theme .pagination ul {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Прямые селекторы: CLinkPager ставит .pagination на <ul> напрямую */
body.dark-theme .pagination a,
body.dark-theme .pagination span,
body.dark-theme .pagination ul li a,
body.dark-theme .pagination ul li span {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .pagination a:hover,
body.dark-theme .pagination ul li a:hover {
    background-color: var(--dark-bg-hover) !important;
    color: var(--dark-accent-blue) !important;
}

body.dark-theme .pagination .active a,
body.dark-theme .pagination .active span,
body.dark-theme .pagination li.active a,
body.dark-theme .pagination ul li.active a {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .pagination .disabled a,
body.dark-theme .pagination .disabled span,
body.dark-theme .pagination ul li.disabled a,
body.dark-theme .pagination ul li.disabled span {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-disabled) !important;
}

body.dark-theme .pagination .selected a {
    background-color: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .pagination .first a,
body.dark-theme .pagination .last a,
body.dark-theme .pagination .previous a,
body.dark-theme .pagination .next a {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .pagination .first a:hover,
body.dark-theme .pagination .last a:hover,
body.dark-theme .pagination .previous a:hover,
body.dark-theme .pagination .next a:hover {
    background-color: var(--dark-bg-hover) !important;
    color: var(--dark-accent-blue) !important;
}
/* Bootstrap иконки для темной темы */
body.dark-theme [class^="icon-"],
body.dark-theme [class*=" icon-"] {
    background-image: none;
    color: var(--dark-text-primary);
}

body.dark-theme .bookmarks-filter-btn-compact [class^="icon-"],
body.dark-theme .bookmarks-filter-btn-compact [class*=" icon-"] {
    color: var(--dark-text-primary);
}

body.dark-theme .bookmarks-filter-btn-compact.active [class^="icon-"],
body.dark-theme .bookmarks-filter-btn-compact.active [class*=" icon-"] {
    color: #ffffff;
}

/* Конкретные иконки с эмодзи для лучшей видимости */
body.dark-theme .icon-fire:before {
    content: "🔥";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-ok:before {
    content: "✅";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-warning-sign:before {
    content: "⚠️";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-tags:before {
    content: "🏷️";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Скрываем оригинальные иконки Bootstrap в темной теме */
body.dark-theme .icon-fire,
body.dark-theme .icon-ok,
body.dark-theme .icon-warning-sign,
body.dark-theme .icon-tags {
    font-size: 0;
}

body.dark-theme .icon-fire:before,
body.dark-theme .icon-ok:before,
body.dark-theme .icon-warning-sign:before,
body.dark-theme .icon-tags:before {
    font-size: 14px;
}
/* Дополнительные иконки Bootstrap */
body.dark-theme .icon-plus:before {
    content: "➕";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-move:before {
    content: "✋";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-globe:before {
    content: "🌐";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Скрываем оригинальные иконки и показываем эмодзи */
body.dark-theme .icon-plus,
body.dark-theme .icon-move,
body.dark-theme .icon-globe {
    font-size: 0;
}

body.dark-theme .icon-plus:before,
body.dark-theme .icon-move:before,
body.dark-theme .icon-globe:before {
    font-size: 14px;
}
/* Еще больше иконок Bootstrap */
body.dark-theme .icon-text-height:before {
    content: "🔤";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-comment:before {
    content: "💬";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Скрываем оригинальные иконки */
body.dark-theme .icon-text-height,
body.dark-theme .icon-comment {
    font-size: 0;
}

body.dark-theme .icon-text-height:before,
body.dark-theme .icon-comment:before {
    font-size: 14px;
}

/* Элементы управления на обложках книг в темной теме */
body.dark-theme .bookmarks-actions .btn {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .bookmarks-actions .btn:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .bookmarks-actions .btn svg {
    color: var(--dark-text-primary) !important;
    fill: var(--dark-text-primary) !important;
}

/* Dropdown для типа закладки в темной теме */
body.dark-theme .bookmarks-type-dropdown .btn {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .bookmarks-type-dropdown .btn:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .bookmarks-type-dropdown .dropdown-menu {
    background: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: var(--dark-shadow-medium) !important;
}

body.dark-theme .bookmarks-type-dropdown .dropdown-menu a {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .bookmarks-type-dropdown .dropdown-menu a:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

/* Bootstrap dropdown стили для темной темы */
body.dark-theme .dropdown-menu {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: var(--dark-shadow-medium) !important;
}

body.dark-theme .dropdown-menu a,
body.dark-theme .dropdown-menu li > a {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .dropdown-menu a:hover,
body.dark-theme .dropdown-menu li > a:hover,
body.dark-theme .dropdown-menu .active > a,
body.dark-theme .dropdown-menu .active > a:hover {
    background-color: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .dropdown-menu .divider {
    background-color: var(--dark-border-primary) !important;
    border-bottom-color: var(--dark-border-light) !important;
}

/* Кнопки статуса (Читаю, В планах, Бросил, Прочитал) */
body.dark-theme .dropdown-toggle {
    background-color: var(--dark-bg-card) !important;
    background-image: none !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .dropdown-toggle:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .dropdown.open .dropdown-toggle {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

/* Цветные dropdown-toggle сохраняют свой цвет */
body.dark-theme .btn-warning.dropdown-toggle {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

body.dark-theme .btn-success.dropdown-toggle {
    background-color: var(--dark-accent-green) !important;
    border-color: var(--dark-accent-green) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-info.dropdown-toggle {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-danger.dropdown-toggle {
    background-color: var(--dark-accent-red) !important;
    border-color: var(--dark-accent-red) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-primary.dropdown-toggle {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

/* Caret (стрелки) в цветных кнопках — белые */
body.dark-theme .btn-warning .caret,
body.dark-theme .btn-success .caret,
body.dark-theme .btn-info .caret,
body.dark-theme .btn-danger .caret,
body.dark-theme .btn-primary .caret {
    border-top-color: #ffffff !important;
}

body.dark-theme .caret {
    border-top-color: var(--dark-text-primary) !important;
}

/* Иконки в кнопках действий */
body.dark-theme .bookmarks-actions svg,
body.dark-theme .bookmarks-type-dropdown svg {
    color: var(--dark-text-primary) !important;
    fill: var(--dark-text-primary) !important;
}

/* Дополнительные стили для иконок Bootstrap в кнопках действий */
body.dark-theme .bookmarks-actions [class^="icon-"],
body.dark-theme .bookmarks-actions [class*=" icon-"],
body.dark-theme .bookmarks-type-dropdown [class^="icon-"],
body.dark-theme .bookmarks-type-dropdown [class*=" icon-"] {
    color: var(--dark-text-primary) !important;
    background-image: url("/i/glyphicons-halflings-white.png") !important;
}

/* Стили для кнопки "Начать читать" в темной теме */
body.dark-theme .bookmarks-start-reading {
    background: rgba(52, 152, 219, 0.1) !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
    background-image: none !important;
    border-color: #3498db !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .bookmarks-start-reading:hover {
    background: rgba(52, 152, 219, 0.2) !important;
    background-color: rgba(52, 152, 219, 0.2) !important;
    background-image: none !important;
    border-color: #3498db !important;
    color: var(--dark-text-primary) !important;
}

/* Специфические стили для кнопок действий на обложках */
body.dark-theme .bookmarks-actions .btn-ed,
body.dark-theme .bookmarks-actions .btn-watch,
body.dark-theme .bookmarks-actions .btn-remove {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
    opacity: 0.9;
}

body.dark-theme .bookmarks-actions .btn-ed:hover,
body.dark-theme .bookmarks-actions .btn-watch:hover,
body.dark-theme .bookmarks-actions .btn-remove:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
    opacity: 1;
}

/* Иконки в кнопках действий */
body.dark-theme .bookmarks-actions .icon-edit,
body.dark-theme .bookmarks-actions .icon-eye-open,
body.dark-theme .bookmarks-actions .icon-eye-close,
body.dark-theme .bookmarks-actions .icon-remove {
    color: var(--dark-text-primary) !important;
    background-image: url("/i/glyphicons-halflings-white.png") !important;
}

/* Стили для dropdown кнопки типа закладки */
body.dark-theme .bookmarks-type-dropdown .btn.dropdown-toggle {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .bookmarks-type-dropdown .btn.dropdown-toggle:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .bookmarks-type-dropdown .type-label {
    color: var(--dark-text-primary) !important;
}

/* Стили для элементов dropdown меню типов закладок */
body.dark-theme .bookmarks-type-dropdown .dropdown-menu .btn-type {
    color: var(--dark-text-primary) !important;
    background: transparent !important;
    border: none !important;
    text-decoration: none !important;
}

body.dark-theme .bookmarks-type-dropdown .dropdown-menu .btn-type:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

/* Стили для мини кнопок */
body.dark-theme .btn-mini {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .btn-mini:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Дополнительные иконки для темной темы */
body.dark-theme .icon-edit:before {
    content: "✏️";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-eye-open:before {
    content: "👁️";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-eye-close:before {
    content: "🙈";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.dark-theme .icon-remove:before {
    content: "❌";
    font-style: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Скрываем оригинальные иконки и показываем эмодзи */
body.dark-theme .icon-edit,
body.dark-theme .icon-eye-open,
body.dark-theme .icon-eye-close,
body.dark-theme .icon-remove {
    font-size: 0;
}

body.dark-theme .icon-edit:before,
body.dark-theme .icon-eye-open:before,
body.dark-theme .icon-eye-close:before,
body.dark-theme .icon-remove:before {
    font-size: 12px;
}

/* Стили для мобильного меню в темной теме */
body.dark-theme .mobile-menu__container__content {
    background: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu header {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu__content {
    background: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Заголовки разделов в мобильном меню */
body.dark-theme .mobile-menu__item h3 {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
}

/* Ссылки в мобильном меню */
body.dark-theme .mobile-menu__item a {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu__item a:hover {
    color: var(--dark-text-secondary) !important;
}

/* Кнопка "Показать все" */
body.dark-theme .mobile-menu__item .show_all {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
}

body.dark-theme .mobile-menu__item .show_all:hover {
    background: var(--dark-bg-hover) !important;
}

/* Футер мобильного меню */
body.dark-theme .mobile-menu footer {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-top: 1px solid var(--dark-border-primary) !important;
}

/* Пользовательская информация */
body.dark-theme .mobile-menu__user__wallet {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu__user__nickname {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu__user__container {
    background: var(--dark-bg-primary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu__user__container:hover {
    background: var(--dark-bg-hover) !important;
}

/* Кнопки в мобильном меню */
body.dark-theme .mobile-menu .btn {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .mobile-menu .btn:hover {
    background: var(--dark-bg-hover) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mobile-menu .btn svg {
    fill: var(--dark-text-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Формы в мобильном меню */
body.dark-theme .mobile-menu footer form input {
    background: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .mobile-menu footer form input:focus {
    border-color: var(--dark-border-secondary) !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
}

/* Плавающее меню для закладок */
body.dark-theme .bookmarks-mobile-menu-content {
    background: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-header {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
    border-bottom: 1px solid var(--dark-border-primary) !important;
}

body.dark-theme .floating-menu-close {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-close:hover {
    background: var(--dark-bg-hover) !important;
}

body.dark-theme .floating-menu-section-title {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-item {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-item:hover {
    background: var(--dark-bg-hover) !important;
}

body.dark-theme .floating-menu-item.active {
    background: rgba(52, 152, 219, 0.2) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-item-text {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .floating-menu-item-icon {
    color: var(--dark-text-primary) !important;
}

/* Backdrop для мобильного меню */
body.dark-theme .mobile-menu__container {
    background: rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .floating-menu-backdrop {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* ===== СТРАНИЦЫ ПОИСКА ===== */

/* Основной контейнер сайдбара поиска */
body.dark-theme .tools {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Заголовки в сайдбаре поиска */
body.dark-theme .tools h5 {
    background: linear-gradient(135deg, var(--dark-accent-blue), #3a7bc8) !important;
    color: white !important;
    padding: 12px 15px !important;
    margin: -15px -15px 20px -15px !important;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Стиль для светлой темы */
.tools h5 {
    background: linear-gradient(135deg, #4a9eff, #3a7bc8) !important;
    color: white !important;
    padding: 12px 15px !important;
    margin: -15px -15px 20px -15px !important;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Лейблы форм */
body.dark-theme .tools .control-label {
    color: var(--dark-text-primary) !important;
}

/* Селекты и дропдауны */
body.dark-theme .tools select {
    background-color: var(--dark-bg-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .tools select:focus {
    border-color: var(--dark-accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2) !important;
}

body.dark-theme .tools select option {
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Текстовые поля */
body.dark-theme .tools input[type="text"],
body.dark-theme .tools input[type="number"] {
    background-color: var(--dark-bg-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .tools input[type="text"]:focus,
body.dark-theme .tools input[type="number"]:focus {
    border-color: var(--dark-accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2) !important;
    background-color: var(--dark-bg-primary) !important;
}

/* Чекбоксы и радио-кнопки */
body.dark-theme .tools .checkbox,
body.dark-theme .tools .radio {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .tools .checkbox input[type="checkbox"],
body.dark-theme .tools .radio input[type="radio"] {
    filter: brightness(0.8) contrast(1.2) !important;
}

/* Основная форма поиска на главной странице поиска */
body.dark-theme #search-ghost-form {
    margin-bottom: 20px !important;
}

body.dark-theme #search-ghost-form input[type="text"] {
    background-color: var(--dark-bg-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme #search-ghost-form input[type="text"]:focus {
    border-color: var(--dark-accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2) !important;
}

/* Кнопки поиска */
body.dark-theme .tools .btn-primary,
body.dark-theme #search-ghost-form .btn-primary {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .tools .btn-primary:hover,
body.dark-theme #search-ghost-form .btn-primary:hover {
    background-color: #3a7bc8 !important;
    border-color: #3a7bc8 !important;
}

/* Иконки в кнопках поиска */
body.dark-theme .tools .btn-primary .icon-search,
body.dark-theme #search-ghost-form .btn-primary .icon-search {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
    filter: none !important;
}

body.dark-theme .tools .btn-primary i[class*="icon-search"],
body.dark-theme #search-ghost-form .btn-primary i[class*="icon-search"] {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
}

/* Алерты на странице поиска */
body.dark-theme .alert-info {
    background-color: rgba(74, 158, 255, 0.1) !important;
    border-color: var(--dark-accent-blue) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .alert-block {
    background-color: rgba(74, 158, 255, 0.1) !important;
    border-color: var(--dark-accent-blue) !important;
    color: var(--dark-text-primary) !important;
}

/* MagicSuggest компоненты */
body.dark-theme .ms-ctn {
    background-color: var(--dark-bg-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .ms-ctn.ms-has-focus {
    border-color: var(--dark-accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2) !important;
}

body.dark-theme .ms-ctn .ms-input {
    background-color: transparent !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .ms-ctn .ms-sel-item {
    background-color: var(--dark-accent-blue) !important;
    color: white !important;
    border: 1px solid var(--dark-accent-blue) !important;
}

body.dark-theme .ms-ctn .ms-sel-item .ms-close-btn {
    color: white !important;
}

body.dark-theme .ms-ctn .ms-sel-item .ms-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Выпадающий список MagicSuggest */
body.dark-theme .ms-drop {
    background-color: var(--dark-bg-primary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .ms-drop .ms-res-item {
    color: var(--dark-text-primary) !important;
    border-bottom: 1px solid var(--dark-border-primary) !important;
}

body.dark-theme .ms-drop .ms-res-item:hover,
body.dark-theme .ms-drop .ms-res-item.ms-res-item-active {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .ms-drop .ms-res-group {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-secondary) !important;
    border-bottom: 1px solid var(--dark-border-primary) !important;
}

/* Плейсхолдеры в MagicSuggest */
body.dark-theme .ms-ctn input::placeholder {
    color: var(--dark-text-secondary) !important;
}

/* Скрытые поля */
body.dark-theme .tools input[type="hidden"] {
    display: none !important;
}

/* Заголовки результатов поиска */
body.dark-theme h3 {
    color: var(--dark-text-primary) !important;
}

/* Описание категории */
body.dark-theme .tools p {
    color: var(--dark-text-primary) !important;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body.dark-theme .tools {
        margin-bottom: 20px !important;
    }
    
    body.dark-theme .tools .control-group {
        margin-bottom: 15px !important;
    }
    
    body.dark-theme .ms-ctn {
        min-height: 34px !important;
    }
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ ПРОСМОТРА НА СТРАНИЦЕ ПОИСКА ===== */

/* Контейнер переключателя режимов */
body.dark-theme .books-view-mode-switcher {
    background: transparent !important;
}

/* Кнопки переключателя режимов */
body.dark-theme .books-view-mode-switcher .btn {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .books-view-mode-switcher .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .books-view-mode-switcher .btn.btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .books-view-mode-switcher .btn.btn-info:hover {
    background-color: #3a7bc8 !important;
    border-color: #3a7bc8 !important;
}

/* Иконки в кнопках переключателя */
body.dark-theme .books-view-mode-switcher .btn i[class*="icon-"] {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
}

body.dark-theme .books-view-mode-switcher .btn .icon-list,
body.dark-theme .books-view-mode-switcher .btn .icon-th-large,
body.dark-theme .books-view-mode-switcher .btn .icon-align-justify {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
}

body.dark-theme .books-view-mode-switcher .btn.btn-info i[class*="icon-"] {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
}

body.dark-theme .books-view-mode-switcher .btn.btn-info .icon-list,
body.dark-theme .books-view-mode-switcher .btn.btn-info .icon-th-large,
body.dark-theme .books-view-mode-switcher .btn.btn-info .icon-align-justify {
    background-image: url("/i/glyphicons-halflings-white.png") !important;
    opacity: 1 !important;
}

/* ===== ПАГИНАЦИЯ НА СТРАНИЦЕ ПОИСКА ===== */

/* Основной контейнер пагинации */
body.dark-theme .centered-pager {
    background: transparent !important;
}

/* Элементы списка пагинации */
body.dark-theme .centered-pager li {
    background: transparent !important;
}

/* Ссылки пагинации */
body.dark-theme .centered-pager li a {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    text-decoration: none !important;
}

body.dark-theme .centered-pager li a:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* Активная страница */
body.dark-theme .centered-pager li.active a {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .centered-pager li.active a:hover {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

/* Отключенные элементы пагинации */
body.dark-theme .centered-pager li.disabled a {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-light) !important;
    color: var(--dark-text-disabled) !important;
    cursor: not-allowed !important;
}

body.dark-theme .centered-pager li.disabled a:hover {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-light) !important;
    color: var(--dark-text-disabled) !important;
}

/* Первая, предыдущая, следующая, последняя страницы */
body.dark-theme .centered-pager li.first a,
body.dark-theme .centered-pager li.previous a,
body.dark-theme .centered-pager li.next a,
body.dark-theme .centered-pager li.last a {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .centered-pager li.first a:hover,
body.dark-theme .centered-pager li.previous a:hover,
body.dark-theme .centered-pager li.next a:hover,
body.dark-theme .centered-pager li.last a:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Отключенные навигационные элементы */
body.dark-theme .centered-pager li.first.disabled a,
body.dark-theme .centered-pager li.previous.disabled a,
body.dark-theme .centered-pager li.next.disabled a,
body.dark-theme .centered-pager li.last.disabled a {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-light) !important;
    color: var(--dark-text-disabled) !important;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body.dark-theme .books-view-mode-switcher {
        justify-content: center !important;
        margin-bottom: 15px !important;
    }
    
    body.dark-theme .centered-pager {
        text-align: center !important;
    }
    
    body.dark-theme .centered-pager li {
        display: inline-block !important;
        margin: 2px !important;
    }
}

/* ===== РЕЖИМЫ ОТОБРАЖЕНИЯ РЕЗУЛЬТАТОВ ПОИСКА ===== */

/* Общие стили для контейнеров результатов */
body.dark-theme .search-results,
body.dark-theme .books-list,
body.dark-theme .books-container {
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Стандартный режим отображения */
body.dark-theme .book-item,
body.dark-theme .book-standard-item {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    margin-bottom: 15px !important;
    padding: 15px !important;
    border-radius: 8px !important;
}

body.dark-theme .book-item:hover,
body.dark-theme .book-standard-item:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Заголовки книг */
body.dark-theme .book-item .book-title,
body.dark-theme .book-item .book-title a,
body.dark-theme .book-standard-item .book-title,
body.dark-theme .book-standard-item .book-title a {
    color: var(--dark-text-primary) !important;
    text-decoration: none !important;
}

body.dark-theme .book-item .book-title a:hover,
body.dark-theme .book-standard-item .book-title a:hover {
    color: var(--dark-accent-blue) !important;
}

/* Описания и метаинформация */
body.dark-theme .book-item .book-description,
body.dark-theme .book-item .book-meta,
body.dark-theme .book-standard-item .book-description,
body.dark-theme .book-standard-item .book-meta {
    color: var(--dark-text-secondary) !important;
}

/* Жанры и теги */
body.dark-theme .book-item .book-genres,
body.dark-theme .book-item .book-tags,
body.dark-theme .book-standard-item .book-genres,
body.dark-theme .book-standard-item .book-tags {
    color: var(--dark-text-muted) !important;
}

/* Ссылки в жанрах и тегах */
body.dark-theme .book-item .book-genres a,
body.dark-theme .book-item .book-tags a,
body.dark-theme .book-standard-item .book-genres a,
body.dark-theme .book-standard-item .book-tags a {
    color: var(--dark-accent-blue) !important;
    text-decoration: none !important;
}

body.dark-theme .book-item .book-genres a:hover,
body.dark-theme .book-item .book-tags a:hover,
body.dark-theme .book-standard-item .book-genres a:hover,
body.dark-theme .book-standard-item .book-tags a:hover {
    color: var(--dark-accent-blue-hover) !important;
    text-decoration: underline !important;
}

/* Компактный режим отображения */
body.dark-theme .book-compact-item {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    border-radius: 6px !important;
}

body.dark-theme .book-compact-item:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Статистика книг (рейтинги, количество глав и т.д.) */
body.dark-theme .book-stats,
body.dark-theme .book-rating,
body.dark-theme .book-chapters {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-secondary) !important;
    border: 1px solid var(--dark-border-light) !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
}

/* Статусы книг */
body.dark-theme .book-status {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .book-status.completed {
    color: var(--dark-accent-green) !important;
}

body.dark-theme .book-status.ongoing {
    color: var(--dark-accent-orange) !important;
}

body.dark-theme .book-status.paused {
    color: var(--dark-accent-red) !important;
}

/* Обложки книг в списках */
body.dark-theme .book-cover,
body.dark-theme .book-thumbnail {
    border: 1px solid var(--dark-border-primary) !important;
    border-radius: 4px !important;
}

/* Информационные блоки */
body.dark-theme .book-info,
body.dark-theme .book-details {
    background-color: var(--dark-bg-card) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    border-radius: 6px !important;
    padding: 10px !important;
}

/* Разделители */
body.dark-theme .book-separator,
body.dark-theme hr {
    border-color: var(--dark-border-primary) !important;
    background-color: var(--dark-border-primary) !important;
}

/* Дополнительная информация */
body.dark-theme .book-additional-info,
body.dark-theme .book-extra {
    color: var(--dark-text-muted) !important;
    font-size: 0.9em !important;
}

/* Кнопки действий в результатах поиска */
body.dark-theme .book-actions .btn {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    margin-right: 5px !important;
}

body.dark-theme .book-actions .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

body.dark-theme .book-actions .btn-primary {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .book-actions .btn-primary:hover {
    background-color: #3a7bc8 !important;
    border-color: #3a7bc8 !important;
}

/* Универсальные селекторы для любых элементов результатов поиска */
body.dark-theme .search-result-item,
body.dark-theme .result-item,
body.dark-theme .list-item {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    border-radius: 6px !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
}

body.dark-theme .search-result-item:hover,
body.dark-theme .result-item:hover,
body.dark-theme .list-item:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body.dark-theme .book-item,
    body.dark-theme .book-standard-item,
    body.dark-theme .book-compact-item {
        margin-bottom: 10px !important;
        padding: 10px !important;
    }
    
    body.dark-theme .book-cover,
    body.dark-theme .book-thumbnail {
        max-width: 60px !important;
    }
}

/* ===== РЕЗУЛЬТАТЫ ПОИСКА - РЕЖИМЫ ОТОБРАЖЕНИЯ ===== */

/* Стандартный режим отображения - ul.search-results */
body.dark-theme ul.search-results {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border) !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.dark-theme ul.search-results li {
    background-color: var(--dark-bg-secondary) !important;
    border-bottom: 1px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    padding: 15px !important;
    margin: 0 !important;
}

body.dark-theme ul.search-results li:hover {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-hover) !important;
}

/* Заголовки книг в стандартном режиме */
body.dark-theme ul.search-results li p a {
    color: var(--dark-link) !important;
    text-decoration: none !important;
}

body.dark-theme ul.search-results li p a:hover {
    color: var(--dark-link-hover) !important;
    text-decoration: underline !important;
}

/* Метаданные в стандартном режиме */
body.dark-theme ul.search-results li .meta {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme ul.search-results li .meta a {
    color: var(--dark-accent) !important;
}

body.dark-theme ul.search-results li .meta a:hover {
    color: var(--dark-accent-hover) !important;
}

/* Лейблы статистики */
body.dark-theme ul.search-results li .label {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

/* Описания книг */
body.dark-theme ul.search-results li p {
    color: var(--dark-text-primary) !important;
}

body.dark-theme ul.search-results li p em {
    color: var(--dark-text-muted) !important;
}

/* Жанры и теги */
body.dark-theme ul.search-results li p em a {
    color: var(--dark-accent) !important;
}

body.dark-theme ul.search-results li p em a:hover {
    color: var(--dark-accent-hover) !important;
}

/* Обложки книг */
body.dark-theme ul.search-results li .th {
    border: 1px solid var(--dark-border) !important;
}

/* Компактный режим отображения - table.books-compact-table */
body.dark-theme table.books-compact-table {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme table.books-compact-table thead th {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-bottom: 2px solid var(--dark-border) !important;
}

body.dark-theme table.books-compact-table tbody tr {
    background-color: var(--dark-bg-secondary) !important;
    border-bottom: 1px solid var(--dark-border) !important;
}

body.dark-theme table.books-compact-table tbody tr:hover {
    background-color: var(--dark-bg-tertiary) !important;
}

body.dark-theme table.books-compact-table tbody tr:nth-child(odd) {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme table.books-compact-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-theme table.books-compact-table td {
    color: var(--dark-text-primary) !important;
    border-top: 1px solid var(--dark-border) !important;
}

/* Заголовки книг в компактном режиме */
body.dark-theme table.books-compact-table .book-title-wrapper a {
    color: var(--dark-link) !important;
}

body.dark-theme table.books-compact-table .book-title-wrapper a:hover {
    color: var(--dark-link-hover) !important;
}

/* Жанры в компактном режиме */
body.dark-theme table.books-compact-table td a {
    color: var(--dark-accent) !important;
}

body.dark-theme table.books-compact-table td a:hover {
    color: var(--dark-accent-hover) !important;
}

/* Рекламные строки */
body.dark-theme table.books-compact-table tr.ad_row {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

body.dark-theme ul.search-results li.ad_type_catalog,
body.dark-theme ul.search-results li.ad_type_genre {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Знак рекламы */
body.dark-theme .sign_ad {
    background-color: var(--dark-accent) !important;
    color: var(--dark-bg-primary) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    font-weight: bold !important;
}

/* Иконки доступа */
body.dark-theme ul.search-results li .ac_read,
body.dark-theme ul.search-results li .ac_gen,
body.dark-theme ul.search-results li .ac_tr {
    filter: brightness(0.8) !important;
}

/* Tooltip для описаний */
body.dark-theme .tooltip_templates {
    display: none !important;
}

/* Кнопки действий */
body.dark-theme ul.search-results li .btn {
    background-color: var(--dark-bg-tertiary) !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme ul.search-results li .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-hover) !important;
}

body.dark-theme ul.search-results li .btn-danger {
    background-color: #d9534f !important;
    border-color: #d43f3a !important;
    color: white !important;
}

body.dark-theme ul.search-results li .btn-danger:hover {
    background-color: #c9302c !important;
    border-color: #ac2925 !important;
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ РЕЗУЛЬТАТОВ ПОИСКА ===== */

/* Пагинация для стандартного режима (как в других режимах) */
body.dark-theme .books-pagination {
    background: transparent !important;
}

body.dark-theme .books-pagination li {
    background: transparent !important;
}

body.dark-theme .books-pagination li a {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    text-decoration: none !important;
}

body.dark-theme .books-pagination li a:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .books-pagination li.active a {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .books-pagination li.active a:hover {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: white !important;
}

body.dark-theme .books-pagination li.disabled a {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-light) !important;
    color: var(--dark-text-disabled) !important;
    cursor: not-allowed !important;
}

body.dark-theme .books-pagination li.disabled a:hover {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-light) !important;
    color: var(--dark-text-disabled) !important;
}

/* Исправление эффекта зебры в компактном режиме */
body.dark-theme table.table-striped tbody > tr:nth-child(odd) > td,
body.dark-theme table.table-striped tbody > tr:nth-child(odd) > th {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme table.table-striped tbody > tr:nth-child(even) > td,
body.dark-theme table.table-striped tbody > tr:nth-child(even) > th {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Hover для таблицы с зеброй */
body.dark-theme table.table-hover tbody tr:hover > td,
body.dark-theme table.table-hover tbody tr:hover > th {
    background-color: var(--dark-bg-tertiary) !important;
}

/* Переопределяем Bootstrap table-striped для компактного режима */
body.dark-theme table.books-compact-table.table-striped tbody > tr:nth-child(odd) {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme table.books-compact-table.table-striped tbody > tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-theme table.books-compact-table.table-striped tbody > tr:nth-child(odd) > td {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme table.books-compact-table.table-striped tbody > tr:nth-child(even) > td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Hover для компактного режима */
body.dark-theme table.books-compact-table.table-hover tbody tr:hover,
body.dark-theme table.books-compact-table.table-hover tbody tr:hover > td {
    background-color: var(--dark-bg-tertiary) !important;
}

/* Дополнительные стили для устранения белых полос */
body.dark-theme .table tbody tr {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme .table tbody tr:hover {
    background-color: var(--dark-bg-tertiary) !important;
}

body.dark-theme .table tbody tr td {
    background-color: inherit !important;
}

/* ===== СТРАНИЦА КНИГИ (book/index) ===== */

/* Блок form-actions (подписка, скачивание) */
body.dark-theme .form-actions {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-actions .total_price,
body.dark-theme .form-actions .total_price_cnt {
    color: var(--dark-accent-orange) !important;
}

body.dark-theme .form-actions strong {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-actions em {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .form-actions small {
    color: var(--dark-text-muted) !important;
}

/* Информационный блок книги #Info */
body.dark-theme #Info {
    color: var(--dark-text-primary) !important;
}

body.dark-theme #Info .span2,
body.dark-theme #Info .span5,
body.dark-theme #Info .span6 {
    background-color: transparent !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme #Info .row {
    background-color: transparent !important;
}

/* Описание книги */
body.dark-theme #Info div[style*="margin: 20px"] {
    color: var(--dark-text-primary) !important;
}

/* Блок Boosty */
body.dark-theme #Info div[style*="background: #f7f7f7"] {
    background: var(--dark-bg-secondary) !important;
    border-left-color: #ff8c00 !important;
    color: var(--dark-text-primary) !important;
}

/* Тулбар кнопок управления (Добавить главы, Свойства книги и т.д.) */
body.dark-theme .btn-toolbar .btn,
body.dark-theme .btn-toolbar .btn.btn-small,
body.dark-theme .btn-toolbar-custom .btn,
body.dark-theme #moderator-toolbar .btn,
body.dark-theme #moderator-toolbar .btn.btn-small {
    background-color: var(--dark-bg-card) !important;
    background-image: none !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    text-shadow: none !important;
}

body.dark-theme .btn-toolbar .btn:hover,
body.dark-theme .btn-toolbar .btn.btn-small:hover,
body.dark-theme .btn-toolbar-custom .btn:hover,
body.dark-theme #moderator-toolbar .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* Конкретные цветные кнопки в тулбаре */
body.dark-theme .btn-toolbar .btn-success,
body.dark-theme .btn-toolbar-custom .btn-success {
    background-color: var(--dark-accent-green) !important;
    border-color: var(--dark-accent-green) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-toolbar .btn-info,
body.dark-theme .btn-toolbar-custom .btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

body.dark-theme .btn-toolbar .btn-warning,
body.dark-theme .btn-toolbar-custom .btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

body.dark-theme .btn-toolbar .btn-primary,
body.dark-theme .btn-toolbar-custom .btn-primary,
body.dark-theme .form-actions .btn-primary {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
    background-image: none !important;
}

/* Кнопки скачивания (Скачать .docx, fb2, pdf) */
body.dark-theme .form-actions .btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
    background-image: none !important;
}

body.dark-theme .form-actions .btn-info:hover {
    background-color: #3a8eff !important;
    border-color: #3a8eff !important;
}

body.dark-theme .form-actions .btn-success {
    background-color: var(--dark-accent-green) !important;
    border-color: var(--dark-accent-green) !important;
    color: #ffffff !important;
    background-image: none !important;
}

body.dark-theme .form-actions .btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    background-image: none !important;
}

/* Таблица глав #Chapters */
body.dark-theme #Chapters {
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme #Chapters thead tr {
    background-color: var(--dark-bg-tertiary) !important;
}

body.dark-theme #Chapters thead th {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme #Chapters tbody tr {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme #Chapters tbody tr:nth-child(odd) {
    background-color: var(--dark-bg-secondary) !important;
}

body.dark-theme #Chapters tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-theme #Chapters tbody tr:hover {
    background-color: var(--dark-bg-tertiary) !important;
}

body.dark-theme #Chapters tbody tr td {
    background-color: inherit !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme #Chapters tbody tr.info {
    background-color: rgba(74, 158, 255, 0.1) !important;
}

body.dark-theme #Chapters tbody tr.info td {
    background-color: inherit !important;
}

/* Строки томов */
body.dark-theme #Chapters tr.volume_helper td {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* Кнопка читать в таблице */
body.dark-theme #Chapters .btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
    background-image: none !important;
}

/* Кнопка "отметить прочитанным/непрочитанным" */
body.dark-theme #Chapters button[data-action="seen"] {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    background-image: none !important;
}

body.dark-theme #Chapters button[data-action="seen"].btn-info {
    background-color: var(--dark-accent-blue) !important;
    border-color: var(--dark-accent-blue) !important;
    color: #ffffff !important;
}

/* Статус иконки в таблице */
body.dark-theme #Chapters td .disabled {
    color: var(--dark-text-muted) !important;
}

/* Загрузка ячейки */
body.dark-theme #Chapters td.loading {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-secondary) !important;
}

body.dark-theme #Chapters td.editing {
    border-top-color: var(--dark-border-secondary) !important;
    border-bottom-color: var(--dark-border-secondary) !important;
    background: var(--dark-bg-card) !important;
}

/* Форма выбора количества глав */
body.dark-theme .form-inline {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-inline .control-label {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-inline select,
body.dark-theme .form-inline .input-mini {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-inline .btn-default,
body.dark-theme .form-inline .btn {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    background-image: none !important;
    text-shadow: none !important;
}

body.dark-theme .form-inline .btn-default:hover,
body.dark-theme .form-inline .btn:hover {
    background-color: var(--dark-bg-hover) !important;
    border-color: var(--dark-border-secondary) !important;
}

/* Чекбокс "выделить все главы" */
body.dark-theme .checkbox {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .checkbox label {
    color: var(--dark-text-primary) !important;
}

/* Блоки алертов */
body.dark-theme .alert {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .alert-info {
    background-color: rgba(74, 158, 255, 0.1) !important;
    border-color: var(--dark-accent-blue) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .alert-warning {
    background-color: rgba(255, 152, 0, 0.15) !important;
    border-color: var(--dark-accent-orange) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .alert-success {
    background-color: rgba(76, 175, 80, 0.15) !important;
    border-color: var(--dark-accent-green) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .alert-danger,
body.dark-theme .alert-error {
    background-color: rgba(244, 67, 54, 0.15) !important;
    border-color: var(--dark-accent-red) !important;
    color: var(--dark-text-primary) !important;
}

/* Лейблы */
body.dark-theme .label {
    color: #ffffff !important;
}

body.dark-theme .label-success {
    background-color: var(--dark-accent-green) !important;
}

body.dark-theme .label-info {
    background-color: var(--dark-accent-blue) !important;
}

body.dark-theme .label-warning {
    background-color: var(--dark-accent-orange) !important;
}

body.dark-theme .label-important,
body.dark-theme .label-danger {
    background-color: var(--dark-accent-red) !important;
}

/* Бейдж */
body.dark-theme .badge {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
}

/* Подзаголовок книги (оригинальное название) */
body.dark-theme div[style*="color: #999"] {
    color: var(--dark-text-muted) !important;
}

/* Заголовки h1, h2 на странице книги */
body.dark-theme h1,
body.dark-theme h2 {
    color: var(--dark-text-primary) !important;
}

/* (Пагинация перенесена в единый блок выше) */

/* Блок "Массовые действия с главами" */
body.dark-theme #mass_action_block {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme #mass_action_block .control-group {
    color: var(--dark-text-primary) !important;
}

body.dark-theme #mass_action_block .control-label {
    color: var(--dark-text-primary) !important;
}

body.dark-theme #mass_action_block select,
body.dark-theme #mass_action_block input[type="text"] {
    background-color: var(--dark-bg-primary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Массовые действия — новый дизайн */
body.dark-theme .mass-actions-container {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-actions-header {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .mass-actions-title {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-section {
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .mass-section-title {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-toggle {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-toggle:hover {
    background-color: var(--dark-bg-hover) !important;
}

body.dark-theme .mass-toggle-label {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-toggle-content {
    background-color: var(--dark-bg-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .mass-select,
body.dark-theme .mass-input {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-help-text {
    color: var(--dark-text-muted) !important;
}

body.dark-theme .mass-radio-item {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-radio-item:hover {
    background-color: var(--dark-bg-hover) !important;
}

body.dark-theme .mass-radio-item.active {
    border-color: var(--dark-accent-blue) !important;
}

body.dark-theme .mass-radio-item.active.success {
    border-color: var(--dark-accent-green) !important;
    color: var(--dark-accent-green) !important;
}

body.dark-theme .mass-radio-item.active.danger {
    border-color: var(--dark-accent-red) !important;
    color: var(--dark-accent-red) !important;
}

body.dark-theme .mass-access-table {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-access-table th,
body.dark-theme .mass-access-table td {
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-operation-item {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .mass-operation-item:hover {
    background-color: var(--dark-bg-hover) !important;
}

body.dark-theme .mass-operation-item.active {
    border-color: var(--dark-accent-blue) !important;
}

/* Рецензии */
body.dark-theme .alert-block {
    background-color: rgba(74, 158, 255, 0.08) !important;
    border-color: var(--dark-accent-blue) !important;
    color: var(--dark-text-primary) !important;
}

/* Прогресс-бар (сбор) */
body.dark-theme .progress {
    background-color: var(--dark-bg-tertiary) !important;
    border: none !important;
    box-shadow: none !important;
}

body.dark-theme .progress .bar {
    background-color: var(--dark-accent-blue) !important;
    background-image: none !important;
}

/* Иконки Bootstrap — инверсия для тёмной темы */
body.dark-theme [class^="icon-"],
body.dark-theme [class*=" icon-"] {
    filter: brightness(2) !important;
}

/* Исключения (иконки, которые не нужно инвертировать) */
body.dark-theme .icon-white,
body.dark-theme .btn-info [class^="icon-"],
body.dark-theme .btn-success [class^="icon-"],
body.dark-theme .btn-danger [class^="icon-"],
body.dark-theme .btn-warning [class^="icon-"],
body.dark-theme .btn-primary [class^="icon-"],
body.dark-theme .btn-info [class*=" icon-"],
body.dark-theme .btn-success [class*=" icon-"],
body.dark-theme .btn-danger [class*=" icon-"],
body.dark-theme .btn-warning [class*=" icon-"],
body.dark-theme .btn-primary [class*=" icon-"] {
    filter: none !important;
}

/* Комментарии */
body.dark-theme .comment-footer,
body.dark-theme .spoiler-trigger {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme textarea {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .comment-link {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* Well блоки */
body.dark-theme .well {
    background: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
    box-shadow: none !important;
}

/* Универсальные btn-small и btn-mini */
body.dark-theme .btn-small,
body.dark-theme .btn-mini {
    background-image: none !important;
    text-shadow: none !important;
}

/* Таблица — общие правила */
body.dark-theme table.table-condensed {
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme table.table-condensed th {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme table.table-condensed td {
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Модальные окна */
body.dark-theme .modal {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .modal-header {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .modal-body {
    background-color: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .modal-footer {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

body.dark-theme .modal-backdrop {
    background-color: #000 !important;
}

/* Контейнер и общий контент */
body.dark-theme .container {
    background-color: transparent !important;
    color: var(--dark-text-primary) !important;
}

/* Spoiler */
body.dark-theme .spoiler {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Футер */
body.dark-theme footer,
body.dark-theme .footer,
body.dark-theme #footer {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-secondary) !important;
}

/* ===== БЛОГ ===== */

/* Контейнер поста */
body.dark-theme .post {
    color: var(--dark-text-primary) !important;
}

/* Заголовки постов */
body.dark-theme .post h1 a,
body.dark-theme .post h2 a {
    color: #e2875a !important;
}
body.dark-theme .post h1 a:hover,
body.dark-theme .post h2 a:hover {
    color: #f0a070 !important;
}
body.dark-theme .post.topic-70 h2 a {
    color: #8fbc6a !important;
}
body.dark-theme .post.topic-64 h2 a {
    color: #e05050 !important;
}

/* Тело поста */
body.dark-theme .post .body {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .post.topic-70 .body {
    border-left-color: #8fbc6a !important;
}

/* Градиент для свёрнутого поста (была белая заливка) */
body.dark-theme .body-collapsed::after {
    background: linear-gradient(rgba(26,26,26,0), rgba(26,26,26,1)) !important;
}

/* Кнопка "Развернуть"/"Свернуть" */
body.dark-theme .expand-btn {
    color: #8ab4f8 !important;
}
body.dark-theme .expand-btn:hover {
    color: #aecbfa !important;
}

/* Футер поста (.info) */
body.dark-theme .post .info {
    background: var(--dark-bg-secondary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .post .info a {
    color: #8ab4f8 !important;
}
body.dark-theme .post .info a:hover {
    color: #aecbfa !important;
}
body.dark-theme .post .info .author {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .post .info .date {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .post .info .cmt .new {
    color: #f44336 !important;
}
body.dark-theme .post .info .tools a {
    color: #8ab4f8 !important;
}

/* Модерационное меню */
body.dark-theme #moder-topic-menu {
    background: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 10px 10px 20px rgba(0,0,0,.5) !important;
}
body.dark-theme #moder-topic-menu a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme #moder-topic-menu a:hover {
    color: #8ab4f8 !important;
}

/* Алерт модерации */
body.dark-theme .alert-error {
    background-color: rgba(180, 40, 40, 0.15) !important;
    border-color: #c0392b !important;
    color: #e8a0a0 !important;
}

/* Книга в посте */
body.dark-theme .post .book {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .post .book a {
    color: #8ab4f8 !important;
}

/* Изображения постов */
body.dark-theme .post .img img {
    border-color: var(--dark-border-primary) !important;
}

/* Спойлер-алерт лейбл */
body.dark-theme .label-important {
    background-color: #c0392b !important;
}

/* Бейджи */
body.dark-theme .badge-success {
    background-color: #2d8a3e !important;
}
body.dark-theme .badge-important {
    background-color: #c0392b !important;
}

/* Sidebar блога */
body.dark-theme #topics .nav-list li a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme #topics .nav-list li.active > a {
    background-color: var(--dark-bg-card) !important;
    color: #fff !important;
}
body.dark-theme #topics .nav-list li a:hover {
    background-color: var(--dark-bg-secondary) !important;
}

/* Страница редактирования поста */
body.dark-theme .form-actions {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* (Пагинация блога — покрыта единым блоком пагинации выше) */

/* ===== РЕЦЕНЗИИ (.announce) ===== */

/* Блок рецензии — тело (.msg) */
body.dark-theme .announce .b .msg {
    background: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Стрелочка-указатель (.v) — затемняем для тёмной темы */
body.dark-theme .announce .b .msg .v {
    filter: invert(1) brightness(0.4) !important;
}

/* Миниатюра книги */
body.dark-theme .announce .a .img {
    background-color: var(--dark-bg-secondary) !important;
}

/* Заголовок (название книги) */
body.dark-theme .announce .b h2 a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .announce .b h2 a:hover {
    color: #8ab4f8 !important;
}

/* Информация (автор рецензии) */
body.dark-theme .announce .b .info {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .announce .b .info a {
    color: #8ab4f8 !important;
}

/* Ссылка на комментарии */
body.dark-theme .announce .b .cmt a {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .announce .b .cmt a:hover {
    color: #8ab4f8 !important;
}

/* Иконки в рецензиях */
body.dark-theme .announce .b .cmt i {
    color: var(--dark-text-secondary) !important;
}

/* Спойлер-алерт внутри рецензии */
body.dark-theme .announce .label-important {
    background-color: #c0392b !important;
    color: #fff !important;
}

/* Рейтинг (палец вверх/вниз) */
body.dark-theme .announce .a .r {
    color: var(--dark-text-primary) !important;
}

/* ===== ОПОВЕЩЕНИЯ (старый дизайн) ===== */

/* Список оповещений */
body.dark-theme [name=Notices] li {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme [name=Notices] li.new {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-secondary) !important;
}
body.dark-theme [name=Notices] li.deleting {
    color: #777 !important;
    background-color: #333 !important;
}
body.dark-theme [name=Notices] li.deleting a {
    color: #777 !important;
}
body.dark-theme [name=Notices] li p.meta {
    border-top-color: var(--dark-border-primary) !important;
    color: var(--dark-text-secondary) !important;
}
body.dark-theme [name=Notices] li a {
    color: #8ab4f8 !important;
}

/* ===== ОПОВЕЩЕНИЯ (новый дизайн) ===== */

/* Переопределяем CSS-переменные для тёмной темы */
body.dark-theme .notices-container {
    --background: 0 0% 10%;
    --foreground: 0 0% 90%;
    --card: 0 0% 16%;
    --card-foreground: 0 0% 90%;
    --popover: 0 0% 16%;
    --popover-foreground: 0 0% 90%;
    --primary: 211 100% 55%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 20%;
    --secondary-foreground: 0 0% 90%;
    --muted: 0 0% 20%;
    --muted-foreground: 0 0% 65%;
    --accent: 0 0% 20%;
    --accent-foreground: 0 0% 90%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 25%;
    --input: 0 0% 25%;
    --ring: 211 100% 55%;
}
body.dark-theme .notices-container {
    background-color: transparent !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .notice-item {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notice-item a {
    color: #8ab4f8 !important;
}
body.dark-theme .notice-meta {
    color: var(--dark-text-secondary) !important;
}

/* Sidebar новый дизайн */
body.dark-theme .notices-sidebar .sidebar-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .notices-sidebar .sidebar-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .notices-nav-item {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .notices-nav-item.active {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .notices-sidebar .filter-button {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .filter-button.active {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .notices-sidebar .action-button {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .action-button:hover {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .notices-sidebar .action-button-primary {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .notices-sidebar .settings-description {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .notices-sidebar .checkbox-label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .checkbox-text {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-sidebar .checkbox-custom {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-secondary) !important;
}
body.dark-theme .notice-info {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .notice-info-content {
    color: var(--dark-text-secondary) !important;
}

/* Плавающие меню (мобильные) */
body.dark-theme .floating-menu {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .floating-menu-item {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .floating-menu-item:hover,
body.dark-theme .floating-menu-item.active {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .floating-menu-section-title {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .floating-action-button {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}

/* Модальное окно настроек */
body.dark-theme .modal-settings-content {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .modal-settings-header {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .modal-settings-body {
    color: var(--dark-text-primary) !important;
}

/* Пустое состояние */
body.dark-theme .empty-state {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .empty-state-title {
    color: var(--dark-text-primary) !important;
}

/* ===== МОИ ОБНОВЛЕНИЯ ===== */

/* Переопределяем CSS-переменные для тёмной темы */
body.dark-theme .updates-container {
    --background: 0 0% 10%;
    --foreground: 0 0% 90%;
    --card: 0 0% 16%;
    --card-foreground: 0 0% 90%;
    --popover: 0 0% 16%;
    --popover-foreground: 0 0% 90%;
    --primary: 211 100% 55%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 22%;
    --secondary-foreground: 0 0% 90%;
    --muted: 0 0% 22%;
    --muted-foreground: 0 0% 65%;
    --accent: 0 0% 22%;
    --accent-foreground: 0 0% 90%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 25%;
    --input: 0 0% 25%;
    --ring: 211 100% 55%;
}

/* Контейнер обновлений */
body.dark-theme .updates-container {
    color: var(--dark-text-primary) !important;
}

/* Карточки обновлений */
body.dark-theme .update-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .update-card.new-chapter {
    background-color: #1a2a3a !important;
    border-color: #2a4a6a !important;
}
body.dark-theme .update-card:hover {
    border-color: var(--dark-border-secondary) !important;
}
body.dark-theme .update-card::after {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.03), transparent) !important;
}

/* Заголовки и ссылки в карточках */
body.dark-theme .update-title a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .update-title a:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .update-meta {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .update-date {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .update-langs {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .chapter-price {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .chapter-purchased {
    color: #4caf50 !important;
}

/* Фильтры */
body.dark-theme .filters-container {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .filters-container .filter-button {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .filters-container .filter-button:hover {
    background-color: #333 !important;
}
body.dark-theme .filters-container .filter-button.active,
body.dark-theme .filters-container .filter-button.active-info {
    background-color: #2980b9 !important;
    color: #fff !important;
}
body.dark-theme .filters-container .filter-button.active-warning {
    background-color: #b8860b !important;
    color: #fff !important;
}
body.dark-theme .filters-container .filter-button.active-success {
    background-color: #27ae60 !important;
    color: #fff !important;
}

/* Клиентские фильтры */
body.dark-theme .client-filters {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .client-filters-title {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .client-filter-button {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .client-filter-button.active {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}

/* Группировка по книгам */
body.dark-theme .book-group {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .book-group-header {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-group-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-group-title a {
    color: #8ab4f8 !important;
}

/* Sidebar обновлений */
body.dark-theme .sidebar {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .sidebar-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .sidebar-content {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .sidebar-content p {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .sidebar-subtitle {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .sidebar-form .checkbox-label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .sidebar-form .checkbox-input {
    accent-color: var(--dark-accent-blue) !important;
}
body.dark-theme .indicator-help-item {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .indicator-help-item span {
    color: var(--dark-text-primary) !important;
}

/* Плавающее меню обновлений (мобильное) */
body.dark-theme .floating-menu-filters .floating-menu-item {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .floating-menu-filters .floating-menu-item.active {
    background-color: var(--dark-bg-secondary) !important;
    color: #8ab4f8 !important;
}

/* Пагинация обновлений */
body.dark-theme .notices-pagination .pagination-list li a {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .notices-pagination .pagination-list li.active a {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}

/* Переключатель группировки */
body.dark-theme .grouping-toggle {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .grouping-toggle-label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .grouping-toggle-text {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .grouping-toggle-slider {
    background-color: #555 !important;
}
body.dark-theme .grouping-toggle-switch input:checked + .grouping-toggle-slider {
    background-color: var(--dark-accent-blue) !important;
}
body.dark-theme .book-group-toggle {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-group-toggle:hover {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}

/* Загрузчик */
body.dark-theme .updates-loader-text {
    color: var(--dark-text-secondary) !important;
}

/* ===== РЕЙТИНГ ПОЛЬЗОВАТЕЛЕЙ ===== */

/* Контейнер таблицы */
body.dark-theme .for_table_container {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Заголовки таблицы */
body.dark-theme .grid-view table.items th {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .grid-view table.items th a {
    color: #8ab4f8 !important;
}

/* Ячейки таблицы */
body.dark-theme .grid-view table.items td {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .grid-view table.items td a {
    color: #8ab4f8 !important;
}

/* Строки при наведении */
body.dark-theme .grid-view table.items tr:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Колонка сортировки */
body.dark-theme .grid-view table.items td.r,
body.dark-theme .grid-view table.items th.r {
    background-color: var(--dark-bg-secondary) !important;
}

/* Sidebar - карточки */
body.dark-theme .users-sidebar-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
body.dark-theme .users-sidebar-title {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}

/* Статистика */
body.dark-theme .users-stats,
body.dark-theme .users-stats-text {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .users-stats b {
    color: #8ab4f8 !important;
}

/* Поле ввода поиска */
body.dark-theme .users-form-input,
body.dark-theme .users-search-form input[type="text"] {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .users-form-input:focus,
body.dark-theme .users-search-form input[type="text"]:focus {
    border-color: #8ab4f8 !important;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2) !important;
}
body.dark-theme .users-form-input::placeholder {
    color: var(--dark-text-secondary) !important;
}

/* Кнопка "Найти" */
body.dark-theme .users-button-primary {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .users-button-primary:hover {
    background-color: #1a73e8 !important;
}

/* Ссылки в sidebar */
body.dark-theme .users-sidebar-card a {
    color: #8ab4f8 !important;
}
body.dark-theme .users-sidebar-card a:hover {
    color: #aecbfa !important;
}

/* ===== СТРАНИЦА ПОМОЩИ (FAQ) ===== */

/* Переопределяем CSS-переменные */
body.dark-theme .help-container {
    --background: 0 0% 10%;
    --foreground: 0 0% 90%;
    --card: 0 0% 16%;
    --card-foreground: 0 0% 90%;
    --popover: 0 0% 16%;
    --popover-foreground: 0 0% 90%;
    --primary: 211 100% 55%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 22%;
    --secondary-foreground: 0 0% 90%;
    --muted: 0 0% 22%;
    --muted-foreground: 0 0% 65%;
    --accent: 0 0% 22%;
    --accent-foreground: 0 0% 90%;
    --destructive: 0 70% 55%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 25%;
    --input: 0 0% 25%;
    --ring: 211 100% 55%;
}
body.dark-theme .help-container {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .help-accordion-item {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .help-accordion-trigger {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .help-accordion-trigger:hover {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .help-accordion-content {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .help-accordion-content a {
    color: #8ab4f8 !important;
}
body.dark-theme .help-accordion-content img.illu {
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .help-footer {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .help-footer a {
    color: #8ab4f8 !important;
}
body.dark-theme .help-footer-tip {
    background-color: var(--dark-bg-secondary) !important;
}

/* ===== КОМАНДЫ ===== */

/* Переопределяем CSS-переменные для тёмной темы */
body.dark-theme .team-container,
body.dark-theme .team-sidebar {
    --background: 0 0% 10%;
    --foreground: 0 0% 90%;
    --card: 0 0% 16%;
    --card-foreground: 0 0% 90%;
    --popover: 0 0% 16%;
    --popover-foreground: 0 0% 90%;
    --primary: 211 100% 55%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 22%;
    --secondary-foreground: 0 0% 90%;
    --muted: 0 0% 22%;
    --muted-foreground: 0 0% 65%;
    --accent: 0 0% 22%;
    --accent-foreground: 0 0% 90%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 25%;
    --input: 0 0% 25%;
    --ring: 211 100% 55%;
}

/* Карточки команд */
body.dark-theme .team-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .team-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-title a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-title a:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .team-content {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-description {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .team-info {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .team-info-item {
    color: var(--dark-text-secondary) !important;
}

/* "Ещё +N" книг */
body.dark-theme .book-more {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-secondary) !important;
}

/* Sidebar команд */
body.dark-theme .team-sidebar-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-sidebar-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-form-label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-form-checkbox-label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-form-checkbox-label span {
    color: var(--dark-text-primary) !important;
}

/* Select (выпадающий список) */
body.dark-theme .team-select,
body.dark-theme .team-form-input {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-select option {
    background-color: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
}

/* Кнопка "Сбросить" */
body.dark-theme .team-button-outline {
    background-color: transparent !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-button-outline:hover {
    background-color: var(--dark-bg-secondary) !important;
}

/* Бейджи */
body.dark-theme .team-badge {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #8ab4f8 !important;
}

/* Вкладки */
body.dark-theme .team-tab {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .team-tab:hover {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-tab.active {
    color: #8ab4f8 !important;
}

/* Таблица участников */
body.dark-theme .team-table th {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .team-table td {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .team-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ===== ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ ===== */

/* Переопределяем переменные профиля */
body.dark-theme .profile-header-container,
body.dark-theme .profile-sidebar,
body.dark-theme .profile-container {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #999;
    --border-color: #444;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Карточка профиля (шапка) */
body.dark-theme .profile-header-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-header-avatar {
    border-color: #555 !important;
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .profile-header-info {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-header-info a {
    color: #8ab4f8 !important;
}

/* Sidebar карточки */
body.dark-theme .profile-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-card-header {
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-card-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-card-description {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-card-content {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-login {
    color: var(--dark-text-secondary) !important;
}

/* Статистика */
body.dark-theme .profile-stat-item {
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-stat-label {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-stat-value {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-stat-mini {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-stat-number {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-stat-text {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-stat-card {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Секции профиля */
body.dark-theme .profile-section-title {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-section-content {
    color: var(--dark-text-primary) !important;
}

/* Таблица личной информации */
body.dark-theme .for_table_container table.personal th {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .for_table_container table.personal td {
    color: var(--dark-text-primary) !important;
}

/* Фильтры */
body.dark-theme .profile-filter-btn {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-filter-btn:hover,
body.dark-theme .profile-filter-btn.active {
    background-color: #3498db !important;
    color: #fff !important;
}

/* Ссылки в профиле */
body.dark-theme .profile-sidebar a {
    color: #8ab4f8 !important;
}
body.dark-theme .profile-quick-action {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-quick-action:hover {
    color: #8ab4f8 !important;
}

/* Табы навигации профиля */
body.dark-theme .profile-header-tabs a {
    color: var(--dark-text-secondary) !important;
    border-color: transparent !important;
}
body.dark-theme .profile-header-tabs a:hover,
body.dark-theme .profile-header-tabs a.active {
    color: #8ab4f8 !important;
}

/* Прогресс-бар */
body.dark-theme .profile-progress-bar {
    background-color: var(--dark-border-primary) !important;
}

/* Алерт/предупреждение */
body.dark-theme .profile-header-card .alert-warning {
    background-color: rgba(243, 156, 18, 0.15) !important;
    border-color: rgba(243, 156, 18, 0.3) !important;
    color: #f5c842 !important;
}

/* Книги пользователя */
body.dark-theme .book-card-container {
    color: var(--dark-text-primary) !important;
}

/* ===== ПЛАТЕЖИ (Пополнение/Вывод) ===== */

/* Переопределяем CSS-переменные */
body.dark-theme .payments-container {
    --background: 0 0% 10%;
    --foreground: 0 0% 90%;
    --card: 0 0% 16%;
    --card-foreground: 0 0% 90%;
    --popover: 0 0% 16%;
    --popover-foreground: 0 0% 90%;
    --primary: 211 100% 55%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 22%;
    --secondary-foreground: 0 0% 90%;
    --muted: 0 0% 22%;
    --muted-foreground: 0 0% 65%;
    --accent: 0 0% 22%;
    --accent-foreground: 0 0% 90%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 25%;
    --input: 0 0% 25%;
    --ring: 211 100% 55%;
}
body.dark-theme .payments-container {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payments-header {
    border-bottom-color: var(--dark-border-primary) !important;
}

/* Крипто-карточка */
body.dark-theme .crypto-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .crypto-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .crypto-address {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .crypto-address-text {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .crypto-copy-button {
    color: #8ab4f8 !important;
}
body.dark-theme .crypto-note {
    color: var(--dark-text-secondary) !important;
}

/* Методы оплаты */
body.dark-theme .payment-method {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payment-method:hover {
    border-color: var(--dark-border-secondary) !important;
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .payment-method.selected {
    border-color: #3498db !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
}
body.dark-theme .payment-method-name {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payment-method-description {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .payment-method-custom-radio {
    border-color: var(--dark-border-secondary) !important;
}

/* Контейнер метода (оболочка) */
body.dark-theme .payments-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payments-card-header {
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Алерты на странице платежей */
body.dark-theme .payments-container .alert-info,
body.dark-theme .payments-container .alert-warning {
    background-color: rgba(52, 152, 219, 0.15) !important;
    border-color: rgba(52, 152, 219, 0.3) !important;
    color: var(--dark-text-primary) !important;
}

/* Последний вывод */
body.dark-theme .last-payout-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Формы ввода на страницах платежей */
body.dark-theme .payments-container input[type="text"],
body.dark-theme .payments-container input[type="number"],
body.dark-theme .payments-container input[type="email"],
body.dark-theme .payments-container select,
body.dark-theme .payments-container textarea {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Бейджи на методах */
body.dark-theme .payment-badge {
    color: #fff !important;
}

/* Карточка формы оплаты */
body.dark-theme .payment-form-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payment-form-title {
    color: var(--dark-text-primary) !important;
}

/* Уведомление */
body.dark-theme .payment-notice {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .payment-notice-text {
    color: var(--dark-text-secondary) !important;
}

/* Срочный вывод */
body.dark-theme .urgent-block {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* ===== ПОДСТРАНИЦЫ ПРОФИЛЯ (team, collections, history, advert и т.д.) ===== */

/* Основной контент */
body.dark-theme .profile-main-content {
    color: var(--dark-text-primary) !important;
}

/* Таблицы профиля */
body.dark-theme .profile-history-table thead {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .profile-history-table th {
    color: var(--dark-text-secondary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-history-table td {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-history-table td a {
    color: #8ab4f8 !important;
}
body.dark-theme .profile-history-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}
body.dark-theme .profile-history-date {
    color: var(--dark-text-secondary) !important;
}

/* Фильтры-кнопки в подстраницах */
body.dark-theme .team-filter-btn {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .team-filter-btn:hover,
body.dark-theme .team-filter-btn.active {
    background-color: #3498db !important;
    color: #fff !important;
    border-color: #3498db !important;
}

/* Роль-бейдж */
body.dark-theme .profile-role-badge {
    background-color: rgba(52, 152, 219, 0.3) !important;
    color: #8ab4f8 !important;
}

/* Ссылки в таблицах */
body.dark-theme .profile-team-link {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-team-link:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .profile-site-link {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-site-link:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .profile-book-link {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-book-link:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .profile-book-count {
    color: var(--dark-text-primary) !important;
}

/* Пустое состояние */
body.dark-theme .profile-empty-state {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .profile-empty-state svg {
    color: #555 !important;
}

/* Приглашения */
body.dark-theme .profile-invite-item {
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-invite-info {
    color: var(--dark-text-primary) !important;
}

/* Табы навигации профиля (Переводы, Карма, Посты...) */
body.dark-theme .profile-tabs li a {
    color: var(--dark-text-secondary) !important;
    border-color: transparent !important;
    background-color: transparent !important;
}
body.dark-theme .profile-tabs li a:hover {
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) var(--dark-border-primary) transparent !important;
}
body.dark-theme .profile-tabs li.active a {
    color: var(--dark-text-primary) !important;
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) var(--dark-border-primary) var(--dark-bg-card) !important;
}
body.dark-theme .profile-tabs-container {
    border-bottom-color: var(--dark-border-primary) !important;
}

/* Общие input/select/textarea на подстраницах профиля */
body.dark-theme .profile-main-content input[type="text"],
body.dark-theme .profile-main-content input[type="number"],
body.dark-theme .profile-main-content input[type="date"],
body.dark-theme .profile-main-content input[type="email"],
body.dark-theme .profile-main-content input[type="search"],
body.dark-theme .profile-main-content select,
body.dark-theme .profile-main-content textarea {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-main-content input::placeholder {
    color: var(--dark-text-secondary) !important;
}

/* Сервисные карточки (услуги) */
body.dark-theme .service-card,
body.dark-theme .profile-service-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .service-card img {
    border-color: var(--dark-border-primary) !important;
}

/* Алерты/инфо на подстраницах */
body.dark-theme .profile-main-content .alert-info {
    background-color: rgba(52, 152, 219, 0.15) !important;
    border-color: rgba(52, 152, 219, 0.3) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-main-content .alert-warning {
    background-color: rgba(243, 156, 18, 0.15) !important;
    border-color: rgba(243, 156, 18, 0.3) !important;
    color: #f5c842 !important;
}
body.dark-theme .profile-main-content .alert-success {
    background-color: rgba(46, 204, 113, 0.15) !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
    color: #2ecc71 !important;
}

/* MagicSuggest в чёрном списке */
body.dark-theme .profile-main-content .ms-ctn {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-main-content .ms-ctn input {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-main-content .ms-res-ctn {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-main-content .ms-res-item {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-main-content .ms-res-item-active {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .profile-main-content .ms-sel-item {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* Черный список — fieldset/legend */
body.dark-theme .profile-main-content fieldset {
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-main-content legend {
    color: var(--dark-text-primary) !important;
}

/* Статистика чтения (sidebar на History) */
body.dark-theme .profile-sidebar .profile-section {
    border-color: var(--dark-border-primary) !important;
}

/* Общий grid-view (если встречается) */
body.dark-theme .profile-main-content .grid-view table th {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-main-content .grid-view table td {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}

/* Пагинация в подстраницах профиля */
body.dark-theme .profile-pagination .pager a,
body.dark-theme .profile-pagination .pagination a {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-pagination .pager .selected a,
body.dark-theme .profile-pagination .pagination .active a {
    background-color: #3498db !important;
    color: #fff !important;
}

/* Промо-код, абонементы */
body.dark-theme .profile-main-content .well {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Кнопки outline в профиле */
body.dark-theme .profile-btn-outline {
    background-color: transparent !important;
    border-color: var(--dark-border-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-btn-outline:hover {
    background-color: var(--dark-bg-secondary) !important;
}

/* Расходы (advert) - полоса "Потрачено" */
body.dark-theme .profile-main-content .progress {
    background-color: var(--dark-bg-secondary) !important;
}

/* ===== ЧЁРНЫЙ СПИСОК ПРОЕКТОВ ===== */

/* Блоки атрибутов (Жанры, Теги, Фандомы и т.д.) */
body.dark-theme .attributes-groups .attributes {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .attributes-groups .attributes label {
    color: var(--dark-text-primary) !important;
}

/* Поля поиска внутри блоков */
body.dark-theme .attributes .search input[type="search"] {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .attributes .search input::placeholder {
    color: var(--dark-text-secondary) !important;
}

/* Выпадающий поиск */
body.dark-theme .attributes .search .search__wrap {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5) !important;
}
body.dark-theme .attributes .search .search__wrap button {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .attributes .search .search__wrap button:hover {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .attributes .search:focus-within .search__wrap:empty:before {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-secondary) !important;
}

/* Выбранные теги/жанры */
body.dark-theme .attributes-groups .selected .select {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .attributes-groups .selected .select span {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .attributes-groups .selected .select a {
    color: #8ab4f8 !important;
}
body.dark-theme .attributes-groups .selected .btn {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .attributes-groups .selected:empty::before {
    color: #8ab4f8 !important;
}

/* help-block текст */
body.dark-theme .help-block {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .help-block p,
body.dark-theme .help-block ul,
body.dark-theme .help-block li {
    color: var(--dark-text-secondary) !important;
}

/* Select (режим чёрного списка) */
body.dark-theme form > div > select {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}

/* Кнопки формы */
body.dark-theme .form-actions {
    background-color: transparent !important;
    border-top-color: var(--dark-border-primary) !important;
}

/* ===== УСЛУГИ (services) ===== */

/* Информационные сообщения */
body.dark-theme .profile-info-message {
    background-color: rgba(52, 152, 219, 0.15) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-info-message a {
    color: #8ab4f8 !important;
}

/* Категории услуг */
body.dark-theme .profile-service-category-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-service-link {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-service-link:hover {
    color: #8ab4f8 !important;
}

/* Карточки услуг */
body.dark-theme .profile-service-card {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-service-title {
    color: var(--dark-text-primary) !important;
}

/* Модальное окно заявки */
body.dark-theme .profile-modal-content {
    background-color: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-modal-header {
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-modal-header h3 {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-modal-body {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-modal-footer {
    border-top-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-textarea {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .profile-btn-secondary {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .profile-btn-disabled {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-secondary) !important;
}

/* ==========================================
   СТРАНИЦА СТАТИСТИКИ (stat.php)
   Все блоки используют inline-стили, поэтому
   переопределяем через CSS-селекторы по атрибутам
   ========================================== */

/* --- Белые карточки-контейнеры --- */
body.dark-theme div[style*="background: white"][style*="border-radius: 4px"] {
    background: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
}

/* Серый контейнер (Топ-5 книг) */
body.dark-theme div[style*="background: #f5f5f5"][style*="border-radius: 4px"] {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* --- Заголовки h4 внутри карточек --- */
body.dark-theme h4[style*="color: #333"] {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}

/* --- Метрики (серые блоки с данными) --- */
body.dark-theme div[style*="background: #fafafa"][style*="border: 1px solid #e0e0e0"] {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme div[style*="background: #f9f9f9"][style*="border: 1px solid #e0e0e0"] {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme div[style*="padding: 12px; background: #f9f9f9"][style*="border-radius: 3px"] {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* --- Подсказки/заметки внизу карточек --- */
body.dark-theme div[style*="background: #f9f9f9"][style*="border-left: 3px solid"] {
    background: var(--dark-bg-tertiary) !important;
}

/* --- Информационные баннеры (синие) --- */
body.dark-theme div[style*="background: #f0f7ff"] {
    background: rgba(74, 144, 226, 0.15) !important;
}

/* --- Инсайты (белые с цветной левой границей) --- */
body.dark-theme div[style*="background: white"][style*="border-left: 4px solid"] {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* --- KPI карточки с градиентами (конверсия, вовлечённость) --- */
body.dark-theme div[style*="linear-gradient(135deg, #e8f5e9"] {
    background: rgba(40, 167, 69, 0.15) !important;
}
body.dark-theme div[style*="linear-gradient(135deg, #c8e6c9"] {
    background: rgba(40, 167, 69, 0.15) !important;
}
body.dark-theme div[style*="linear-gradient(135deg, #fff9e6"] {
    background: rgba(212, 175, 55, 0.15) !important;
}
body.dark-theme div[style*="linear-gradient(135deg, #ffeaa7"] {
    background: rgba(212, 175, 55, 0.15) !important;
}
body.dark-theme div[style*="linear-gradient(135deg, #ffebee"] {
    background: rgba(231, 76, 60, 0.15) !important;
}
body.dark-theme div[style*="linear-gradient(135deg, #ffcdd2"] {
    background: rgba(231, 76, 60, 0.15) !important;
}

/* Прогноз дохода (JS-генерируемый зелёный блок) */
body.dark-theme div[style*="background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%)"] {
    background: rgba(40, 167, 69, 0.2) !important;
    border-color: rgba(40, 167, 69, 0.4) !important;
}
body.dark-theme div[style*="background: rgba(212, 175, 55, 0.1)"] {
    background: rgba(212, 175, 55, 0.15) !important;
}

/* --- Текстовые цвета (inline) --- */
body.dark-theme div[style*="font-size: 28px"][style*="color: #333"],
body.dark-theme div[style*="font-size: 20px"][style*="color: #333"],
body.dark-theme div[style*="font-size: 24px"][style*="color: #333"] {
    color: var(--dark-text-primary) !important;
}
body.dark-theme td[style*="font-weight: 600"][style*="color: #333"],
body.dark-theme td[style*="color: #333"] {
    color: var(--dark-text-primary) !important;
}
body.dark-theme span[style*="color: #444"],
body.dark-theme div[style*="color: #444"] {
    color: #ccc !important;
}
body.dark-theme td[style*="color: #555"] {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme th[style*="color: #666"],
body.dark-theme div[style*="color: #666"][style*="font-size: 11px"] {
    color: var(--dark-text-muted) !important;
}
body.dark-theme small[style*="color: #666"] {
    color: var(--dark-text-muted) !important;
}
body.dark-theme i[style*="color: #666"] {
    color: #999 !important;
}
body.dark-theme strong[style*="color: #333"] {
    color: var(--dark-text-primary) !important;
}
body.dark-theme strong[style*="color: #333; font-size: 13px"] {
    color: var(--dark-text-primary) !important;
}

/* --- Таблицы с inline белым фоном --- */
body.dark-theme table.table-bordered[style*="background: white"],
body.dark-theme table.table-hover[style*="background: white"] {
    background: var(--dark-bg-card) !important;
}
body.dark-theme table.table-bordered {
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme table.table-bordered > thead > tr > th,
body.dark-theme table.table-bordered > tbody > tr > th,
body.dark-theme table.table-bordered > tbody > tr > td,
body.dark-theme table.table-bordered > tfoot > tr > td {
    border-color: var(--dark-border-primary) !important;
}

/* Заголовки таблиц */
body.dark-theme tr[style*="background: #fafafa"] {
    background: var(--dark-bg-tertiary) !important;
}

/* Строки таблиц с динамическим фоном */
body.dark-theme tr[style*="background: #fcfcfc"],
body.dark-theme tr[style*="background: #fefefe"] {
    background: var(--dark-bg-card) !important;
}

/* Строки таблиц с rgba фоном (тепловая карта) */
body.dark-theme tr[style*="background: rgba(230"] {
    background: var(--dark-bg-secondary) !important;
}

/* Строка лучшего дня (с зелёной границей) */
body.dark-theme tr[style*="background: #f0f7ff"] {
    background: rgba(74, 144, 226, 0.15) !important;
}

/* --- Полосы прогресса --- */
body.dark-theme div[style*="background: #e0e0e0"][style*="height: 8px"] {
    background: var(--dark-bg-tertiary) !important;
}

/* --- Таблица основных данных (table-condensed tablesorter) --- */
body.dark-theme .for_table_container .table-condensed {
    background: var(--dark-bg-card) !important;
}
body.dark-theme .for_table_container .table-condensed thead th {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .for_table_container .table-condensed tbody td {
    color: var(--dark-text-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .for_table_container .table-condensed tbody td a {
    color: #8ab4f8 !important;
}
body.dark-theme .for_table_container .table-condensed tfoot td {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    font-weight: bold;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .for_table_container .table-striped tbody > tr:nth-child(odd) > td {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .for_table_container .table-striped tbody > tr:nth-child(even) > td {
    background-color: var(--dark-bg-card) !important;
}

/* --- Форма дат и фильтров --- */
body.dark-theme #custom_period .input-small,
body.dark-theme #custom_period .add-on {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme #custom_books input {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}

/* --- Лейблы и радиокнопки --- */
body.dark-theme .control-group .control-label,
body.dark-theme label.radio {
    color: var(--dark-text-primary) !important;
}

/* --- MagicSuggest на странице статистики --- */
body.dark-theme #custom_books .ms-ctn {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme #custom_books .ms-ctn input {
    color: var(--dark-text-primary) !important;
}

/* --- Datepicker --- */
body.dark-theme .datepicker {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .datepicker table tr td,
body.dark-theme .datepicker table tr th {
    color: var(--dark-text-primary) !important;
    background: transparent !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .datepicker table tr td.active,
body.dark-theme .datepicker table tr td.active:hover {
    background-color: var(--dark-accent-blue) !important;
    color: #fff !important;
}
body.dark-theme .datepicker table tr td.today {
    background-color: var(--dark-bg-tertiary) !important;
}
body.dark-theme .datepicker table tr td:hover {
    background-color: var(--dark-bg-hover) !important;
}
body.dark-theme .datepicker table tr td.day.disabled {
    color: var(--dark-text-disabled) !important;
}
body.dark-theme .datepicker thead tr:first-child th:hover,
body.dark-theme .datepicker tfoot tr th:hover {
    background-color: var(--dark-bg-hover) !important;
}

/* --- Дополнительные стили для em (период) --- */
body.dark-theme em {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme em a {
    color: #8ab4f8 !important;
}

/* ==========================================
   СТРАНИЦА ОШИБОК (error.php)
   ========================================== */
body.dark-theme .errorpage .instruction-item {
    background: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .errorpage .instruction-header {
    background: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .errorpage .instruction-item h1,
body.dark-theme .errorpage .instruction-item h3,
body.dark-theme .errorpage .instruction-item p,
body.dark-theme .errorpage .instruction-item div {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .errorpage .instruction-item .title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .errorpage div[style*="background: white"] {
    background: var(--dark-bg-tertiary) !important;
}
body.dark-theme .errorpage {
    color: var(--dark-text-primary) !important;
}

/* ==========================================
   СТРАНИЦА ТЕХРАБОТ (development.php)
   ========================================== */
body.dark-theme div[style*="background: #f5f5f5"][style*="gap: 4px"] {
    background: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* ==========================================
   СТРАНИЦА ТОП (top.php)
   ========================================== */
body.dark-theme ol.search-resolts li:hover {
    background: var(--dark-bg-secondary) !important;
}
body.dark-theme ol.search-resolts li .meta {
    color: var(--dark-text-muted) !important;
}
body.dark-theme ol.search-resolts li .meta a {
    color: #8ab4f8 !important;
}
body.dark-theme ol.search-resolts li p a {
    color: var(--dark-text-primary) !important;
}

/* ==========================================
   ЛЕНТА НА ГЛАВНОЙ (index.php, .imged)
   ========================================== */
body.dark-theme .imged {
    background-color: var(--dark-bg-primary) !important;
}
body.dark-theme .imged li {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .imged li:nth-child(even) {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .imged li:hover {
    background-color: var(--dark-bg-hover) !important;
}
body.dark-theme .imged li .bimg {
    background-color: var(--dark-bg-card) !important;
}
body.dark-theme .imged li .info {
    color: var(--dark-text-muted) !important;
}
body.dark-theme .imged li p.title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .imged li p.title a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .imged li p.title a.muted {
    color: var(--dark-text-secondary) !important;
}
body.dark-theme .imged li p.title a.muted:hover {
    color: #8ab4f8 !important;
}
body.dark-theme .imged li button {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .imged li button:hover {
    background-color: var(--dark-bg-hover) !important;
}

/* Модальное окно фильтров ленты */
body.dark-theme #f-ready-ini .modal-header {
    background-color: var(--dark-bg-secondary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme #f-ready-ini .modal-body {
    background-color: var(--dark-bg-card) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme #f-ready-ini .modal-footer {
    background-color: var(--dark-bg-secondary) !important;
    border-top-color: var(--dark-border-primary) !important;
}
body.dark-theme #f-ready-ini .modal-body label {
    color: var(--dark-text-primary) !important;
}
body.dark-theme #f-ready-ini .modal-body legend {
    color: var(--dark-text-primary) !important;
    border-bottom-color: var(--dark-border-primary) !important;
}

/* ==========================================
   СЛАЙДЕР КНИГ (book-rows, slick-slider)
   ========================================== */
body.dark-theme .book-rows {
    background-color: transparent !important;
}
body.dark-theme .row-bg {
    background: var(--dark-bg-card) !important;
}
body.dark-theme .book-rows > .row-books {
    background-color: transparent !important;
}
body.dark-theme .book-rows > .row-books h3 {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows .image-container {
    background: var(--dark-bg-secondary) !important;
}
body.dark-theme .book-rows .row-book {
    background-color: transparent !important;
}
body.dark-theme .book-rows .row-books .title {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows .title h4 {
    color: var(--dark-text-primary) !important;
}

/* Старый стиль слайдера (если используется) */
body.dark-theme .row-book .title {
    background-image: none !important;
    color: var(--dark-text-primary) !important;
}

/* Слайдер Slick в тёмной теме */
body.dark-theme .slick-slider {
    background-color: transparent !important;
}
body.dark-theme .slick-slide {
    background-color: transparent !important;
}
body.dark-theme .slick-track {
    background-color: transparent !important;
}
body.dark-theme .slick-list {
    background-color: transparent !important;
}
body.dark-theme .slick-prev,
body.dark-theme .slick-next {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .slick-prev:hover,
body.dark-theme .slick-next:hover {
    background-color: var(--dark-bg-hover) !important;
}
body.dark-theme .slick-prev:before,
body.dark-theme .slick-next:before {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .slick-dots {
    background-color: transparent !important;
}
body.dark-theme .slick-dots li button {
    background-color: var(--dark-border-primary) !important;
}
body.dark-theme .slick-dots li button:before {
    color: var(--dark-border-primary) !important;
}
body.dark-theme .slick-dots li.slick-active button {
    background-color: var(--dark-accent) !important;
}
body.dark-theme .slick-dots li.slick-active button:before {
    color: var(--dark-accent) !important;
}

/* ==========================================
   SWIPER СЛАЙДЕР (для каталога /search)
   ========================================== */
body.dark-theme .book-rows-swiper {
    background-color: transparent !important;
}
body.dark-theme .book-rows-swiper > .row-books {
    background-color: transparent !important;
}
body.dark-theme .book-rows-swiper > .row-books h3 {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows-swiper .row-bg {
    background: var(--dark-bg-card) !important;
}
body.dark-theme .book-rows-swiper > .row-books .row-book {
    background-color: transparent !important;
}
body.dark-theme .book-rows-swiper > .row-books .row-book .image-container {
    background: var(--dark-bg-secondary) !important;
}
body.dark-theme .book-rows-swiper > .row-books .row-book .title {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows-swiper > .row-books .row-book .title h4 {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows-swiper > .row-books .row-book a::after {
    background: rgba(255, 255, 255, 0.1) !important;
}
body.dark-theme .book-rows-swiper .swiper-button-next,
body.dark-theme .book-rows-swiper .swiper-button-prev {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-rows-swiper .swiper-button-next:after,
body.dark-theme .book-rows-swiper .swiper-button-prev:after {
    color: var(--dark-text-primary) !important;
}

/* Слайдер рекламы в каталоге на всю ширину */
body.dark-theme .catalog-ads-fullwidth {
    background: var(--dark-bg-card) !important;
}
body.dark-theme .catalog-ads-fullwidth .book-rows-swiper {
    background-color: transparent !important;
}

/* ==========================================
   СПИСОК ГЛАВ В ОБНОВЛЕНИЯХ
   ========================================== */
body.dark-theme .book-row,
body.dark-theme .chapter-row {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
}
body.dark-theme .book-row:nth-child(even),
body.dark-theme .chapter-row:nth-child(even) {
    background-color: var(--dark-bg-secondary) !important;
}
body.dark-theme .book-row:hover,
body.dark-theme .chapter-row:hover {
    background-color: var(--dark-bg-hover) !important;
}
body.dark-theme .book-row a,
body.dark-theme .chapter-row a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-row .book-title,
body.dark-theme .chapter-row .chapter-title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .book-row .chapter-link,
body.dark-theme .chapter-row .chapter-link {
    color: #8ab4f8 !important;
}
body.dark-theme .book-row .meta,
body.dark-theme .chapter-row .meta {
    color: var(--dark-text-muted) !important;
}

/* ==========================================
   БЫСТРЫЙ ПОИСК (autocomplete dropdown)
   ========================================== */
/* Поле ввода поиска в шапке */
body.dark-theme .search-query,
body.dark-theme input.search-query,
body.dark-theme .main-header input[type="search"],
body.dark-theme .main-header input[type="text"] {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .search-query::placeholder,
body.dark-theme input.search-query::placeholder {
    color: var(--dark-text-muted) !important;
}
body.dark-theme .search-query:focus,
body.dark-theme input.search-query:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-accent) !important;
}

/* Dropdown с результатами поиска */
body.dark-theme .autocomplete-suggestions {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .autocomplete-suggestion {
    background-color: var(--dark-bg-card) !important;
    border-bottom-color: var(--dark-border-primary) !important;
    color: var(--dark-text-primary) !important;
}
body.dark-theme .autocomplete-suggestion:hover {
    background-color: var(--dark-bg-hover) !important;
}
body.dark-theme .autocomplete-suggestion .title {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .autocomplete-suggestion a {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .autocomplete-suggestion strong {
    color: #8ab4f8 !important;
}
body.dark-theme .autocomplete-suggestion table {
    color: var(--dark-text-primary) !important;
}
body.dark-theme .autocomplete-suggestion td {
    color: var(--dark-text-primary) !important;
}