/* UltraPlataformas Night Theme
 * Gris carbon visible y confortable. No usa negro puro.
 * Se aplica solo cuando html/body tienen la clase dark-theme.
 */

:root {
    --night-bg: #252930;
    --night-bg-deep: #20242a;
    --night-surface: #2f343c;
    --night-surface-raised: #373d46;
    --night-surface-soft: #3d444e;
    --night-input: #292e35;
    --night-border: rgba(255, 255, 255, 0.10);
    --night-border-strong: rgba(255, 255, 255, 0.16);
    --night-text: #f4f6f8;
    --night-text-secondary: #cbd1d8;
    --night-text-muted: #9ca5b0;
    --night-blue: #5aa7ff;
    --night-blue-hover: #7ab8ff;
    --night-shadow: rgba(7, 10, 14, 0.24);
}

html.dark-theme {
    color-scheme: dark;
    background: var(--night-bg-deep) !important;
}

html.dark-theme body,
body.dark-theme {
    background-color: var(--night-bg) !important;
    background-image:
        radial-gradient(circle at 10% 0%, rgba(90, 167, 255, 0.10), transparent 34%),
        radial-gradient(circle at 95% 8%, rgba(167, 139, 250, 0.08), transparent 30%),
        linear-gradient(145deg, #2b3037 0%, #252930 48%, #22262c 100%) !important;
    color: var(--night-text) !important;
}

body.dark-theme::before {
    opacity: 0.28 !important;
}

body.dark-theme .blob {
    opacity: 0.17 !important;
    filter: blur(95px) !important;
}

/* Texto */
body.dark-theme,
body.dark-theme p,
body.dark-theme label,
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 strong,
body.dark-theme .card-title,
body.dark-theme .modal-title,
body.dark-theme .action-title,
body.dark-theme .stat-value,
body.dark-theme .activity-title,
body.dark-theme .section-title {
    color: var(--night-text) !important;
}

body.dark-theme .text-muted,
body.dark-theme small,
body.dark-theme .form-text,
body.dark-theme .action-desc,
body.dark-theme .stat-label,
body.dark-theme .activity-description,
body.dark-theme .modern-navbar-username,
body.dark-theme .modern-sidebar-title {
    color: var(--night-text-muted) !important;
}

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

body.dark-theme a:not(.btn):not(.modern-sidebar-link):not(.modern-navbar-link) {
    color: #8fc2ff;
}

/* Navbar moderno */
body.dark-theme .modern-navbar {
    background: rgba(43, 48, 55, 0.92) !important;
    border-bottom: 1px solid var(--night-border) !important;
    box-shadow: 0 8px 28px rgba(7, 10, 14, 0.14) !important;
}

body.dark-theme .modern-navbar-logo,
body.dark-theme .modern-navbar-link,
body.dark-theme .modern-navbar-logout,
body.dark-theme .modern-navbar-mobile-toggle {
    color: var(--night-text) !important;
}

body.dark-theme .modern-navbar-link:hover,
body.dark-theme .modern-navbar-logout:hover,
body.dark-theme .modern-navbar-mobile-toggle:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #fff !important;
}

body.dark-theme .modern-navbar-link.active {
    background: rgba(90, 167, 255, 0.14) !important;
    color: #8fc2ff !important;
}

body.dark-theme .modern-navbar-user,
body.dark-theme .modern-navbar-credits {
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
}

/* Navbar legacy / Bootstrap */
body.dark-theme .navbar,
body.dark-theme .navbar-light,
body.dark-theme .bg-light {
    background-color: var(--night-surface) !important;
    border-color: var(--night-border) !important;
}

body.dark-theme .navbar .nav-link,
body.dark-theme .navbar .navbar-brand,
body.dark-theme .navbar-light .navbar-nav .nav-link {
    color: var(--night-text-secondary) !important;
}

body.dark-theme .navbar .nav-link:hover,
body.dark-theme .navbar-light .navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Sidebar */
body.dark-theme .modern-sidebar {
    background: rgba(45, 49, 56, 0.96) !important;
    border-right: 1px solid var(--night-border) !important;
    box-shadow: 10px 0 35px rgba(8, 10, 14, 0.10) !important;
}

body.dark-theme .modern-sidebar-section {
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

body.dark-theme .modern-sidebar-section.expanded {
    background: rgba(90,167,255,0.07) !important;
    border-left-color: rgba(90,167,255,0.48) !important;
}

body.dark-theme .modern-sidebar-title:hover,
body.dark-theme .modern-sidebar-section.expanded .modern-sidebar-title {
    color: #8fc2ff !important;
}

body.dark-theme .modern-sidebar-link {
    color: var(--night-text-secondary) !important;
}

body.dark-theme .modern-sidebar-link:hover {
    background: rgba(255,255,255,0.065) !important;
    color: #fff !important;
}

body.dark-theme .modern-sidebar-link.active {
    background: linear-gradient(135deg, #3988e8 0%, #2469c9 100%) !important;
    color: #fff !important;
    box-shadow: 0 5px 16px rgba(35, 105, 201, 0.28) !important;
}

body.dark-theme .modern-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18) !important;
}

/* Superficies principales */
body.dark-theme .card,
body.dark-theme .action-card,
body.dark-theme .stat-card,
body.dark-theme .activity-section,
body.dark-theme .glass,
body.dark-theme .glass-card,
body.dark-theme .content-card,
body.dark-theme .panel,
body.dark-theme .box,
body.dark-theme .settings-card,
body.dark-theme .management-card,
body.dark-theme .server-card,
body.dark-theme .account-card {
    background: rgba(48, 53, 61, 0.92) !important;
    border-color: var(--night-border) !important;
    color: var(--night-text) !important;
    box-shadow: 0 10px 30px var(--night-shadow) !important;
}

body.dark-theme .action-card:hover,
body.dark-theme .stat-card:hover,
body.dark-theme .card:hover {
    background: rgba(56, 62, 71, 0.96) !important;
    border-color: var(--night-border-strong) !important;
}

