/**
 * Тёмная тема админ-центра.
 * Активируется классом theme-dark на <html> (сохраняется в localStorage, ключ adminTheme = 'dark').
 */

/* --- Базовые --- */
html.theme-dark body {
    background: #0f172a;
    color: #e2e8f0;
}

html.theme-dark body.has-sidebar {
    background: #171717;
}

/* Контент во фрейме (вкладке) — тот же фон, что и в остальных фреймах, не чёрный */
html.theme-dark body.in-tab-frame {
    background: #171717 !important;
}

/* --- Скроллбары в тёмной теме (трек и ползунок) --- */
html.theme-dark {
    scrollbar-color: #64748b #334155;
    scrollbar-width: thin;
}
html.theme-dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
html.theme-dark ::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}
html.theme-dark ::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}
html.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
html.theme-dark ::-webkit-scrollbar-corner {
    background: #334155;
}

/* --- Страница без сайдбара (например index) --- */
html.theme-dark .header {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html.theme-dark .header h1 {
    color: #f1f5f9;
}

html.theme-dark .subtitle {
    color: #94a3b8;
}

html.theme-dark .no-clubs {
    background: #1e293b;
    color: #94a3b8;
}

/* --- Основная область с сайдбаром --- */
html.theme-dark .main-content {
    background: #171717;
}

html.theme-dark .main-content > .tabs-bar {
    background: #1e293b;
    border-bottom-color: #7c889b;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

html.theme-dark .main-content > .tabs-bar-inner .tab-btn {
    color: #94a3b8;
    background: #334155;
    border-color: #475569;
}

html.theme-dark .main-content > .tabs-bar-inner .tab-btn:hover {
    background: #475569;
    color: #cbd5e1;
}

html.theme-dark .main-content > .tabs-bar-inner .tab-btn.active {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #475569;
    border-bottom-color: #7c889b;
}

html.theme-dark .main-content > .tabs-bar-inner .tab-btn-close {
    color: #94a3b8;
}

html.theme-dark .main-content > .tabs-bar-inner .tab-btn-close:hover {
    color: #cbd5e1;
    background: #475569;
}

html.theme-dark .main-content > .tabs-panes > .tab-pane.tab-pane-closing-overlay {
    background: #171717;
}

/* --- Карточка контента --- */
html.theme-dark .page-content-card {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* Формы редактирования — сохраняем скругление (как на формах списка) */
html.theme-dark .main-content:has(.doc-form) .page-content-card {
    background: #1e293b !important;
    border-radius: 12px;
}

html.theme-dark .main-content:has(.doc-form) .container.doc-form-full {
    background: #1e293b;
    border-radius: 12px;
}

html.theme-dark .doc-form,
html.theme-dark .doc-form form {
    background: transparent;
}

html.theme-dark .doc-form .doc-header {
    background: #1e293b;
    border-color: #334155 !important;
    border-radius: 12px;
    box-shadow: none;
}

html.theme-dark .page-content-card .stats-section:not(:first-child),
html.theme-dark .page-content-card .info-section:not(:first-child),
html.theme-dark .page-content-card .navigation-section:not(:first-child) {
    border-top-color: #334155;
}

/* Всплывающее увеличенное превью — тёмная формочка */
html.theme-dark .preview-zoom-popup {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Предпросмотр изображения на формах (Акции, Пакеты, Номенклатура) — не яркий фон */
html.theme-dark #promoImagePreview,
html.theme-dark #imagePreview {
    background: #334155 !important;
    border-color: #475569 !important;
}
html.theme-dark #promoImagePreview span,
html.theme-dark #imagePreview span {
    color: #94a3b8 !important;
}
/* Текст «Не загружено» при ошибке загрузки картинки (вставляется через JS) */
html.theme-dark #promoImagePreview span[style*="color"],
html.theme-dark #imagePreview span[style*="color"] {
    color: #94a3b8 !important;
}

/* --- Сайдбар 1С --- */
html.theme-dark .sidebar.sidebar-1c {
    background: #1e293b;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-rail {
    background: #1e293b;
}

html.theme-dark .sidebar-1c-close-btn {
    background: #1e293b;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

html.theme-dark .sidebar-1c-close-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn {
    color: #94a3b8;
    background: transparent;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn::before {
    background: #475569;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn:hover::before,
html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn.active::before {
    background: #64748b;
}

/* Как у подразделов: тёмный фон при наведении и в активном состоянии, светлый текст */
html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    border-color: transparent;
    box-shadow: none;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-color: transparent;
    box-shadow: none;
}

html.theme-dark .sidebar.sidebar-1c.panel-open .sidebar-1c-section-btn.active {
    background: rgba(255, 255, 255, 0.08);
    border-right: none;
    border-color: transparent;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn:hover::after,
html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-btn.active::after {
    color: #94a3b8;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-section-label {
    color: inherit;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-tabs-wrap {
    border-top-color: #334155;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn {
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn:hover {
    background: #334155;
    color: #cbd5e1;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn.active {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #475569;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn-close:hover {
    background: #334155;
    color: #cbd5e1;
}

/* Панель меню (выдвижная) */
html.theme-dark .sidebar.sidebar-1c .sidebar-1c-panel {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-panel-body {
    background: #1e293b;
}

html.theme-dark .sidebar-1c-panel-back {
    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

html.theme-dark .sidebar-1c-panel-back:hover {
    background: #334155;
    color: #f1f5f9;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-general-col-title,
html.theme-dark .sidebar.sidebar-1c .sidebar-1c-panel-section-title {
    color: #94a3b8;
    border-bottom-color: #334155;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-item {
    color: #cbd5e1;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-item:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-item.active {
    color: #f1f5f9;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-item-icon {
    background: transparent;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-item:hover .sidebar-1c-item-icon {
    background: transparent;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-profile-card {
    border-top-color: #334155;
    border-bottom-color: #334155;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-profile-name {
    color: #f1f5f9;
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-logout {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

html.theme-dark .sidebar.sidebar-1c .sidebar-1c-bottom {
    border-top-color: #334155;
}

html.theme-dark .sidebar-1c-manual-link {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}
html.theme-dark .sidebar-1c-manual-link:hover {
    background: #475569;
    color: #f1f5f9;
}

html.theme-dark .theme-toggle-btn {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

html.theme-dark .theme-toggle-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

/* Кнопка открытия меню (мобильная) */
html.theme-dark .sidebar-toggle {
    background: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.theme-dark .sidebar-toggle:hover {
    background: #475569;
}

/* --- Таблицы --- */
html.theme-dark .table-container {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html.theme-dark thead {
    background: #334155;
}

html.theme-dark th {
    color: #f1f5f9;
    border-bottom-color: #475569;
}

html.theme-dark td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

html.theme-dark tr:hover {
    background: #334155;
}

/* --- Формы --- */
html.theme-dark .form-group label {
    color: #e2e8f0;
}

html.theme-dark .form-group input,
html.theme-dark .form-group select,
html.theme-dark .form-group textarea {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .form-group input::placeholder,
html.theme-dark .form-group textarea::placeholder {
    color: #64748b;
}

html.theme-dark .form-group input:focus,
html.theme-dark .form-group select:focus,
html.theme-dark .form-group textarea:focus {
    border-color: #818cf8;
}

/* --- Настройки админ. центра: читаемость и выпадающий список в тёмной теме --- */
html.theme-dark .admin-settings-section-title {
    color: #f1f5f9 !important;
    border-bottom-color: #334155 !important;
}

html.theme-dark .admin-settings-row {
    border-bottom-color: #334155 !important;
}

html.theme-dark .admin-settings-row label {
    color: #e2e8f0 !important;
}

html.theme-dark .admin-settings-row .hint {
    color: #94a3b8 !important;
}

html.theme-dark .admin-settings-row select {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html.theme-dark .admin-settings-row select:focus {
    border-color: #64748b !important;
    outline: none !important;
}

html.theme-dark .admin-settings-row select option {
    background: #1e293b;
    color: #e2e8f0;
}

html.theme-dark .admin-settings-row input[type="text"],
html.theme-dark .admin-settings-row input[type="number"],
html.theme-dark .admin-settings-row input[type="password"] {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html.theme-dark .admin-settings-row input[type="text"]:focus,
html.theme-dark .admin-settings-row input[type="number"]:focus,
html.theme-dark .admin-settings-row input[type="password"]:focus {
    border-color: #64748b !important;
    outline: none !important;
}

html.theme-dark .admin-settings-row input[type="checkbox"] {
    accent-color: #64748b;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}

html.theme-dark .admin-settings-row input[type="checkbox"]:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

html.theme-dark .admin-settings-integration-info {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* Настройки рулеток: общая плашка (жёлтый/янтарный фон) в тёмной теме, текст нейтральный светлый */
html.theme-dark .roulette-general-notice {
    background: #422006 !important;
    border-color: #b45309 !important;
    color: #e7e5e4 !important;
}
html.theme-dark .roulette-general-notice strong {
    color: #fafaf9 !important;
}
html.theme-dark .doc-form .doc-header.doc-header-roulette {
    border-bottom-color: #334155 !important;
}
html.theme-dark .doc-form .doc-section-title {
    color: #f1f5f9 !important;
}

/* Настройки рулеток: плашка и таблицы в тёмной теме */
html.theme-dark .roulette-coins-notice {
    background: #1e3a5f !important;
    border-color: #2563eb !important;
    color: #93c5fd !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table th,
html.theme-dark .admin-settings-section .roulette-settings-table td {
    border-bottom-color: #334155 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table th {
    background: #334155 !important;
    color: #f1f5f9 !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table input.input-chance,
html.theme-dark .admin-settings-section .roulette-settings-table input.input-num,
html.theme-dark .admin-settings-section .roulette-settings-table input[type="text"] {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table select {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table tr.coin-row-new td {
    background: #1e3a2f !important;
}
html.theme-dark .admin-settings-section .roulette-settings-table .hint {
    color: #94a3b8 !important;
}

/* --- Кнопки --- */
html.theme-dark .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

html.theme-dark .btn-secondary:hover {
    background: #475569;
}

/* --- Секции страницы клуба (stats, nav, info) --- */
html.theme-dark .stats-section,
html.theme-dark .navigation-section,
html.theme-dark .info-section {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html.theme-dark .stats-section h2,
html.theme-dark .navigation-section h2,
html.theme-dark .info-section h2 {
    color: #f1f5f9;
}

html.theme-dark .nav-card {
    background: #334155;
    color: #e2e8f0;
}

html.theme-dark .nav-card:hover {
    background: #475569;
    border-color: #6366f1;
}

html.theme-dark .nav-title {
    color: #f1f5f9;
}

html.theme-dark .nav-description {
    color: #94a3b8;
}

html.theme-dark .info-item {
    background: #334155;
}

html.theme-dark .info-item .label {
    color: #94a3b8;
}

html.theme-dark .info-item .value {
    color: #e2e8f0;
}

html.theme-dark .info-label {
    color: #94a3b8;
}

html.theme-dark .info-value {
    color: #e2e8f0;
}

html.theme-dark .club-card {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html.theme-dark .club-header {
    border-bottom-color: #334155;
}

html.theme-dark .club-header h2 {
    color: #f1f5f9;
}

html.theme-dark .club-id {
    background: #334155;
    color: #94a3b8;
}

/* Top spent (медали оставляем яркими, остальное — тёмное) */
html.theme-dark .top-spent-item:nth-child(n+4) {
    background: #334155;
    color: #e2e8f0;
}

/* --- Алерты --- */
html.theme-dark .alert-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-left-color: #22c55e;
}

html.theme-dark .alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-left-color: #ef4444;
}

html.theme-dark .alert-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-left-color: #3b82f6;
}

html.theme-dark .alert-warning {
    background: rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
    border-left-color: #fbbf24 !important;
}

html.theme-dark .alert-warning a,
html.theme-dark .alert-warning .btn {
    color: inherit;
}

/* --- Демо-баннер --- */
html.theme-dark .demo-banner {
    background: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
    border-color: #f59e0b;
}

html.theme-dark .demo-banner a {
    color: #fcd34d;
}

html.theme-dark .demo-banner a:hover {
    color: #fde68a;
}

/* --- Информационная плашка (формула) --- */
html.theme-dark .info-banner-formula {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
    color: #93c5fd;
    border-color: #3b82f6;
}
html.theme-dark .info-banner-formula strong {
    color: #60a5fa;
}

/* --- Модальные окна --- */
html.theme-dark .modal-content,
html.theme-dark .doc-period-modal .modal-box {
    background: #1e293b !important;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .modal-header {
    border-bottom-color: #475569 !important;
}

html.theme-dark .modal-header h3 {
    color: #f1f5f9 !important;
}

html.theme-dark .modal-close {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html.theme-dark .modal-close:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

html.theme-dark .modal-form-group label,
html.theme-dark .doc-period-modal .step label {
    color: #e2e8f0;
}

html.theme-dark .modal-form-group input,
html.theme-dark .modal-form-group select,
html.theme-dark .modal-form-group textarea,
html.theme-dark .doc-period-modal .step input,
html.theme-dark .modal-content textarea {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .modal-form-group input:disabled,
html.theme-dark .doc-period-modal .step input:disabled {
    background: #334155 !important;
    color: #64748b !important;
}

/* Ошибка валидации даты в модалке периода (тёмная тема) */
html.theme-dark .doc-period-modal .step input.invalid {
    border-color: #f87171 !important;
    background: #450a0a !important;
}
html.theme-dark .doc-period-modal .step .error {
    color: #fca5a5;
}

/* Иконка календаря в полях type="date" — белая в тёмной теме */
html.theme-dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.85;
    cursor: pointer;
}
html.theme-dark input[type="date"]::-webkit-date-and-time-value {
    color: #e2e8f0;
}

html.theme-dark .payment-type-radio:not(.selected) {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html.theme-dark .payment-type-radio:not(.selected) > div {
    color: #e2e8f0 !important;
}

html.theme-dark .payment-type-radio.selected,
html.theme-dark .payment-type-radio.selected > div {
    color: #ffffff !important;
}

html.theme-dark .payment-type-radio:hover:not(.selected) {
    background-color: #475569 !important;
    border-color: #64748b !important;
    color: #f1f5f9 !important;
}

html.theme-dark .payment-type-radio:hover:not(.selected) > div {
    color: #f1f5f9 !important;
}

html.theme-dark .modal-actions,
html.theme-dark .doc-period-modal .modal-actions {
    border-top-color: #475569;
}

html.theme-dark .modal-actions .btn-modal-secondary,
html.theme-dark .modal-actions button[type="button"].btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

html.theme-dark .modal-actions .btn-modal-secondary:hover,
html.theme-dark .modal-actions button[type="button"].btn-secondary:hover {
    background: #475569;
}

html.theme-dark .btn-primary,
html.theme-dark .modal-actions .btn-primary,
html.theme-dark .modal-actions .btn-modal-primary,
html.theme-dark .modal-actions button[type="submit"] {
    background: #475569;
    color: #e2e8f0;
}

html.theme-dark .btn-primary:hover,
html.theme-dark .modal-actions .btn-primary:hover:not(:disabled),
html.theme-dark .modal-actions .btn-modal-primary:hover:not(:disabled),
html.theme-dark .modal-actions button[type="submit"]:hover:not(:disabled) {
    background: #64748b;
    color: #f1f5f9;
}

/* --- Toast --- */
html.theme-dark .toast {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html.theme-dark .toast.toast-error {
    background: rgba(239, 68, 68, 0.2);
}

html.theme-dark .toast.toast-warning {
    background: rgba(245, 158, 11, 0.4) !important;
    border: 1px solid rgba(251, 191, 36, 0.5);
}

html.theme-dark .toast.toast-warning .toast-content {
    color: #fef3c7 !important;
}

html.theme-dark .toast.toast-success {
    background: rgba(34, 197, 94, 0.2);
}

html.theme-dark .toast.toast-info {
    background: rgba(59, 130, 246, 0.2);
}

html.theme-dark .toast-content {
    color: #e2e8f0;
}

html.theme-dark .toast-close {
    color: #94a3b8;
}

html.theme-dark .toast-close:hover {
    color: #f1f5f9;
}

/* --- Доп. элементы (документы, отчёты, рабочее место) --- */
html.theme-dark .doc-period-modal .modal-hint {
    color: #94a3b8;
}

/* Таблица в iframe/документах — общий контейнер */
html.theme-dark .doc-table-wrap,
html.theme-dark .doc-list-table-scroll {
    background: #1e293b;
}

/* Загрузка вкладки (спиннер) */
html.theme-dark .main-content > .tabs-panes > .tab-pane.tab-pane-loading::after {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.4);
}

/* Одна кнопка закрытия в углу фрейма: во фрейме — тёмная, как раньше маска */
html.theme-dark body.in-tab-frame .tab-close-control.tab-close-floating-btn,
html.theme-dark body.in-tab-frame .tab-close-control.tab-close-icon-btn {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
html.theme-dark body.in-tab-frame .tab-close-control.tab-close-floating-btn:hover,
html.theme-dark body.in-tab-frame .tab-close-control.tab-close-icon-btn:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* Страница статистики club.php — доп. блоки */
html.theme-dark .revenue-compare-wrap,
html.theme-dark .stats-kpi-card,
html.theme-dark .stats-chart-wrap {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html.theme-dark .revenue-compare-wrap h2,
html.theme-dark .club-stats-page .stats-section h2,
html.theme-dark .club-stats-page h2 {
    color: #f1f5f9 !important;
}

html.theme-dark .revenue-compare-wrap .revenue-labels,
html.theme-dark .stats-kpi-card .stats-kpi-label,
html.theme-dark .stats-chart-wrap h3 {
    color: #94a3b8 !important;
}

html.theme-dark .club-stats-page .stats-section p {
    color: #94a3b8 !important;
}

html.theme-dark .stats-kpi-card .stats-kpi-value {
    color: #f1f5f9 !important;
}

html.theme-dark .stats-kpi-card.income .stats-kpi-value {
    color: #86efac !important;
}

html.theme-dark .stats-kpi-card.expense .stats-kpi-value {
    color: #fca5a5 !important;
}

html.theme-dark .stats-kpi-card.balance .stats-kpi-value {
    color: #93c5fd !important;
}

/* ========== Отчёты (report-page.report-1c) — в стиле списков документов (.doc-list), например «Ведомость на выплату зарплаты» ========== */
html.theme-dark .report-page.report-1c .doc-toolbar .doc-title {
    color: #f1f5f9;
}

html.theme-dark .report-page.report-1c .doc-table-wrap {
    background: #1e293b;
    border-color: #334155;
    border-top: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.theme-dark .report-page.report-1c .doc-list-table-scroll {
    background: #1e293b;
}

/* Сама таблица — без белого фона, чтобы строка «Нет записей…» была на тёмном фоне */
html.theme-dark .report-page.report-1c .doc-table,
html.theme-dark .report-page.report-1c .report-table {
    background: transparent !important;
}

html.theme-dark .report-page.report-1c .doc-table th,
html.theme-dark .report-page.report-1c .report-table th {
    background: #334155;
    color: #f1f5f9;
    border-bottom-color: #475569;
    box-shadow: 0 1px 0 0 #475569;
}

html.theme-dark .report-page.report-1c .doc-table td,
html.theme-dark .report-page.report-1c .report-table td {
    color: #cbd5e1;
    border-bottom-color: #334155;
    font-size: 13px;
}

/* Заголовки таблицы — единый размер с данными (колонка «Дата» и остальные) */
html.theme-dark .report-page.report-1c .doc-table th,
html.theme-dark .report-page.report-1c .report-table th {
    font-size: 13px;
}

/* Полосатые строки отчётов — тёмные тона как у .doc-list (инлайновые стили страниц переопределяем через !important) */
html.theme-dark .report-page.report-1c .doc-table tbody tr.report-row-stripe-0,
html.theme-dark .report-page.report-1c .report-table tbody tr.report-row-stripe-0 {
    background: #1e293b !important;
}
html.theme-dark .report-page.report-1c .doc-table tbody tr.report-row-stripe-1,
html.theme-dark .report-page.report-1c .report-table tbody tr.report-row-stripe-1 {
    background: #252d3d !important;
}

html.theme-dark .report-page.report-1c .doc-table tbody tr:hover,
html.theme-dark .report-page.report-1c .report-table tbody tr:hover {
    background: #334155 !important;
}

/* Ссылки в таблицах отчётов — как в списках документов */
html.theme-dark .report-page.report-1c .doc-table td a,
html.theme-dark .report-page.report-1c .report-table td a,
html.theme-dark .report-page.report-1c .doc-table .doc-list-empty a,
html.theme-dark .report-page.report-1c .report-table .doc-list-empty a {
    color: #93c5fd !important;
}
html.theme-dark .report-page.report-1c .doc-table td a:hover,
html.theme-dark .report-page.report-1c .report-table td a:hover,
html.theme-dark .report-page.report-1c .doc-table .doc-list-empty a:hover,
html.theme-dark .report-page.report-1c .report-table .doc-list-empty a:hover {
    color: #bfdbfe !important;
}

html.theme-dark .report-page.report-1c .report-table .report-row-total,
html.theme-dark .report-page.report-1c .report-table .report-row-total td {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-bottom-color: #475569;
}

html.theme-dark .report-page.report-1c .report-table .report-group-header {
    background: #334155;
    color: #cbd5e1;
}

html.theme-dark .report-page.report-1c .report-table .report-row-subtotal td {
    background: #1e293b;
    border-top-color: #475569;
    color: #cbd5e1;
}

html.theme-dark .report-page.report-1c .report-shift-header,
html.theme-dark .report-page.report-1c .report-contractor-header {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

html.theme-dark .report-page.report-1c .report-shift-header:hover,
html.theme-dark .report-page.report-1c .report-contractor-header:hover {
    background: #475569;
}

html.theme-dark .report-page.report-1c .report-shift-summary {
    background: #334155;
    border-top-color: #475569;
    color: #cbd5e1;
}

html.theme-dark .report-page.report-1c .report-contractor-block {
    background: #1e293b;
    border-color: #334155;
}

/* Блок смены в отчёте «Действия администраторов» — как оборотно-сальдовая (тёмный блок, таблица внутри) */
html.theme-dark .report-page.report-1c .report-shift-block {
    background: #1e293b;
    border-color: #334155;
}

html.theme-dark .report-page.report-1c .report-shift-block .report-shift-body .doc-table-wrap {
    background: transparent;
    border-color: #334155;
    border-top: none;
}

/* «Нет зафиксированных действий за смену» и пустые состояния внутри таблиц смен */
html.theme-dark .report-page.report-1c .report-table .report-no-actions {
    color: #94a3b8;
}

html.theme-dark .report-page.report-1c .report-table .report-income { color: #86efac; }
html.theme-dark .report-page.report-1c .report-table .report-expense { color: #fca5a5; }

html.theme-dark .report-page.report-1c .stats-dashboard {
    background: #1e293b;
    border-color: #334155;
}

html.theme-dark .report-page.report-1c .stats-dashboard h2,
html.theme-dark .report-page.report-1c .stats-dashboard .stats-dashboard-toggle {
    color: #f1f5f9;
}

html.theme-dark .report-page.report-1c .stats-kpi-card {
    background: #334155;
    border-color: #475569;
}

html.theme-dark .report-page.report-1c .stats-kpi-card .stats-kpi-label {
    color: #94a3b8;
}

html.theme-dark .report-page.report-1c .stats-kpi-card .stats-kpi-value {
    color: #e2e8f0;
}

html.theme-dark .report-page.report-1c .stats-kpi-card.income .stats-kpi-value {
    color: #86efac;
}

html.theme-dark .report-page.report-1c .stats-kpi-card.expense .stats-kpi-value {
    color: #fca5a5;
}

html.theme-dark .report-page.report-1c .report-summary {
    background: #1e293b;
    border-color: #334155;
}

html.theme-dark .report-page.report-1c .report-summary-item .label {
    color: #94a3b8;
}

html.theme-dark .report-page.report-1c .report-summary-item .value {
    color: #e2e8f0;
}

html.theme-dark .report-page.report-1c .report-summary-item.income .value {
    color: #86efac;
}

html.theme-dark .report-page.report-1c .report-summary-item.expense .value {
    color: #fca5a5;
}

html.theme-dark .report-page.report-1c .doc-table .doc-list-empty {
    color: #94a3b8;
}

/* Тулбар отчёта: селекты и кнопки */
html.theme-dark .report-page.report-1c .report-toolbar select,
html.theme-dark .report-page.report-1c .report-toolbar input[type="date"],
html.theme-dark .report-page.report-1c .report-toolbar input[type="text"] {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .report-page.report-1c .report-toolbar button,
html.theme-dark .report-page.report-1c .report-toolbar a[href] {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .report-page.report-1c .report-toolbar a[href]:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

html.theme-dark .report-page.report-1c .report-period {
    color: #94a3b8;
}

/* Подписи к чекбоксам в тулбаре отчётов (Группировка по виду ДС, по залам, по сменам и т.д.) */
html.theme-dark .report-page.report-1c .report-toolbar label {
    color: #e2e8f0 !important;
}
html.theme-dark .report-page.report-1c .report-toolbar label:hover {
    color: #f1f5f9 !important;
}
html.theme-dark .report-page.report-1c .report-toolbar input[type="checkbox"] {
    accent-color: #64748b;
}
html.theme-dark .report-page.report-1c .report-toolbar label:hover input[type="checkbox"] {
    accent-color: #94a3b8;
}

/* ========== Дашборд администратора (club_admin_dashboard) ========== */
html.theme-dark .dashboard-header h1 {
    color: #f1f5f9;
}

html.theme-dark .dashboard-header .sub {
    color: #94a3b8;
}

html.theme-dark .dashboard-section {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.theme-dark .dashboard-section h2 {
    background: #334155;
    border-bottom-color: #475569;
    color: #f1f5f9;
}

html.theme-dark .dashboard-section .body {
    color: #cbd5e1;
}

html.theme-dark .dashboard-kpi-card {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

html.theme-dark .dashboard-kpi-card .label {
    color: #94a3b8;
}

html.theme-dark .dashboard-kpi-card .value {
    color: #e2e8f0;
}

html.theme-dark .dashboard-section-collapsible {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.theme-dark .dashboard-section-collapsible .dashboard-section-summary {
    background: #334155;
    border-bottom-color: #475569;
    color: #f1f5f9;
}

html.theme-dark .dashboard-section-collapsible .dashboard-section-summary::after {
    color: #94a3b8;
}

html.theme-dark .dashboard-section-collapsible .body {
    color: #cbd5e1;
}

html.theme-dark .dashboard-table th {
    color: #94a3b8;
    border-bottom-color: #475569;
}

html.theme-dark .dashboard-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

html.theme-dark .dashboard-table tbody tr:hover {
    background: #334155;
}

html.theme-dark .dashboard-table .muted {
    color: #64748b;
}

html.theme-dark .dashboard-period-form input[type="date"] {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .dashboard-period-form button {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .dashboard-period-form button:hover {
    background: #475569;
    color: #f1f5f9;
}

html.theme-dark .dashboard-period-form label {
    color: #94a3b8;
}

html.theme-dark .dashboard-empty {
    color: #94a3b8;
}

/* ========== Списки документов (.doc-list) ========== */
html.theme-dark .doc-list .doc-toolbar .doc-title {
    color: #f1f5f9;
}

html.theme-dark .doc-list .doc-table-wrap {
    background: #1e293b;
    border-color: #334155;
    border-top: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.theme-dark .doc-list .doc-table th {
    background: #334155;
    color: #f1f5f9;
    border-bottom-color: #475569;
    box-shadow: 0 1px 0 0 #475569;
}

/* Заголовки с сортировкой — как обычные: яркий белый текст (эталон — заголовки без сортировки) */
html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link,
html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link:hover,
html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link.active,
html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link.active:hover {
    color: #f1f5f9;
}

html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link::after {
    color: #cbd5e1;
    opacity: 0.9;
}

html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link:hover::after,
html.theme-dark .doc-list .doc-list-th-sort .doc-list-sort-link.active::after {
    color: #e2e8f0;
    opacity: 1;
}

html.theme-dark .doc-list .doc-table td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

html.theme-dark .doc-list .doc-table tbody tr:hover {
    background: #334155;
}

html.theme-dark .doc-list .doc-table .doc-list-empty {
    color: #94a3b8;
}

/* Ссылки в списках (Акции и др.) — хорошо видимы в тёмной теме */
html.theme-dark .doc-list .doc-table td a,
html.theme-dark .doc-list .doc-table .doc-list-empty a {
    color: #93c5fd !important;
}
html.theme-dark .doc-list .doc-table td a:hover,
html.theme-dark .doc-list .doc-table .doc-list-empty a:hover {
    color: #bfdbfe !important;
}

html.theme-dark .doc-list .doc-list-search-input,
html.theme-dark .doc-list .doc-list-filters select {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .doc-list .doc-list-filters label {
    color: #94a3b8;
}

html.theme-dark .doc-list .doc-list-period-display {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .doc-list .doc-list-period-display.empty {
    color: #64748b;
}

/* Кнопка выбора периода (календарь) — тёмный фон */
html.theme-dark .doc-list .doc-list-period-block .doc-period-btn-icon {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

html.theme-dark .doc-list .doc-list-period-block .doc-period-btn-icon:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    color: #f1f5f9;
}

/* Итоговая строка списка документов — тёмная тема */
html.theme-dark .doc-list .doc-list-totals-bar {
    background: #334155 !important;
    border-top: none !important;
}

html.theme-dark .doc-list .doc-list-totals-bar-summary .doc-list-totals-summary-label {
    color: #94a3b8 !important;
}

html.theme-dark .doc-list .doc-list-totals-summary-item {
    color: #e2e8f0;
}

html.theme-dark .doc-list .doc-list-totals-table .doc-list-totals-row td {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* Чекбоксы выбора строк — тёмный фон (не белый) */
html.theme-dark .doc-list .doc-table input[type="checkbox"].doc-list-row-check {
    accent-color: #64748b;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}

html.theme-dark .doc-list .doc-table input[type="checkbox"].doc-list-row-check:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

html.theme-dark .doc-list .doc-table th.doc-list-col-check input[type="checkbox"] {
    accent-color: #64748b;
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}

html.theme-dark .doc-list .doc-table th.doc-list-col-check input[type="checkbox"]:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Выделенные строки — нейтральный тёмный акцент (без фиолетового) */
html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.selected {
    background: #475569 !important;
}

html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.selected:hover {
    background: #64748b !important;
}

html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.selected td {
    color: #f1f5f9 !important;
}

html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.doc-list-row-opened {
    background: #334155 !important;
    box-shadow: inset 0 0 0 2px #64748b;
}

html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.doc-list-row-opened:hover {
    background: #475569 !important;
}

html.theme-dark .doc-list .doc-table tbody tr.doc-list-row.doc-list-row-opened td {
    color: #e2e8f0 !important;
}

/* Пагинация списка — без белого и без фиолетового */
html.theme-dark .doc-list .doc-list-pagination {
    border-top-color: #475569;
}

html.theme-dark .doc-list .doc-list-pagination-per-page {
    color: #94a3b8;
}

html.theme-dark .doc-list .doc-list-per-page-select {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .doc-list .doc-list-pagination-link {
    color: #cbd5e1;
}

html.theme-dark .doc-list .doc-list-pagination-link:hover {
    background: #475569;
    color: #f1f5f9;
}

/* Текущая страница — нейтральный тёмный, не фиолетовый */
html.theme-dark .doc-list .doc-list-pagination-link.current {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

/* ========== Форма документа (.doc-form) — Новая пересменка и др. ========== */
html.theme-dark .doc-form .doc-toolbar .doc-title {
    color: #f1f5f9;
}

html.theme-dark .doc-form .doc-header .doc-header-field label {
    color: #94a3b8;
}

/* Все блоки в шапке документа — тёмная обводка, без белой (принудительно) */
html.theme-dark .doc-form .doc-header .doc-header-field-readonly .doc-field-locked {
    background: #334155;
    border: 1px solid #475569 !important;
    color: #cbd5e1;
}

/* Реквизиты и комментарий — тонкая тёмная обводка */
html.theme-dark .doc-form .doc-header .doc-header-field input[type="date"],
html.theme-dark .doc-form .doc-header .doc-header-field input[type="datetime-local"],
html.theme-dark .doc-form .doc-header .doc-header-field input[data-type="date"],
html.theme-dark .doc-form .doc-header .doc-header-field input[data-type="time"],
html.theme-dark .doc-form .doc-header .doc-header-field input[data-type="datetime"],
html.theme-dark .doc-form .doc-header .doc-header-field input[type="text"],
html.theme-dark .doc-form .doc-header .doc-header-field input[type="number"],
html.theme-dark .doc-form .doc-header .doc-header-field input[type="url"],
html.theme-dark .doc-form .doc-header .doc-header-field input[type="password"],
html.theme-dark .doc-form .doc-header .doc-header-field select,
html.theme-dark .doc-form .doc-header .doc-header-field textarea {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #e2e8f0;
    outline: none !important;
    box-shadow: none !important;
}

html.theme-dark .doc-form .doc-header .doc-header-field input::placeholder,
html.theme-dark .doc-form .doc-header .doc-header-field textarea::placeholder {
    color: #64748b;
}

html.theme-dark .doc-form .doc-header .doc-header-field input:focus,
html.theme-dark .doc-form .doc-header .doc-header-field select:focus,
html.theme-dark .doc-form .doc-header .doc-header-field textarea:focus {
    border-color: #64748b !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Алерты внутри шапки документа (Сверка итогов, Данные по зарплате) — тёмная обводка */
html.theme-dark .doc-form .doc-header .alert,
html.theme-dark .doc-form .doc-header .alert-info {
    border: 1px solid #475569 !important;
    border-left: 4px solid #3b82f6 !important;
}

html.theme-dark .doc-form .doc-header .doc-field-hint {
    color: #94a3b8;
}

html.theme-dark .doc-form .doc-header .doc-header-field input.invalid {
    background: rgba(239, 68, 68, 0.15);
    border-color: #f87171;
}

html.theme-dark .doc-form .doc-header .doc-period-display {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .doc-form .doc-header .doc-period-display.empty {
    color: #64748b;
}

/* Кнопка выбора периода в форме — тёмный фон (как в списке) */
html.theme-dark .doc-form .doc-header .doc-period-block .doc-period-btn-icon {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0;
}

html.theme-dark .doc-form .doc-header .doc-period-btn-icon:hover {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
}

/* Карточка таблицы в форме (таблица товаров и т.д.) */
html.theme-dark .doc-form .doc-table-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.theme-dark .doc-form .doc-table-card .doc-form-totals-bar {
    background: #334155;
    border-top: none;
}

html.theme-dark .doc-form .doc-table-card .doc-form-totals-bar .doc-totals-row td {
    background: #334155;
    color: #e2e8f0;
}

html.theme-dark .doc-form .doc-table-card .doc-table-head {
    background: #334155;
    border-bottom-color: #475569;
}

html.theme-dark .doc-form .doc-table-card .doc-table-head .doc-table-title {
    color: #f1f5f9;
}

/* Кнопки «+ Добавить строку» и «Удалить выделенные» в шапке таблицы — видимый фон */
html.theme-dark .doc-form .doc-table-card .doc-table-head .btn-add-row,
html.theme-dark .doc-form .doc-table-card .doc-table-head .btn-del-selected {
    background: #475569 !important;
    color: #f1f5f9 !important;
    border: 1px solid #64748b !important;
}
html.theme-dark .doc-form .doc-table-card .doc-table-head .btn-add-row:hover,
html.theme-dark .doc-form .doc-table-card .doc-table-head .btn-del-selected:hover {
    background: #64748b !important;
    border-color: #94a3b8 !important;
}

html.theme-dark .doc-form .doc-table-card .doc-form-table-scroll .doc-table th,
html.theme-dark .doc-form .doc-table-card .doc-table th {
    background: #334155;
    color: #f1f5f9;
    border-bottom-color: #475569;
    box-shadow: 0 1px 0 0 #475569;
}

html.theme-dark .doc-form .doc-table-card .doc-table td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

/* Строки через одну — тёмный оттенок вместо белого */
html.theme-dark .doc-form .doc-table-card .doc-table tbody tr:nth-child(even) {
    background: #334155 !important;
}

html.theme-dark .doc-form .doc-table-card .doc-table tbody tr:hover {
    background: #334155;
}

/* Выделенные строки в таблице формы — как в списке, нейтральный тёмный */
html.theme-dark .doc-form .doc-table-card .doc-table tbody tr.selected {
    background: #475569 !important;
}

html.theme-dark .doc-form .doc-table-card .doc-table tbody tr.selected:hover {
    background: #64748b !important;
}

html.theme-dark .doc-form .doc-table-card .doc-table tbody tr.selected td {
    color: #f1f5f9 !important;
}

/* Чекбоксы в таблице формы — серый фон, как в форме списка */
html.theme-dark .doc-form .doc-table-card .doc-table input[type="checkbox"].row-select {
    accent-color: #64748b;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}

html.theme-dark .doc-form .doc-table-card .doc-table input[type="checkbox"].row-select:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

html.theme-dark .doc-form .doc-table-card .doc-table th.doc-col-check input[type="checkbox"],
html.theme-dark .doc-form .doc-table-card .doc-table td.doc-col-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}

html.theme-dark .doc-form .doc-table-card .doc-table th.doc-col-check input[type="checkbox"]:checked,
html.theme-dark .doc-form .doc-table-card .doc-table td.doc-col-check input[type="checkbox"]:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

html.theme-dark .doc-form .doc-table-card .doc-table .doc-list-empty {
    color: #94a3b8;
}

html.theme-dark .doc-form .doc-table-card .doc-table .doc-list-empty a {
    color: #93c5fd;
}

html.theme-dark .doc-form .doc-table-card .doc-table th.sortable::after {
    color: #94a3b8;
}

/* Поля в таблице формы (инпуты в ячейках) */
html.theme-dark .doc-form .doc-table-card .doc-table input[type="text"],
html.theme-dark .doc-form .doc-table-card .doc-table input[type="number"],
html.theme-dark .doc-form .doc-table-card .doc-table select {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .doc-form .doc-permissions-fieldset,
html.theme-dark .doc-form .doc-permissions-section {
    border-color: #475569;
    background: #1e293b;
}

html.theme-dark .doc-form .doc-permissions-fieldset legend,
html.theme-dark .doc-form .doc-permissions-section-title {
    color: #e2e8f0;
}

/* Чекбоксы в форме администратора (Владелец, права) — тёмный фон */
html.theme-dark .doc-form .doc-header input[type="checkbox"],
html.theme-dark .doc-form .doc-permissions-fieldset input[type="checkbox"] {
    accent-color: #64748b;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
}
html.theme-dark .doc-form .doc-header input[type="checkbox"]:checked,
html.theme-dark .doc-form .doc-permissions-fieldset input[type="checkbox"]:checked {
    background: #475569;
    border-color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}
html.theme-dark .doc-form .doc-header input[type="checkbox"]:disabled,
html.theme-dark .doc-form .doc-permissions-fieldset input[type="checkbox"]:disabled {
    opacity: 0.7;
}

html.theme-dark .text-muted {
    color: #64748b !important;
}

/* Ссылки в подсказках и описаниях (покрытие недостачи, подписи к полям и т.п.) — хорошо видимы в тёмной теме */
html.theme-dark .text-muted a,
html.theme-dark .doc-list-period-label a,
html.theme-dark .doc-field-hint a,
html.theme-dark .doc-form .doc-header .doc-field-hint a {
    color: #93c5fd !important;
}
html.theme-dark .text-muted a:hover,
html.theme-dark .doc-list-period-label a:hover,
html.theme-dark .doc-field-hint a:hover,
html.theme-dark .doc-form .doc-header .doc-field-hint a:hover {
    color: #bfdbfe !important;
}

/* ========== Рабочее место администратора (.workplace-container) ========== */
html.theme-dark .workplace-section {
    background: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-color: #334155 !important;
}
html.theme-dark .workplace-container .workplace-left .workplace-section,
html.theme-dark .workplace-container .workplace-right #products-section,
html.theme-dark .workplace-container .workplace-right #cart-section { border-left-color: #475569 !important; }
html.theme-dark .workplace-container .pc-table,
html.theme-dark .workplace-container .products-table,
html.theme-dark .workplace-container .cart-table {
    border-color: #475569 !important;
}
html.theme-dark .workplace-container .pc-table th,
html.theme-dark .workplace-container .products-table th,
html.theme-dark .workplace-container .cart-table th {
    border-bottom-color: #475569 !important;
}
html.theme-dark .workplace-container .pc-table td,
html.theme-dark .workplace-container .products-table td,
html.theme-dark .workplace-container .cart-table td {
    border-bottom-color: #334155 !important;
}

html.theme-dark .workplace-section h3 {
    color: #f1f5f9;
    border-bottom-color: #475569;
}

html.theme-dark .workplace-section h3:hover {
    color: #93c5fd;
}

html.theme-dark .workplace-container .collapse-btn {
    color: #94a3b8;
}

html.theme-dark .workplace-container .collapse-btn:hover {
    color: #93c5fd;
}

html.theme-dark .workplace-container .search-box input {
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
}

html.theme-dark .workplace-container .search-box input::placeholder {
    color: #64748b;
}

html.theme-dark .workplace-container .search-box input:focus {
    border-color: #818cf8;
}

html.theme-dark .workplace-container .search-box::after {
    color: #94a3b8;
}

html.theme-dark .workplace-container .search-box:has(input:focus)::after {
    color: #818cf8;
}

html.theme-dark .workplace-container .pc-table th,
html.theme-dark .workplace-container .products-table th,
html.theme-dark .workplace-container .cart-table th {
    background: #334155;
    color: #f1f5f9;
    border-bottom-color: #475569;
}

html.theme-dark .workplace-container .pc-table td,
html.theme-dark .workplace-container .products-table td,
html.theme-dark .workplace-container .cart-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

html.theme-dark .workplace-container .cart-pc-cell {
    color: #94a3b8 !important;
}

html.theme-dark .workplace-container .pc-table tr:hover,
html.theme-dark .workplace-container .products-table tr:hover,
html.theme-dark .workplace-container .cart-table tr:hover {
    background: #334155;
}

html.theme-dark .workplace-container .pc-free {
    color: #86efac;
}

html.theme-dark .workplace-container .pc-busy {
    color: #fca5a5;
}

html.theme-dark .workplace-container .cart-summary {
    background: #334155;
    border: 1px solid #475569;
    color: #e2e8f0;
}

html.theme-dark .workplace-container .cart-summary .cart-summary-row span {
    color: #e2e8f0 !important;
}

html.theme-dark .workplace-container .cart-summary-total {
    color: #a5b4fc;
    border-top-color: #475569;
}

html.theme-dark .workplace-container .btn-checkout {
    background: #475569;
    color: #f1f5f9;
}

html.theme-dark .workplace-container .btn-checkout:hover {
    background: #64748b;
}

html.theme-dark .workplace-container .btn-checkout:disabled {
    background: #334155;
    color: #64748b;
}

/* Кнопки на рабочем месте (Колонки, Обновить, Приход, Закрыть смену) — в тёмной теме приглушённые */
html.theme-dark .workplace-container .btn.btn-secondary.btn-small {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html.theme-dark .workplace-container .btn.btn-success.btn-small {
    background: #166534;
    color: #dcfce7;
}

html.theme-dark .workplace-container .btn.btn-success.btn-small:hover {
    background: #15803d;
}

html.theme-dark .workplace-container .btn.btn-warning.btn-small {
    background: #c2410c;
    color: #ffedd5;
}

html.theme-dark .workplace-container .btn.btn-warning.btn-small:hover {
    background: #ea580c;
}

html.theme-dark .workplace-container .btn.btn-danger.btn-small {
    background: #b91c1c;
    color: #fecaca;
}

html.theme-dark .workplace-container .btn.btn-danger.btn-small:hover {
    background: #dc2626;
}

/* Выпадающее меню «Колонки» на рабочем месте */
html.theme-dark .workplace-container .pcs-columns-dropdown {
    background: #1e293b !important;
    border-color: #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark .workplace-container .pcs-columns-dropdown label {
    color: #e2e8f0;
}

/* Блок с кнопкой «Сохранить» — под тёмную тему (в documents.css задан background: #fff) */
html.theme-dark .doc-form .doc-form-actions {
    background: transparent;
    border-top-color: #475569;
}

/* Кнопка «Сохранить» в формах — как «Создать/Обновить»: серая, не на всю ширину */
html.theme-dark .doc-form .doc-form-actions .btn-primary {
    width: auto;
    min-width: 0;
    padding: 10px 20px;
    background: #334155;
    color: #e2e8f0;
    background-image: none;
    box-shadow: none;
}

html.theme-dark .doc-form .doc-form-actions .btn-primary:hover {
    background: #475569;
    color: #f1f5f9;
    transform: none;
    box-shadow: none;
}

/* ========== Мобильная адаптация (маленькие экраны) ========== */

/* Настройки Shell и админ. центра на телефоне — фон как в остальных фреймах (#171717), карточка #1e293b */
@media (max-width: 768px) {
    html.theme-dark body.in-tab-frame .main-content,
    html.theme-dark .main-content:has(.admin-settings-section),
    html.theme-dark .main-content:has(.doc-form) {
        background: #171717 !important;
    }
    html.theme-dark .main-content:has(.admin-settings-section) .page-content-card,
    html.theme-dark .main-content:has(.doc-form) .page-content-card {
        background: #1e293b !important;
        border-radius: 12px;
    }
    html.theme-dark .main-content:has(.admin-settings-section) .page-content-card > .container,
    html.theme-dark .main-content:has(.doc-form) .page-content-card > .container {
        background: transparent;
    }
}

/* «Фильтры и действия» — выпадающее меню и кнопка-триггер в тёмной теме (убрать белые элементы) */
@media (max-width: 992px) {
    html.theme-dark .doc-list-filters-trigger {
        background: #334155 !important;
        border-color: #475569 !important;
        color: #e2e8f0 !important;
    }
    html.theme-dark .doc-list-filters-trigger:hover {
        background: #475569 !important;
        border-color: #64748b !important;
        color: #f1f5f9 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown {
        background: #1e293b !important;
        border-color: #475569 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown label,
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-period-label {
        color: #94a3b8 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown select,
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-search-input {
        background: #334155 !important;
        border-color: #475569 !important;
        color: #f1f5f9 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-period-display {
        background: #334155 !important;
        border-color: #475569 !important;
        color: #e2e8f0 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .btn {
        background: #334155 !important;
        border-color: #475569 !important;
        color: #e2e8f0 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .btn:hover {
        background: #475569 !important;
        color: #f1f5f9 !important;
    }
    html.theme-dark .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-period-btn-icon {
        background: #334155 !important;
        border-color: #475569 !important;
        color: #e2e8f0 !important;
    }
}

/* --- Инструкция (admin_manual.html) --- */
html.theme-dark body.manual-page {
    background: #171717 !important;
    color: #e2e8f0;
}
html.theme-dark .manual-header {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
html.theme-dark .manual-header h1 {
    color: #f1f5f9 !important;
}
html.theme-dark .manual-header p {
    color: #94a3b8 !important;
}
html.theme-dark .manual-header-link {
    background: rgba(129, 140, 248, 0.12) !important;
    border-color: rgba(129, 140, 248, 0.3) !important;
    color: #94a3b8 !important;
}
html.theme-dark .manual-header-link a {
    color: #818cf8 !important;
}
html.theme-dark .manual-header-link a:hover {
    color: #a5b4fc !important;
}
html.theme-dark nav.toc-sidebar {
    background: #1e293b !important;
    border-right-color: #64748b !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}
html.theme-dark nav.toc-sidebar h2 {
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}
html.theme-dark nav.toc-sidebar a {
    color: #94a3b8 !important;
}
html.theme-dark nav.toc-sidebar a:hover {
    color: #e2e8f0 !important;
}
html.theme-dark nav.toc-sidebar a.toc-active {
    color: #818cf8 !important;
    background: rgba(102, 126, 234, 0.15) !important;
    border-left-color: #818cf8 !important;
}
html.theme-dark .manual-content section {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
html.theme-dark .manual-content section h2,
html.theme-dark .manual-content section h3 {
    color: #f1f5f9 !important;
    border-bottom-color: #334155 !important;
}
html.theme-dark .manual-content .path {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .manual-content .note {
    background: #422006 !important;
    border-color: #78350f !important;
}
html.theme-dark .manual-content .note strong {
    color: #fcd34d !important;
}
html.theme-dark .manual-content .info-plashka {
    background: #052e16 !important;
    border-color: #166534 !important;
    color: #fff !important;
}
html.theme-dark .manual-content .info-plashka a {
    color: #a7f3d0 !important;
}
html.theme-dark .manual-content .info-plashka a:hover {
    color: #d1fae5 !important;
}
html.theme-dark .manual-content table th,
html.theme-dark .manual-content table td {
    border-color: #334155 !important;
}
html.theme-dark .manual-content table th {
    background: #334155 !important;
    color: #f1f5f9 !important;
}
html.theme-dark .manual-content table tr:nth-child(even) {
    background: #0f172a !important;
}
html.theme-dark .manual-content code {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .manual-content section a {
    color: #818cf8 !important;
}
html.theme-dark .manual-content section a:hover {
    color: #a5b4fc !important;
}
html.theme-dark .manual-footer {
    color: #94a3b8 !important;
}
html.theme-dark body.manual-page .tab-close-control.tab-close-floating-btn,
html.theme-dark body.manual-page .tab-close-control.tab-close-icon-btn {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}
html.theme-dark body.manual-page .tab-close-control.tab-close-floating-btn:hover,
html.theme-dark body.manual-page .tab-close-control.tab-close-icon-btn:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}
html.theme-dark .manual-toc-toggle {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid #475569 !important;
}