body.dark-theme .card-header,
body.dark-theme .card-footer,
body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    background: var(--night-surface-raised) !important;
    border-color: var(--night-border) !important;
    color: var(--night-text) !important;
}

body.dark-theme .activity-item {
    border-color: rgba(255,255,255,0.075) !important;
}

/* Formularios */
body.dark-theme .form-control,
body.dark-theme .form-select,
body.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .input-group-text,
body.dark-theme .choices__inner,
body.dark-theme .choices__input,
body.dark-theme .choices__list--dropdown,
body.dark-theme .select2-selection,
body.dark-theme .select2-dropdown {
    background-color: var(--night-input) !important;
    border-color: #4b535e !important;
    color: var(--night-text) !important;
}

body.dark-theme .form-control::placeholder,
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #8f98a4 !important;
    opacity: 1 !important;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus,
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus,
body.dark-theme .choices.is-focused .choices__inner {
    background-color: #2d333b !important;
    border-color: var(--night-blue) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(90,167,255,0.15) !important;
}

body.dark-theme select option {
    background: var(--night-surface) !important;
    color: var(--night-text) !important;
}

body.dark-theme .form-check-input {
    background-color: #414852 !important;
    border-color: #606975 !important;
}

body.dark-theme .form-check-input:checked {
    background-color: #3f8fe9 !important;
    border-color: #3f8fe9 !important;
}

/* Dropdowns / menus */
body.dark-theme .dropdown-menu,
body.dark-theme .list-group,
body.dark-theme .list-group-item,
body.dark-theme .popover,
body.dark-theme .offcanvas {
    background-color: var(--night-surface-raised) !important;
    border-color: var(--night-border) !important;
    color: var(--night-text) !important;
}

body.dark-theme .dropdown-item {
    color: var(--night-text-secondary) !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus,
body.dark-theme .list-group-item:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #fff !important;
}

body.dark-theme .dropdown-divider,
body.dark-theme hr {
    border-color: rgba(255,255,255,0.10) !important;
}

/* Tablas */
body.dark-theme .table,
body.dark-theme table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--night-text-secondary);
    --bs-table-border-color: rgba(255,255,255,0.09);
    color: var(--night-text-secondary) !important;
}

body.dark-theme .table > :not(caption) > * > *,
body.dark-theme table th,
body.dark-theme table td {
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.09) !important;
    color: var(--night-text-secondary) !important;
}

body.dark-theme thead,
body.dark-theme .table thead th,
body.dark-theme table thead th {
    background: #383e47 !important;
    color: #eef2f6 !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,0.025) !important;
}

body.dark-theme .table-hover > tbody > tr:hover > * {
    background-color: rgba(90,167,255,0.065) !important;
    color: #fff !important;
}

/* Modales */
body.dark-theme .modal-content,
body.dark-theme .plan-modal,
body.dark-theme .swal2-popup {
    background: #31363e !important;
    color: var(--night-text) !important;
    border: 1px solid var(--night-border) !important;
    box-shadow: 0 24px 70px rgba(5,8,12,0.38) !important;
}

body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

body.dark-theme .modal-backdrop.show,
body.dark-theme .plan-modal-overlay {
    background: rgba(18, 21, 25, 0.70) !important;
}

/* Paginacion y controles */
body.dark-theme .page-link {
    background: var(--night-surface-raised) !important;
    border-color: var(--night-border) !important;
    color: #a9ceff !important;
}

body.dark-theme .page-item.active .page-link {
    background: #3f8fe9 !important;
    border-color: #3f8fe9 !important;
    color: white !important;
}

body.dark-theme .page-item.disabled .page-link {
    background: #2b3037 !important;
    color: #6f7883 !important;
}

/* Helpers Bootstrap frecuentes */
body.dark-theme .bg-white {
    background-color: var(--night-surface) !important;
}

body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-bottom,
body.dark-theme .border-start,
body.dark-theme .border-end {
    border-color: var(--night-border) !important;
}

body.dark-theme .alert-secondary,
body.dark-theme .alert-light {
    background: #353b44 !important;
    border-color: var(--night-border) !important;
    color: var(--night-text-secondary) !important;
}

/* DataTables */
body.dark-theme .dataTables_wrapper,
body.dark-theme .dataTables_wrapper label,
body.dark-theme .dataTables_info,
body.dark-theme .dataTables_length,
body.dark-theme .dataTables_filter {
    color: var(--night-text-secondary) !important;
}

/* Scrollbars */
html.dark-theme ::-webkit-scrollbar-track {
    background: #24282e;
}

html.dark-theme ::-webkit-scrollbar-thumb {
    background: #555e69;
    border-radius: 999px;
}

html.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #68727f;
}

/* Boton de tema: mantiene contraste en ambos modos */
.theme-toggle-control {
    width: 48px;
    height: 28px;
    border: 0;
    padding: 3px;
    border-radius: 999px;
    cursor: pointer;
    background: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    transition: background .22s ease, box-shadow .22s ease, transform .15s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.theme-toggle-control:hover {
    transform: translateY(-1px);
}

.theme-toggle-control:focus-visible {
    outline: 3px solid rgba(59,130,246,.25);
    outline-offset: 2px;
}

.theme-toggle-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(15,23,42,.20);
    transform: translateX(0);
    transition: transform .22s ease, background .22s ease, color .22s ease;
}

body.dark-theme .theme-toggle-control,
html.dark-theme .theme-toggle-control {
    background: #4a5360 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important;
}

body.dark-theme .theme-toggle-thumb,
html.dark-theme .theme-toggle-thumb {
    transform: translateX(20px);
    background: #dbeafe;
    color: #2563eb;
}

@media (max-width: 480px) {
    .theme-toggle-control {
        width: 44px;
        height: 26px;
        padding: 3px;
    }

    .theme-toggle-thumb {
        width: 20px;
        height: 20px;
    }

    body.dark-theme .theme-toggle-thumb,
    html.dark-theme .theme-toggle-thumb {
        transform: translateX(18px);
    }
}

/* =====================================================================
   Compatibilidad dark v2 — componentes modernos y Bootstrap heredado
   ===================================================================== */

/* Helpers de texto y fondos que todavia arrastran identidad light */
body.dark-theme .bg-light,
body.dark-theme .table-light,
body.dark-theme .text-bg-light {
    background: #343a43 !important;
    color: var(--night-text-secondary) !important;
}

body.dark-theme .text-body,
body.dark-theme .text-body-emphasis,
body.dark-theme .text-gray-800,
body.dark-theme .text-gray-900 {
    color: var(--night-text) !important;
}

body.dark-theme .text-gray-300,
body.dark-theme .text-gray-400,
body.dark-theme .text-gray-500,
body.dark-theme .text-secondary {
    color: var(--night-text-muted) !important;
}

/* Bootstrap striped usa box-shadow/variables, no solo background. */
body.dark-theme .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--night-text-secondary) !important;
    --bs-table-striped-bg: rgba(255,255,255,.028) !important;
    --bs-table-striped-color: var(--night-text-secondary) !important;
    --bs-table-hover-bg: rgba(90,167,255,.075) !important;
    --bs-table-hover-color: #fff !important;
    --bs-table-accent-bg: transparent !important;
}

body.dark-theme .table > tbody > tr > *,
body.dark-theme .table > tbody > tr.table-light > * {
    --bs-table-accent-bg: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255,255,255,.028) !important;
    background: rgba(255,255,255,.028) !important;
    box-shadow: inset 0 0 0 9999px rgba(255,255,255,.028) !important;
}

body.dark-theme .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: rgba(90,167,255,.075) !important;
    background: rgba(90,167,255,.075) !important;
    box-shadow: inset 0 0 0 9999px rgba(90,167,255,.075) !important;
    color: #fff !important;
}

/* Alerts: fondos oscuros semanticos, no cajas pastel con texto blanco. */
body.dark-theme .alert-info {
    background: #213a46 !important;
    border-color: #2f6173 !important;
    color: #d9f5ff !important;
}
body.dark-theme .alert-success {
    background: #203d31 !important;
    border-color: #32684e !important;
    color: #dcf7e8 !important;
}
body.dark-theme .alert-warning {
    background: #493b20 !important;
    border-color: #79642f !important;
    color: #fff0bd !important;
}
body.dark-theme .alert-danger {
    background: #48292f !important;
    border-color: #81414c !important;
    color: #ffe1e5 !important;
}
body.dark-theme .alert-info *,
body.dark-theme .alert-success *,
body.dark-theme .alert-warning *,
body.dark-theme .alert-danger * {
    color: inherit !important;
}
body.dark-theme .alert-info a { color: #8ddcff !important; }
body.dark-theme .alert-warning a { color: #ffd978 !important; }
body.dark-theme .alert-success a { color: #8de0b1 !important; }
body.dark-theme .alert-danger a { color: #ff9eaa !important; }

/* Botones neutros que quedaban blancos */
body.dark-theme .btn-light,
body.dark-theme .btn-outline-secondary,
body.dark-theme .btn-outline-dark {
    background: #353b44 !important;
    border-color: #59626e !important;
    color: #e7ebef !important;
}
body.dark-theme .btn-light:hover,
body.dark-theme .btn-outline-secondary:hover,
body.dark-theme .btn-outline-dark:hover {
    background: #414852 !important;
    border-color: #6a7582 !important;
    color: #fff !important;
}
body.dark-theme .btn-secondary {
    background: #59626e !important;
    border-color: #59626e !important;
    color: #fff !important;
}

/* Modal Bootstrap general */
body.dark-theme .modal-header,
body.dark-theme .modal-body,
body.dark-theme .modal-footer {
    background: #31363e !important;
    border-color: var(--night-border) !important;
    color: var(--night-text) !important;
}
body.dark-theme .modal-header.bg-primary,
body.dark-theme .modal-header.bg-info,
body.dark-theme .modal-header.bg-secondary {
    background: #39404a !important;
    color: #fff !important;
}
body.dark-theme .modal-header.bg-success { background: #244735 !important; color:#fff !important; }
body.dark-theme .modal-header.bg-warning { background: #493b20 !important; color:#fff0bd !important; }
body.dark-theme .modal-header.bg-danger { background: #552d34 !important; color:#fff !important; }
body.dark-theme .modal-title,
body.dark-theme .modal-header h5,
body.dark-theme .modal-header h6 {
    color: #f7f9fb !important;
}
body.dark-theme .modal .card.bg-light,
body.dark-theme .modal .bg-light {
    background: #353b44 !important;
    color: var(--night-text-secondary) !important;
}

/* Delete / relink / password modals custom */
body.dark-theme .delete-modal .modal-content { background:#31363e !important; }
body.dark-theme .delete-modal .modal-body { background:#31363e !important; }
body.dark-theme .delete-modal .modal-footer-delete { background:#2b3037 !important; border-color:var(--night-border) !important; }
body.dark-theme .delete-modal .account-info-pill,
body.dark-theme .delete-modal .confirm-step { background:rgba(255,255,255,.045) !important; }
body.dark-theme .delete-modal .account-name,
body.dark-theme .delete-modal .option-title,
body.dark-theme .delete-modal .confirm-step p { color:var(--night-text) !important; }
body.dark-theme .delete-modal .account-label,
body.dark-theme .delete-modal .option-description { color:var(--night-text-muted) !important; }
body.dark-theme .delete-modal .btn-cancel-delete { background:#414852 !important; color:#eef2f6 !important; }
body.dark-theme #relinkModal .server-card { background:#343a43 !important; border-color:#56606b !important; }

/* ---------------------------------------------------------------------
   Create Account — Plex / Emby / Jellyfin
   --------------------------------------------------------------------- */
body.dark-theme.create-account-modern-page {
    --cam-ink: #f4f6f8;
    --cam-muted: #aab3be;
    --cam-line: rgba(255,255,255,.10);
    --cam-surface: #30353d;
    --cam-soft: #2a2f36;
    --cam-shadow: 0 18px 46px rgba(5,8,12,.20);
}

body.dark-theme.create-account-modern-page .create-modern-overline,
body.dark-theme.create-account-modern-page .create-modern-title p {
    color: #aab3be !important;
}

body.dark-theme.create-account-modern-page .service-switch-real {
    background: #292e35 !important;
    border-color: var(--night-border) !important;
}
body.dark-theme.create-account-modern-page .service-switch-real a { color:#b8c0ca !important; }
body.dark-theme.create-account-modern-page .service-switch-real a:hover {
    background:#343a43 !important;
    color:#fff !important;
}
body.dark-theme.create-account-modern-page .service-switch-real a.active {
    background:#3a414b !important;
    color:#fff !important;
    box-shadow:0 3px 12px rgba(0,0,0,.20) !important;
}
body.dark-theme.create-account-modern-page .create-modern-manage {
    background:#343a43 !important;
    border-color:#515a66 !important;
    color:#eef2f6 !important;
}

body.dark-theme.create-account-modern-page.service-plex #createAccountForm > .row.mb-4,
body.dark-theme.create-account-modern-page.service-plex #createAccountForm > .row.mb-3,
body.dark-theme.create-account-modern-page.service-plex #createAccountForm > .row.mt-4,
body.dark-theme.create-account-modern-page.service-plex #createAccountForm > .row.mt-3 {
    background:#30353d !important;
    border-color:var(--night-border) !important;
    box-shadow:0 8px 24px rgba(5,8,12,.16) !important;
}

body.dark-theme.create-account-modern-page .card,
body.dark-theme.create-account-modern-page #createAccountForm .card {
    background:#30353d !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.create-account-modern-page .card-header {
    background:#373d46 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.create-account-modern-page h6.text-primary,
body.dark-theme.create-account-modern-page .form-label,
body.dark-theme.create-account-modern-page .form-check-label,
body.dark-theme.create-account-modern-page .server-card .form-check-label {
    color:#eef2f6 !important;
}
body.dark-theme.create-account-modern-page .form-text,
body.dark-theme.create-account-modern-page small.text-muted {
    color:#9da7b3 !important;
}

body.dark-theme.create-account-modern-page .form-control,
body.dark-theme.create-account-modern-page .form-select,
body.dark-theme.create-account-modern-page .input-group-text {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}
body.dark-theme.create-account-modern-page .form-control:focus,
body.dark-theme.create-account-modern-page .form-select:focus {
    background:#2f353d !important;
    border-color:#5aa7ff !important;
}

body.dark-theme.create-account-modern-page .server-card {
    background:#2d333b !important;
    border-color:#505a66 !important;
}
body.dark-theme.create-account-modern-page .server-card:hover {
    background:#343b45 !important;
    border-color:#5aa7ff !important;
}
body.dark-theme.create-account-modern-page .demo-switch-container,
body.dark-theme.create-account-modern-page #costIndicator {
    background:#293846 !important;
    border-color:#395d7d !important;
}
body.dark-theme.create-account-modern-page .demo-switch-container .form-check-label {
    color:#cfe6ff !important;
}
body.dark-theme.create-account-modern-page hr {
    color:rgba(255,255,255,.10) !important;
}
body.dark-theme.create-account-modern-page code {
    background:#272c33 !important;
    color:#b7a7ff !important;
}

/* ---------------------------------------------------------------------
   Add Server — Plex / Emby / Jellyfin
   --------------------------------------------------------------------- */
body.dark-theme.server-add-modern-page {
    --sam-ink:#f4f6f8;
    --sam-muted:#a8b1bd;
    --sam-line:rgba(255,255,255,.10);
    --sam-surface:#30353d;
    --sam-soft:#2a2f36;
    --sam-shadow:0 16px 42px rgba(5,8,12,.20);
}

body.dark-theme.server-add-modern-page .server-add-modern-overline,
body.dark-theme.server-add-modern-page .server-add-modern-title p {
    color:#aab3be !important;
}
body.dark-theme.server-add-modern-page .server-service-switch {
    background:#292e35 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.server-add-modern-page .server-service-switch a { color:#bac2cc !important; }
body.dark-theme.server-add-modern-page .server-service-switch a:hover {
    background:#343a43 !important;
    color:#fff !important;
}
body.dark-theme.server-add-modern-page .server-service-switch a.active {
    background:#3a414b !important;
    color:#fff !important;
}
body.dark-theme.server-add-modern-page .server-add-manage {
    background:#343a43 !important;
    border-color:#515a66 !important;
    color:#eef2f6 !important;
}

body.dark-theme.server-add-modern-page main .card {
    background:#30353d !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.server-add-modern-page main .card-header,
body.dark-theme.server-add-modern-page main .card-header.bg-info,
body.dark-theme.server-add-modern-page main .card-header.bg-primary {
    background:#373d46 !important;
    border-color:var(--night-border) !important;
    color:#f4f6f8 !important;
}
body.dark-theme.server-add-modern-page main .card-header h5,
body.dark-theme.server-add-modern-page main .card-header h6,
body.dark-theme.server-add-modern-page main .card-header .card-title,
body.dark-theme.server-add-modern-page .form-label,
body.dark-theme.server-add-modern-page .form-check-label {
    color:#eef2f6 !important;
}
body.dark-theme.server-add-modern-page .form-control,
body.dark-theme.server-add-modern-page .form-select,
body.dark-theme.server-add-modern-page .input-group-text,
body.dark-theme.server-add-modern-page .form-control-sm,
body.dark-theme.server-add-modern-page .form-select-sm {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}
body.dark-theme.server-add-modern-page .form-control:focus,
body.dark-theme.server-add-modern-page .form-select:focus {
    background:#2f353d !important;
    border-color:#5aa7ff !important;
}
body.dark-theme.server-add-modern-page .form-text,
body.dark-theme.server-add-modern-page .text-muted,
body.dark-theme.server-add-modern-page small {
    color:#9da7b3 !important;
}
body.dark-theme.server-add-modern-page code {
    background:#272c33 !important;
    color:#b7a7ff !important;
}
body.dark-theme.server-add-modern-page hr {
    color:rgba(255,255,255,.10) !important;
}
body.dark-theme.server-add-modern-page .modal-content,
body.dark-theme.server-add-modern-page .modal-header,
body.dark-theme.server-add-modern-page .modal-body,
body.dark-theme.server-add-modern-page .modal-footer {
    background:#31363e !important;
    border-color:var(--night-border) !important;
}

/* ---------------------------------------------------------------------
   Server Management
   --------------------------------------------------------------------- */
body.dark-theme.servers-modern-page {
    --srv-ink:#f4f6f8;
    --srv-muted:#a8b1bd;
    --srv-soft:#2b3037;
    --srv-soft-blue:#293846;
    --srv-line:rgba(255,255,255,.10);
    --srv-line-strong:rgba(255,255,255,.16);
    --srv-card:#30353d;
    --srv-shadow:0 18px 46px rgba(5,8,12,.20);
    --srv-shadow-modal:0 28px 80px rgba(5,8,12,.34);
}

body.dark-theme.servers-modern-page .page-header {
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page .btn-outline-secondary,
body.dark-theme.servers-modern-page .btn-outline-danger {
    background:#343a43 !important;
}
body.dark-theme.servers-modern-page .stat-card {
    background:#30353d !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page .stat-card .label { color:#a7b0bb !important; }
body.dark-theme.servers-modern-page .stat-card .value { color:#f4f6f8 !important; }
body.dark-theme.servers-modern-page .stat-card .icon {
    background:#3a414b !important;
}

body.dark-theme.servers-modern-page main > .card,
body.dark-theme.servers-modern-page .card.shadow {
    background:#30353d !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page main > .card > .card-header,
body.dark-theme.servers-modern-page .card.shadow > .card-header {
    background:#373d46 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page main > .card > .card-header h5,
body.dark-theme.servers-modern-page .card.shadow > .card-header h5 {
    color:#cfe6ff !important;
}
body.dark-theme.servers-modern-page .card.shadow > .card-header .badge {
    background:#293846 !important;
    color:#a9d2ff !important;
}

body.dark-theme.servers-modern-page .table {
    background:#2d3239 !important;
    color:var(--night-text-secondary) !important;
}
body.dark-theme.servers-modern-page .table thead th {
    background:#3a414b !important;
    border-color:#4a5360 !important;
    color:#eef2f6 !important;
}
body.dark-theme.servers-modern-page .table tbody tr {
    border-color:rgba(255,255,255,.07) !important;
}
body.dark-theme.servers-modern-page .table tbody tr:hover,
body.dark-theme.servers-modern-page .table tbody tr:hover > * {
    background:rgba(90,167,255,.07) !important;
}
body.dark-theme.servers-modern-page .action-btn {
    background:#343a43 !important;
    border-color:#55606d !important;
    box-shadow:none !important;
}
body.dark-theme.servers-modern-page .action-btn:hover {
    background:#414852 !important;
    border-color:#6b7785 !important;
}
body.dark-theme.servers-modern-page .action-btn-danger {
    background:#3d3033 !important;
    border-color:#81505a !important;
}

/* Modales de servidores tienen CSS light propio muy especifico. */
body.dark-theme.servers-modern-page .modal-content {
    background:#31363e !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page .modal-header,
body.dark-theme.servers-modern-page .modal-header.bg-primary,
body.dark-theme.servers-modern-page .modal-header.text-white {
    background:#383e47 !important;
    border-color:var(--night-border) !important;
    color:#f4f6f8 !important;
}
body.dark-theme.servers-modern-page .modal-header .btn-close,
body.dark-theme.servers-modern-page .modal-header .btn-close-white {
    background-color:#454d58 !important;
    border-color:#5e6875 !important;
    filter:invert(1) grayscale(100%) brightness(180%) !important;
}
body.dark-theme.servers-modern-page .modal-body {
    background:#31363e !important;
    color:var(--night-text-secondary) !important;
}
body.dark-theme.servers-modern-page .modal-footer,
body.dark-theme.servers-modern-page .modal-footer.bg-light {
    background:#2b3037 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.servers-modern-page .modal .form-label,
body.dark-theme.servers-modern-page .modal h6:not(.modal-title) {
    color:#eef2f6 !important;
}
body.dark-theme.servers-modern-page .modal .form-control,
body.dark-theme.servers-modern-page .modal .form-select,
body.dark-theme.servers-modern-page .modal .input-group-text {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}
body.dark-theme.servers-modern-page .modal .form-control:focus,
body.dark-theme.servers-modern-page .modal .form-select:focus {
    background:#2f353d !important;
    border-color:#5aa7ff !important;
}
body.dark-theme.servers-modern-page .modal .card,
body.dark-theme.servers-modern-page .modal .card-header,
body.dark-theme.servers-modern-page .modal .card-header.bg-light {
    background:#353b44 !important;
    border-color:var(--night-border) !important;
    color:#eef2f6 !important;
}
body.dark-theme.servers-modern-page .modal .library-row,
body.dark-theme.servers-modern-page .modal .shared-user-row,
body.dark-theme.servers-modern-page #passwordConfigModal .form-check,
body.dark-theme.servers-modern-page #packFormModal .form-check {
    background:#343a43 !important;
    border-color:#505a66 !important;
}
body.dark-theme.servers-modern-page .individual-passwords-container,
body.dark-theme.servers-modern-page .individual-expirations-container,
body.dark-theme.servers-modern-page #packLibrariesList,
body.dark-theme.servers-modern-page #migrate-source-info {
    background:#2d333b !important;
    border-color:#4d5662 !important;
}

/* ---------------------------------------------------------------------
   Reseller / TV management shared modern layer
   --------------------------------------------------------------------- */
body.dark-theme.resellers-modern-page,
body.dark-theme.tv-modern-page {
    --mm-ink:#f4f6f8;
    --mm-muted:#a8b1bd;
    --mm-line:rgba(255,255,255,.10);
    --mm-card:#30353d;
    --mm-soft:#2b3037;
    --mm-shadow:0 16px 44px rgba(5,8,12,.20);
}

body.dark-theme.resellers-modern-page .form-control,
body.dark-theme.resellers-modern-page .form-select,
body.dark-theme.resellers-modern-page .input-group-text,
body.dark-theme.tv-modern-page .form-control,
body.dark-theme.tv-modern-page .form-select {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}
body.dark-theme.resellers-modern-page .form-control:focus,
body.dark-theme.resellers-modern-page .form-select:focus,
body.dark-theme.tv-modern-page .form-control:focus,
body.dark-theme.tv-modern-page .form-select:focus {
    background:#2f353d !important;
    border-color:#5aa7ff !important;
}
body.dark-theme.resellers-modern-page .form-label,
body.dark-theme.tv-modern-page .form-label {
    color:#dce2e8 !important;
}

body.dark-theme.resellers-modern-page .nav-tabs {
    background:#292e35 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .nav-tabs .nav-link { color:#b7c0ca !important; }
body.dark-theme.resellers-modern-page .nav-tabs .nav-link.active {
    background:#3a414b !important;
    color:#fff !important;
}

body.dark-theme.resellers-modern-page .reseller-list-card,
body.dark-theme.tv-modern-page .tv-filter-card,
body.dark-theme.tv-modern-page .tv-list-card,
body.dark-theme.tv-modern-page .tv-stat-card {
    background:#30353d !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .reseller-list-card > .card-header,
body.dark-theme.tv-modern-page .tv-filter-card .card-header,
body.dark-theme.tv-modern-page .tv-list-card .card-header {
    background:#373d46 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .reseller-list-card > .card-body.border-bottom {
    background:#2d333b !important;
    border-color:var(--night-border) !important;
}

body.dark-theme.resellers-modern-page .reseller-table {
    background:#2d3239 !important;
    color:var(--night-text-secondary) !important;
}
body.dark-theme.resellers-modern-page .reseller-table thead th {
    background:#3a414b !important;
    color:#eef2f6 !important;
    border-color:#4a5360 !important;
}
body.dark-theme.resellers-modern-page .reseller-table tbody td {
    border-color:rgba(255,255,255,.07) !important;
    color:#d9dee4 !important;
}
body.dark-theme.resellers-modern-page .reseller-table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg:rgba(255,255,255,.028) !important;
    background:rgba(255,255,255,.028) !important;
    box-shadow:inset 0 0 0 9999px rgba(255,255,255,.028) !important;
}
body.dark-theme.resellers-modern-page .reseller-table tbody tr.table-light > * {
    --bs-table-accent-bg:rgba(90,167,255,.035) !important;
    background:rgba(90,167,255,.035) !important;
    box-shadow:inset 0 0 0 9999px rgba(90,167,255,.035) !important;
}
body.dark-theme.resellers-modern-page .reseller-table tbody tr:hover > * {
    --bs-table-accent-bg:rgba(90,167,255,.075) !important;
    background:rgba(90,167,255,.075) !important;
    box-shadow:inset 0 0 0 9999px rgba(90,167,255,.075) !important;
    color:#fff !important;
}

@media(max-width:1450px) {
    body.dark-theme.resellers-modern-page .reseller-table tbody tr {
        background:#30353d !important;
        border-color:var(--night-border) !important;
        box-shadow:0 5px 18px rgba(5,8,12,.14) !important;
    }
    body.dark-theme.resellers-modern-page .reseller-table.is-admin tbody td:nth-child(12),
    body.dark-theme.resellers-modern-page .reseller-table.is-user tbody td:nth-child(11) {
        background:#2b3037 !important;
    }
}

/* Formularios create/edit reseller */
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-content {
    background:#2c3138 !important;
    border-color:var(--night-border) !important;
    box-shadow:0 32px 92px rgba(5,8,12,.38) !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-header {
    background:#383e47 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .reseller-modal-title h5 { color:#f4f6f8 !important; }
body.dark-theme.resellers-modern-page .reseller-modal-title small { color:#9fa9b5 !important; }
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-body {
    background:linear-gradient(180deg,#292e35 0%,#2d3239 100%) !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-footer {
    background:#2b3037 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-body > .mb-3,
body.dark-theme.resellers-modern-page .reseller-form-modal #editResellerContent > .mb-3,
body.dark-theme.resellers-modern-page .reseller-form-modal .modal-body > .row:nth-of-type(-n+2),
body.dark-theme.resellers-modern-page .reseller-form-modal #editResellerContent > .row:nth-of-type(-n+2) {
    background:#343a43 !important;
    border-color:#4c5662 !important;
    box-shadow:0 8px 22px rgba(5,8,12,.12) !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .form-control,
body.dark-theme.resellers-modern-page .reseller-form-modal .form-select,
body.dark-theme.resellers-modern-page .reseller-form-modal .input-group-text {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .form-control[readonly],
body.dark-theme.resellers-modern-page .reseller-form-modal .form-control:disabled,
body.dark-theme.resellers-modern-page .reseller-form-modal .form-select:disabled {
    background:#252a31 !important;
    color:#8f99a5 !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal h6.text-primary {
    color:#eef2f6 !important;
    border-color:var(--night-border) !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .card {
    background:#343a43 !important;
    border-color:#4d5662 !important;
    box-shadow:none !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .card-header {
    background:#3a414b !important;
    border-color:var(--night-border) !important;
    color:#eef2f6 !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .card.border-0.bg-light .row.g-2 > [class*="col-"] > .form-check {
    background:#2d333b !important;
    border-color:#4d5662 !important;
}
body.dark-theme.resellers-modern-page .reseller-form-modal .card.border-0.bg-light .row.g-2 > [class*="col-"] > .form-check:hover {
    background:#343b45 !important;
    border-color:#5aa7ff !important;
}

/* TV modern reutiliza management-modern.css */
body.dark-theme.tv-modern-page .tv-list-card thead th {
    background:#3a414b !important;
    color:#eef2f6 !important;
    border-color:#4a5360 !important;
}
body.dark-theme.tv-modern-page .tv-list-card tbody tr:hover { background:rgba(90,167,255,.07) !important; }
body.dark-theme.tv-modern-page .tv-list-card code {
    background:#292e35 !important;
    color:#b7a7ff !important;
}

/* Controles Bootstrap/plugins que suelen conservar superficies claras */
body.dark-theme .nav-tabs {
    border-color:var(--night-border) !important;
}
body.dark-theme .nav-tabs .nav-link {
    color:#b7c0ca !important;
}
body.dark-theme .nav-tabs .nav-link:hover {
    border-color:#515b67 !important;
    color:#fff !important;
}
body.dark-theme .nav-tabs .nav-link.active {
    background:#3a414b !important;
    border-color:#515b67 #515b67 #3a414b !important;
    color:#fff !important;
}

body.dark-theme .accordion-item,
body.dark-theme .accordion-button,
body.dark-theme .accordion-body {
    background:#31363e !important;
    border-color:var(--night-border) !important;
    color:var(--night-text-secondary) !important;
}
body.dark-theme .accordion-button:not(.collapsed) {
    background:#39414b !important;
    color:#fff !important;
    box-shadow:inset 0 -1px 0 var(--night-border) !important;
}
body.dark-theme .accordion-button::after {
    filter:invert(1) grayscale(1) brightness(1.6);
}

body.dark-theme .form-control:disabled,
body.dark-theme .form-control[readonly],
body.dark-theme .form-select:disabled {
    background:#252a31 !important;
    border-color:#424a55 !important;
    color:#909aa6 !important;
    opacity:1 !important;
}

body.dark-theme .choices__list--dropdown .choices__item--choice,
body.dark-theme .choices__list[aria-expanded] .choices__item--choice,
body.dark-theme .select2-results__option {
    background:#2f343c !important;
    color:#dce2e8 !important;
}
body.dark-theme .choices__list--dropdown .choices__item--choice.is-highlighted,
body.dark-theme .choices__list[aria-expanded] .choices__item--choice.is-highlighted,
body.dark-theme .select2-results__option--highlighted,
body.dark-theme .select2-results__option[aria-selected="true"] {
    background:#414852 !important;
    color:#fff !important;
}

body.dark-theme .badge.bg-warning.text-dark,
body.dark-theme .btn-warning,
body.dark-theme .bg-warning.text-dark {
    color:#2b2106 !important;
}
body.dark-theme .badge.bg-light,
body.dark-theme .badge.text-bg-light {
    background:#414852 !important;
    color:#eef2f6 !important;
}

body.dark-theme .toast,
body.dark-theme .toast-header,
body.dark-theme .popover,
body.dark-theme .popover-header,
body.dark-theme .popover-body {
    background:#343a43 !important;
    border-color:var(--night-border) !important;
    color:var(--night-text-secondary) !important;
}
body.dark-theme .popover-header {
    color:#fff !important;
}

/* =====================================================================
   Dark v3 — Pricing Config + modal close buttons
   ===================================================================== */

/* Pricing config usa superficies translucidas pensadas para light. */
body.dark-theme.pricing-config-page .page-header-custom {
    border-color:rgba(255,255,255,.10) !important;
}

body.dark-theme.pricing-config-page .card {
    background:#30353d !important;
    border-color:rgba(255,255,255,.10) !important;
    box-shadow:0 10px 28px rgba(5,8,12,.18) !important;
}

body.dark-theme.pricing-config-page .card-header {
    background:#373d46 !important;
    border-color:rgba(255,255,255,.10) !important;
    color:#f4f6f8 !important;
}

body.dark-theme.pricing-config-page .card-header h5,
body.dark-theme.pricing-config-page .card-body h6,
body.dark-theme.pricing-config-page .form-label {
    color:#eef2f6 !important;
}

body.dark-theme.pricing-config-page .mode-selector {
    background:#343a43 !important;
    border-color:#505966 !important;
    color:#eef2f6 !important;
}

body.dark-theme.pricing-config-page .mode-selector:hover {
    background:#3a414b !important;
    border-color:#5aa7ff !important;
}

body.dark-theme.pricing-config-page .mode-selector.active {
    background:linear-gradient(145deg,#2c405b 0%,#2d3d54 100%) !important;
    border-color:#2386ff !important;
    box-shadow:0 0 0 1px rgba(35,134,255,.20) inset !important;
}

body.dark-theme.pricing-config-page .mode-selector small,
body.dark-theme.pricing-config-page .package-card .text-muted,
body.dark-theme.pricing-config-page .package-card small,
body.dark-theme.pricing-config-page #packagesSection .text-muted {
    color:#aeb7c2 !important;
}

body.dark-theme.pricing-config-page #packagesSection > .card-body {
    background:#2e333b !important;
}

body.dark-theme.pricing-config-page .package-card {
    background:linear-gradient(145deg,#373d46 0%,#343a43 100%) !important;
    border:1px solid #515b67 !important;
    color:#f3f6f9 !important;
    box-shadow:0 7px 20px rgba(5,8,12,.15) !important;
}

body.dark-theme.pricing-config-page .package-card:hover {
    background:linear-gradient(145deg,#3e454f 0%,#39414a 100%) !important;
    border-color:#66727f !important;
    box-shadow:0 10px 28px rgba(5,8,12,.22) !important;
}

body.dark-theme.pricing-config-page .package-card h6 {
    color:#f7f9fb !important;
}

body.dark-theme.pricing-config-page .package-card .text-primary,
body.dark-theme.pricing-config-page .package-card .h5.text-primary {
    color:#5aa7ff !important;
}

body.dark-theme.pricing-config-page .package-card .btn-outline-secondary {
    background:#2d333b !important;
    border-color:#66727f !important;
    color:#dce2e8 !important;
}

body.dark-theme.pricing-config-page .package-card .btn-outline-danger {
    background:#3b2c30 !important;
    border-color:#9a4c59 !important;
    color:#ff9eaa !important;
}

body.dark-theme.pricing-config-page .alert-light {
    background:#343a43 !important;
    border-color:#515b67 !important;
    color:#d5dbe2 !important;
}

body.dark-theme.pricing-config-page .alert-info {
    background:#213a46 !important;
    border-color:#2f6173 !important;
    color:#d9f5ff !important;
}

body.dark-theme.pricing-config-page .form-control,
body.dark-theme.pricing-config-page .form-select,
body.dark-theme.pricing-config-page .input-group-text {
    background:#292e35 !important;
    border-color:#4d5662 !important;
    color:#f4f6f8 !important;
}

body.dark-theme.pricing-config-page .form-control:focus,
body.dark-theme.pricing-config-page .form-select:focus {
    background:#2f353d !important;
    border-color:#5aa7ff !important;
    color:#fff !important;
    box-shadow:0 0 0 .2rem rgba(90,167,255,.16) !important;
}

/* Modales de precios */
body.dark-theme.pricing-config-page #createPackageModal .modal-content,
body.dark-theme.pricing-config-page #editPackageModal .modal-content {
    background:#31363e !important;
    border:1px solid rgba(255,255,255,.10) !important;
}

body.dark-theme.pricing-config-page #createPackageModal .modal-header,
body.dark-theme.pricing-config-page #editPackageModal .modal-header {
    background:#383e47 !important;
    border-color:rgba(255,255,255,.10) !important;
}

body.dark-theme.pricing-config-page #createPackageModal .modal-body,
body.dark-theme.pricing-config-page #editPackageModal .modal-body {
    background:#31363e !important;
}

body.dark-theme.pricing-config-page #createPackageModal .modal-footer,
body.dark-theme.pricing-config-page #editPackageModal .modal-footer {
    background:#2b3037 !important;
    border-color:rgba(255,255,255,.10) !important;
}

/* X de cierre visible: SVG blanco explicito, sin filtros sobre todo el boton. */
body.dark-theme .modal-header .btn-close,
body.dark-theme .modal-header .btn-close-white,
body.dark-theme.servers-modern-page .modal-header .btn-close,
body.dark-theme.servers-modern-page .modal-header .btn-close-white {
    width:34px !important;
    height:34px !important;
    padding:0 !important;
    margin:0 !important;
    border:1px solid rgba(255,255,255,.18) !important;
    border-radius:10px !important;
    background-color:rgba(255,255,255,.06) !important;
    background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23ffffff' d='M.293 1.707A1 1 0 0 1 1.707.293L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707z'/%3e%3c/svg%3e") !important;
    background-repeat:no-repeat !important;
    background-position:center !important;
    background-size:12px 12px !important;
    filter:none !important;
    opacity:.9 !important;
    box-shadow:none !important;
}

body.dark-theme .modal-header .btn-close:hover,
body.dark-theme .modal-header .btn-close-white:hover {
    background-color:rgba(255,255,255,.13) !important;
    border-color:rgba(255,255,255,.28) !important;
    opacity:1 !important;
}

/* Library Packs Plex */
body.dark-theme #packsModal .modal-content,
body.dark-theme #packFormModal .modal-content {
    background:#31363e !important;
    border:1px solid rgba(255,255,255,.10) !important;
}

body.dark-theme #packsModal .modal-header,
body.dark-theme #packFormModal .modal-header {
    background:#383e47 !important;
    border-color:rgba(255,255,255,.10) !important;
}

body.dark-theme #packsModal .modal-body,
body.dark-theme #packFormModal .modal-body {
    background:#31363e !important;
    color:#d9dfe6 !important;
}

body.dark-theme #packsModal .modal-footer,
body.dark-theme #packFormModal .modal-footer {
    background:#2b3037 !important;
    border-color:rgba(255,255,255,.10) !important;
}

body.dark-theme #packLibrariesList {
    background:#292f36 !important;
    border-color:#4d5662 !important;
}

body.dark-theme #packFormModal .form-check {
    background:#343a43 !important;
    border-color:#505a66 !important;
    color:#e9edf2 !important;
}

/* Library Packs Emby: neutraliza los inline white del modal. */
body.dark-theme #embyPacksModal .modal-content,
body.dark-theme #embyPackFormModal .modal-content {
    background:#31363e !important;
    border:1px solid rgba(255,255,255,.10) !important;
}

body.dark-theme #embyPacksModal .modal-body,
body.dark-theme #embyPackFormModal .modal-body {
    background:#31363e !important;
    color:#d9dfe6 !important;
}

body.dark-theme #embyPacksModal .modal-footer,
body.dark-theme #embyPackFormModal .modal-footer {
    background:#2b3037 !important;
    border-color:rgba(255,255,255,.10) !important;
}

body.dark-theme #embyPackLibrariesList {
    background:#292f36 !important;
    border-color:#4d5662 !important;
}

body.dark-theme #embyPackFormModal .form-check {
    background:#343a43 !important;
    border-color:#505a66 !important;
    color:#e9edf2 !important;
}
