/*
 * Capa de color oscuro del administrador.
 * Se mantiene separada de admin.css para que los temas de marca por URL
 * (theme-smartport, theme-msp y theme-cvg) conserven sus colores de acento.
 */

html.admin-dark-mode {
    color-scheme: dark;
    --admin-dark-canvas: #111827;
    --admin-dark-surface: #1f2937;
    --admin-dark-surface-soft: #263244;
    --admin-dark-surface-hover: #334155;
    --admin-dark-border: #3d4b60;
    --admin-dark-text: #e5e7eb;
    --admin-dark-muted: #aab4c3;
    --admin-dark-input: #172033;
}

html.admin-dark-mode body,
html.admin-dark-mode #content-wrapper,
html.admin-dark-mode #content,
html.admin-dark-mode #view {
    background-color: var(--admin-dark-canvas) !important;
    color: var(--admin-dark-text);
}

/* Login: selector de tema y acento lateral en modo oscuro. */
.login-page .login-theme-toggle {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 1031;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    color: #243b53;
    border: 1px solid rgba(36, 59, 83, .2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.login-page .login-theme-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
html.admin-dark-mode .login-page .login-theme-toggle {
    background: var(--admin-dark-surface);
    color: #ffe2a3;
    border-color: var(--admin-dark-border);
}
html.admin-dark-mode body.bg-gradient-primary:has(.login-page) {
    background-image: none !important;
    min-height: 100vh;
}
html.admin-dark-mode .login-page::before {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--green-light) 10%, var(--green-dark) 100%);
    pointer-events: none;
    z-index: 1030;
}
html.admin-dark-mode .login-page .bg-gradient-light {
    background-color: var(--admin-dark-input) !important;
    background-image: linear-gradient(150deg, var(--admin-dark-surface-soft), var(--admin-dark-input)) !important;
}
html.admin-dark-mode .login-page > .row > div > .card {
    outline: 1px solid var(--admin-dark-border);
    outline-offset: -1px;
}

/* El acento del tema se conserva como una franja de 5 px a la izquierda. */
html.admin-dark-mode #accordionSidebar {
    background-color: var(--admin-dark-surface) !important;
    background-image: linear-gradient(180deg, var(--green-light) 10%, var(--green-dark) 100%) !important;
    background-size: 5px 100% !important;
    background-position: left top !important;
    background-repeat: no-repeat !important;
}

html.admin-dark-mode #accordionSidebar .nav-link,
html.admin-dark-mode #accordionSidebar .nav-link i,
html.admin-dark-mode #accordionSidebar .nav-link::after,
html.admin-dark-mode #accordionSidebar .sidebar-heading,
html.admin-dark-mode #accordionSidebar .collapse-header,
html.admin-dark-mode #accordionSidebar .collapse-item,
html.admin-dark-mode #accordionSidebar #sidebarToggle::after {
    color: #fff !important;
}

html.admin-dark-mode #accordionSidebar .nav-item.active > .nav-link,
html.admin-dark-mode #accordionSidebar .nav-link:hover,
html.admin-dark-mode #accordionSidebar .nav-link:focus-visible,
html.admin-dark-mode #accordionSidebar .collapse-item.active,
html.admin-dark-mode #accordionSidebar .collapse-item:hover,
html.admin-dark-mode #accordionSidebar .collapse-item:focus-visible {
    background-color: var(--admin-dark-surface-hover) !important;
    /* Keep the left accent visible beneath highlighted main links. */
    background-clip: padding-box;
}

html.admin-dark-mode #accordionSidebar > .nav-item > .nav-link {
    border-left: 5px solid transparent;
    box-sizing: border-box;
}

html.admin-dark-mode .sidebar .sidebar-brand,
html.admin-dark-mode .sidebar .sidebar-brand-icon,
html.admin-dark-mode .sidebar .sidebar-brand-icon .bg-theme {
    filter: none !important;
    opacity: 1 !important;
}

html.admin-dark-mode .sidebar .sidebar-brand {
    color: #fff !important;
}

html.admin-dark-mode .sidebar .sidebar-brand-icon .bg-theme {
    color: inherit !important;
}

html.admin-dark-mode .topbar,
html.admin-dark-mode .sticky-footer,
html.admin-dark-mode .card,
html.admin-dark-mode .card-header,
html.admin-dark-mode .card-footer,
html.admin-dark-mode .modal-content,
html.admin-dark-mode .dropdown-menu,
html.admin-dark-mode .list-group-item,
html.admin-dark-mode .popover,
html.admin-dark-mode .toast,
html.admin-dark-mode .jumbotron,
html.admin-dark-mode .collapse-inner,
html.admin-dark-mode .ui-dialog,
html.admin-dark-mode .ui-dialog .ui-dialog-titlebar,
html.admin-dark-mode .swal2-popup {
    background-color: var(--admin-dark-surface) !important;
    color: var(--admin-dark-text) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .bg-white,
html.admin-dark-mode .bg-light,
html.admin-dark-mode .bg-gray-100,
html.admin-dark-mode .bg-gray-200,
html.admin-dark-mode .table-light,
html.admin-dark-mode .table .thead-light th {
    background-color: var(--admin-dark-surface) !important;
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .card-header,
html.admin-dark-mode .card-footer,
html.admin-dark-mode .modal-header,
html.admin-dark-mode .modal-footer,
html.admin-dark-mode .dropdown-divider,
html.admin-dark-mode hr,
html.admin-dark-mode .border,
html.admin-dark-mode .border-top,
html.admin-dark-mode .border-right,
html.admin-dark-mode .border-bottom,
html.admin-dark-mode .border-left {
    border-color: var(--admin-dark-border) !important;
}

/* Conserva la lectura semántica de las tarjetas de resumen. */
html.admin-dark-mode .border-left-primary {
    border-left-color: var(--green-light) !important;
}

html.admin-dark-mode .border-left-secondary {
    border-left-color: var(--secondary) !important;
}

html.admin-dark-mode .border-left-success {
    border-left-color: var(--success) !important;
}

html.admin-dark-mode .border-left-info {
    border-left-color: var(--info) !important;
}

html.admin-dark-mode .border-left-warning {
    border-left-color: var(--warning) !important;
}

html.admin-dark-mode .border-left-danger {
    border-left-color: var(--danger) !important;
}

html.admin-dark-mode .border-left-dark {
    border-left-color: var(--gray) !important;
}

html.admin-dark-mode .text-gray-900,
html.admin-dark-mode .text-gray-800,
html.admin-dark-mode .text-gray-700,
html.admin-dark-mode .text-gray-600,
html.admin-dark-mode .text-dark,
html.admin-dark-mode h1,
html.admin-dark-mode h2,
html.admin-dark-mode h3,
html.admin-dark-mode h4,
html.admin-dark-mode h5,
html.admin-dark-mode h6,
html.admin-dark-mode label,
html.admin-dark-mode legend,
html.admin-dark-mode .modal-title,
html.admin-dark-mode .swal2-title,
html.admin-dark-mode .swal2-html-container,
html.admin-dark-mode .ui-dialog-title {
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .text-gray-500,
html.admin-dark-mode .text-gray-400,
html.admin-dark-mode .text-muted,
html.admin-dark-mode small,
html.admin-dark-mode .form-text {
    color: var(--admin-dark-muted) !important;
}

html.admin-dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item):not(.sidebar-brand) {
    color: #7dd3fc;
}

html.admin-dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item):not(.sidebar-brand):hover {
    color: #bae6fd;
}

html.admin-dark-mode .topbar .nav-item .nav-link,
html.admin-dark-mode .topbar .nav-item .nav-link i,
html.admin-dark-mode .topbar #sidebarToggleTop,
html.admin-dark-mode .topbar #sidebarBackUrl,
html.admin-dark-mode .topbar #sidebarReloadkUrl {
    color: var(--admin-dark-muted) !important;
}

html.admin-dark-mode .topbar .nav-item .nav-link:hover,
html.admin-dark-mode .topbar .nav-item .nav-link:hover i {
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .dropdown-item {
    color: var(--admin-dark-text);
}

html.admin-dark-mode .topbar .dropdown-list .dropdown-item {
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .sidebar .collapse-inner .collapse-header {
    color: var(--admin-dark-muted) !important;
}

html.admin-dark-mode .sidebar .collapse-inner .collapse-item {
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .dropdown-item:hover,
html.admin-dark-mode .dropdown-item:focus,
html.admin-dark-mode .dropdown-item.active,
html.admin-dark-mode .dropdown-item:active,
html.admin-dark-mode .list-group-item-action:hover,
html.admin-dark-mode .list-group-item-action:focus,
html.admin-dark-mode .sidebar .collapse-inner .collapse-item:hover,
html.admin-dark-mode .sidebar .collapse-inner .collapse-item:focus,
html.admin-dark-mode .sidebar .collapse-inner .collapse-item.active {
    background-color: var(--admin-dark-surface-hover) !important;
    color: #fff !important;
}

html.admin-dark-mode .form-control,
html.admin-dark-mode .custom-select,
html.admin-dark-mode .input-group-text,
html.admin-dark-mode .custom-file-label,
html.admin-dark-mode .select2-container--default .select2-selection--single,
html.admin-dark-mode .select2-container--default .select2-selection--multiple,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection,
html.admin-dark-mode .select2-dropdown,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-dropdown,
html.admin-dark-mode .select2-search__field,
html.admin-dark-mode .tagify,
html.admin-dark-mode .note-editor,
html.admin-dark-mode .note-editable {
    background-color: var(--admin-dark-input) !important;
    color: var(--admin-dark-text) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .form-control:focus,
html.admin-dark-mode .custom-select:focus,
html.admin-dark-mode .select2-container--focus .select2-selection {
    background-color: #1c2940 !important;
    color: #fff !important;
    border-color: var(--green-light) !important;
    box-shadow: 0 0 0 .2rem rgba(125, 211, 252, .14);
}

html.admin-dark-mode .form-control:disabled,
html.admin-dark-mode .form-control[readonly],
html.admin-dark-mode .custom-select:disabled {
    background-color: #202a39 !important;
    color: #8f9bad !important;
}

html.admin-dark-mode .form-control::placeholder,
html.admin-dark-mode .select2-search__field::placeholder {
    color: #7f8a9c !important;
}

html.admin-dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered,
html.admin-dark-mode .select2-container--default .select2-results__option,
html.admin-dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-results__option,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display {
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .select2-container--default .select2-results__option--highlighted,
html.admin-dark-mode .select2-container--default .select2-results__option[aria-selected="true"],
html.admin-dark-mode .select2-container--bootstrap-5 .select2-results__option--highlighted,
html.admin-dark-mode .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"],
html.admin-dark-mode .select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: var(--admin-dark-surface-hover) !important;
    color: #fff !important;
}

html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection__placeholder,
html.admin-dark-mode .select2-container--default .select2-selection__placeholder {
    color: var(--admin-dark-muted) !important;
}

html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice,
html.admin-dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--admin-dark-surface-hover) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove,
html.admin-dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--admin-dark-muted) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .custom-file-label::after {
    background-color: var(--admin-dark-surface-soft) !important;
    color: var(--admin-dark-text) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .custom-file-input:focus ~ .custom-file-label,
html.admin-dark-mode .custom-file-input:focus ~ .custom-file-label::after {
    border-color: var(--green-light) !important;
}

html.admin-dark-mode .table,
html.admin-dark-mode .table th,
html.admin-dark-mode .table td {
    color: var(--admin-dark-text);
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .table-hover tbody tr:hover,
html.admin-dark-mode .table-striped tbody tr:nth-of-type(odd),
html.admin-dark-mode .table-active,
html.admin-dark-mode .table-active > th,
html.admin-dark-mode .table-active > td {
    background-color: rgba(255, 255, 255, .045) !important;
    color: #fff;
}

html.admin-dark-mode .page-link {
    background-color: var(--admin-dark-surface);
    border-color: var(--admin-dark-border);
    color: var(--admin-dark-text);
}

html.admin-dark-mode .page-link:hover,
html.admin-dark-mode .page-item.active .page-link {
    background-color: var(--admin-dark-surface-hover);
    border-color: var(--green-light);
    color: #fff;
}

html.admin-dark-mode .nav-tabs,
html.admin-dark-mode .nav-tabs .nav-link,
html.admin-dark-mode .nav-pills .nav-link {
    border-color: var(--admin-dark-border);
}

html.admin-dark-mode .nav-tabs .nav-link.active,
html.admin-dark-mode .nav-tabs .nav-item.show .nav-link {
    background-color: var(--admin-dark-surface);
    border-color: var(--admin-dark-border);
    color: #fff;
}

html.admin-dark-mode .alert-light,
html.admin-dark-mode .badge-light {
    background-color: var(--admin-dark-surface-soft);
    color: var(--admin-dark-text);
    border-color: var(--admin-dark-border);
}

/* Superficies propias de los formularios renovados. */
html.admin-dark-mode .commercial-form__section,
html.admin-dark-mode .commercial-form__section--identity,
html.admin-dark-mode .commercial-form__charge-card,
html.admin-dark-mode .game-form__section--dynamic > .card-body,
html.admin-dark-mode .game-form__team-card,
html.admin-dark-mode .game-form__judge-row,
html.admin-dark-mode .game-form__medal-option,
html.admin-dark-mode .game-form__footer,
html.admin-dark-mode .type-person-form__rule,
html.admin-dark-mode .type-person-form__empty,
html.admin-dark-mode .type-person-form__footer,
html.admin-dark-mode .person-v2-form .v2-photo-card,
html.admin-dark-mode .person-v2-sport-card,
html.admin-dark-mode .person-v2-sport-card__toggle,
html.admin-dark-mode .person-v2-form__footer {
    background: var(--admin-dark-surface-soft) !important;
    color: var(--admin-dark-text) !important;
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .commercial-form__section-heading h6,
html.admin-dark-mode .commercial-form__charge-card > h6,
html.admin-dark-mode .commercial-switch__label strong,
html.admin-dark-mode .game-form__team-card > h6,
html.admin-dark-mode .type-person-form__rule-heading,
html.admin-dark-mode .person-v2-form__header h6,
html.admin-dark-mode .person-v2-sport-card__toggle strong {
    color: var(--admin-dark-text) !important;
}

html.admin-dark-mode .commercial-form__header small,
html.admin-dark-mode .commercial-form__section-heading p,
html.admin-dark-mode .game-form__section-header small,
html.admin-dark-mode .game-form__team-card > h6 small,
html.admin-dark-mode .type-person-form__header small,
html.admin-dark-mode .type-person-form__empty,
html.admin-dark-mode .person-v2-form__header small,
html.admin-dark-mode .person-v2-sport-card__toggle small {
    color: var(--admin-dark-muted) !important;
}

html.admin-dark-mode .commercial-form__footer,
html.admin-dark-mode .person-v2-form__footer,
html.admin-dark-mode .type-person-form__footer {
    background: var(--admin-dark-surface) !important;
}

html.admin-dark-mode .type-person-form__options,
html.admin-dark-mode .person-v2-form__sport-heading,
html.admin-dark-mode .person-v2-tourney-list,
html.admin-dark-mode .person-v2-tourney-option {
    border-color: var(--admin-dark-border) !important;
}

html.admin-dark-mode .close,
html.admin-dark-mode .swal2-close {
    color: #fff;
    text-shadow: none;
}

html.admin-dark-mode .skeleton {
    background: linear-gradient(90deg, #263244 25%, #334155 50%, #263244 75%);
    background-size: 200% 100%;
}

html.admin-dark-mode .fc,
html.admin-dark-mode .fc-theme-standard td,
html.admin-dark-mode .fc-theme-standard th,
html.admin-dark-mode .fc-theme-standard .fc-scrollgrid {
    border-color: var(--admin-dark-border);
    color: var(--admin-dark-text);
}

html.admin-dark-mode .admin-dark-mode-toggle {
    cursor: pointer;
    outline: 0;
}

html.admin-dark-mode .admin-dark-mode-toggle .custom-control,
.admin-dark-mode-toggle .custom-control {
    min-height: 1.25rem;
    padding-left: 2.25rem;
    pointer-events: none;
}

.admin-dark-mode-toggle .custom-control-label::before,
.admin-dark-mode-toggle .custom-control-label::after {
    top: .05rem;
}

@media (prefers-reduced-motion: reduce) {
    html.admin-dark-mode *,
    html.admin-dark-mode *::before,
    html.admin-dark-mode *::after {
        transition-duration: .01ms !important;
    }
}

/* Tagify renders an editable span and pseudo-element placeholder, not an input. */
html.admin-dark-mode .tagify {
    --input-color: var(--admin-dark-text);
    --placeholder-color: var(--admin-dark-muted);
    --placeholder-color-focus: var(--admin-dark-muted);
    --tag-bg: var(--admin-dark-surface-hover);
    --tag-hover: var(--admin-dark-border);
    --tag-text-color: var(--admin-dark-text);
    --tag-text-color--edit: var(--admin-dark-text);
    --tag-remove-btn-color: var(--admin-dark-text);
    --tags-disabled-bg: var(--admin-dark-surface-soft);
}
html.admin-dark-mode .tagify__dropdown {
    --tagify-dd-text-color: var(--admin-dark-text);
    --tagify-dd-bg-color: var(--admin-dark-surface);
    --tagify-dd-color-primary: #2563a6;
}

html.admin-dark-mode .web-media-form__upload,
html.admin-dark-mode .web-media-form__preview,
html.admin-dark-mode .web-media-form__hint {
    background: var(--admin-dark-surface-soft);
    color: var(--admin-dark-text);
    border-color: var(--admin-dark-border);
}
html.admin-dark-mode .web-media-form__file-card { border-color: var(--admin-dark-border); }

/* Mi cuenta: plan, cupos y cambio de suscripción. */
html.admin-dark-mode .account-plan-card__hero {
    background: linear-gradient(135deg, #193b35, var(--admin-dark-surface-soft));
}
html.admin-dark-mode .account-plan-card__meter {
    background: var(--admin-dark-surface-soft);
    border-color: var(--admin-dark-border);
}
html.admin-dark-mode .account-plan-card__status {
    background: #193b35;
    color: #6ee7b7;
}
html.admin-dark-mode .account-plan-card__price strong { color: #6ee7b7; }
html.admin-dark-mode .account-plan-card__identity strong,
html.admin-dark-mode .account-plan-card__meter-heading,
html.admin-dark-mode .account-plan-card__meter-heading strong,
html.admin-dark-mode .account-plan-card__change-copy strong,
html.admin-dark-mode .account-plan-card__empty strong {
    color: var(--admin-dark-text);
}
html.admin-dark-mode .account-plan-card__eyebrow,
html.admin-dark-mode .account-plan-card__identity span,
html.admin-dark-mode .account-plan-card__price span,
html.admin-dark-mode .account-plan-card__price small,
html.admin-dark-mode .account-plan-card__meter-heading strong small,
html.admin-dark-mode .account-plan-card__meter > small,
html.admin-dark-mode .account-plan-card__extras,
html.admin-dark-mode .account-plan-card__change-copy span,
html.admin-dark-mode .account-plan-card__empty {
    color: var(--admin-dark-muted);
}
html.admin-dark-mode .account-plan-card__progress { background: var(--admin-dark-input); }
html.admin-dark-mode .account-plan-card__change,
html.admin-dark-mode .account-plan-card__empty { border-color: var(--admin-dark-border); }

html.admin-dark-mode .account-plan-card .btn-outline-secondary,
html.admin-dark-mode .account-links-card .btn-outline-secondary,
html.admin-dark-mode .btn-outline-secondary[ng-click^="togglePartnerAdvanced("] {
    color: var(--admin-dark-text);
    background-color: transparent;
    border-color: var(--admin-dark-muted);
}
html.admin-dark-mode .account-plan-card .btn-outline-secondary:hover,
html.admin-dark-mode .account-links-card .btn-outline-secondary:hover,
html.admin-dark-mode .account-plan-card .btn-outline-secondary:focus,
html.admin-dark-mode .account-links-card .btn-outline-secondary:focus,
html.admin-dark-mode .account-plan-card .btn-outline-secondary:active,
html.admin-dark-mode .account-links-card .btn-outline-secondary:active,
html.admin-dark-mode .btn-outline-secondary[ng-click^="togglePartnerAdvanced("]:hover,
html.admin-dark-mode .btn-outline-secondary[ng-click^="togglePartnerAdvanced("]:focus,
html.admin-dark-mode .btn-outline-secondary[ng-click^="togglePartnerAdvanced("]:active {
    color: var(--admin-dark-text);
    background-color: var(--admin-dark-surface-hover);
    border-color: var(--admin-dark-text);
}
html.admin-dark-mode .account-plan-card .btn-outline-secondary:focus-visible,
html.admin-dark-mode .account-links-card .btn-outline-secondary:focus-visible,
html.admin-dark-mode .btn-outline-secondary[ng-click^="togglePartnerAdvanced("]:focus-visible {
    outline: 2px solid var(--admin-dark-text);
    outline-offset: 3px;
}

html.admin-dark-mode .account-links-card .btn-outline-primary { color: #a5c8ff; border-color: #648bc5; }
html.admin-dark-mode .account-links-card .btn-outline-primary:hover,
html.admin-dark-mode .account-links-card .btn-outline-primary:focus { color: #fff; background: #315d9d; }
html.admin-dark-mode .account-links-card .btn-outline-danger { color: #ffaaa5; border-color: #cf7772; }
html.admin-dark-mode .account-links-card .btn-outline-danger:hover,
html.admin-dark-mode .account-links-card .btn-outline-danger:focus { color: #fff; background: #963d38; }

html.admin-dark-mode .account-plan-option { background: var(--plan-dark); color: #f1f5f9; --plan-accent: var(--plan-light); }
html.admin-dark-mode .account-plan-option--9 { color: #f2d58f; }
html.admin-dark-mode .account-plan-option.is-selected { box-shadow: 0 0 0 2px var(--admin-dark-surface), 0 0 0 4px var(--plan-light); }

/* Botones compartidos: contraste sobre fondos oscuros, también fuera de Mi cuenta. */
html.admin-dark-mode .btn-outline-secondary,
html.admin-dark-mode .btn-outline-dark,
html.admin-dark-mode .btn-outline-light { --admin-button-ink: #e5e7eb; --admin-button-fill: #334155; }
html.admin-dark-mode .btn-outline-primary { --admin-button-ink: #a5c8ff; --admin-button-fill: #315d9d; }
html.admin-dark-mode .btn-outline-success { --admin-button-ink: #8ee0b7; --admin-button-fill: #23684b; }
html.admin-dark-mode .btn-outline-info { --admin-button-ink: #8edcec; --admin-button-fill: #256575; }
html.admin-dark-mode .btn-outline-warning { --admin-button-ink: #f5d477; --admin-button-fill: #725817; }
html.admin-dark-mode .btn-outline-danger { --admin-button-ink: #ffaaa5; --admin-button-fill: #963d38; }
html.admin-dark-mode .btn[class*="btn-outline-"] {
    color: var(--admin-button-ink, var(--admin-dark-text)) !important;
    border-color: var(--admin-button-ink, var(--admin-dark-muted)) !important;
    background-color: transparent;
}
html.admin-dark-mode .btn[class*="btn-outline-"]:not(:disabled):not(.disabled):hover,
html.admin-dark-mode .btn[class*="btn-outline-"]:not(:disabled):not(.disabled):focus,
html.admin-dark-mode .btn[class*="btn-outline-"]:not(:disabled):not(.disabled):active,
html.admin-dark-mode .btn[class*="btn-outline-"].active,
html.admin-dark-mode .show > .btn[class*="btn-outline-"].dropdown-toggle {
    color: #fff !important;
    background-color: var(--admin-button-fill, var(--admin-dark-surface-hover)) !important;
}
html.admin-dark-mode .btn[class*="btn-outline-"]:focus-visible {
    outline: 2px solid var(--admin-button-ink, var(--admin-dark-text));
    outline-offset: 3px;
}
html.admin-dark-mode .btn[class*="btn-outline-"]:disabled,
html.admin-dark-mode .btn[class*="btn-outline-"].disabled {
    background-color: transparent !important;
    opacity: .65;
}
html.admin-dark-mode .btn-light {
    color: var(--admin-dark-text);
    background-color: var(--admin-dark-surface-soft);
    border-color: var(--admin-dark-muted);
}
html.admin-dark-mode .btn-light:not(:disabled):not(.disabled):hover,
html.admin-dark-mode .btn-light:not(:disabled):not(.disabled):focus,
html.admin-dark-mode .btn-light:not(:disabled):not(.disabled):active,
html.admin-dark-mode .btn-light.active {
    color: #fff;
    background-color: var(--admin-dark-surface-hover);
    border-color: var(--admin-dark-text);
}

/* Keep native overflow controls consistent across dark summaries and panels. */
html.admin-dark-mode,html.admin-dark-mode *{scrollbar-color:#536176 #202b3b;scrollbar-width:thin}
html.admin-dark-mode::-webkit-scrollbar,html.admin-dark-mode *::-webkit-scrollbar{width:8px;height:8px}
html.admin-dark-mode::-webkit-scrollbar-track,html.admin-dark-mode *::-webkit-scrollbar-track{background:#202b3b}
html.admin-dark-mode::-webkit-scrollbar-thumb,html.admin-dark-mode *::-webkit-scrollbar-thumb{background:#536176;border:2px solid #202b3b;border-radius:8px}
html.admin-dark-mode::-webkit-scrollbar-thumb:hover,html.admin-dark-mode *::-webkit-scrollbar-thumb:hover{background:#718096}
html.admin-dark-mode::-webkit-scrollbar-corner,html.admin-dark-mode *::-webkit-scrollbar-corner{background:#202b3b}

html.admin-dark-mode #rulesModal .modal-body,html.admin-dark-mode #rulesModal .rules-toolbar{background:var(--admin-dark-surface)!important;color:var(--admin-dark-text);border-color:var(--admin-dark-border)}
html.admin-dark-mode #rulesModal .rule-card{background:var(--admin-dark-surface-soft);border-color:var(--admin-dark-border)}
html.admin-dark-mode #rulesModal .rule-title{color:var(--admin-dark-text)}
html.admin-dark-mode #rulesModal .rule-meta,html.admin-dark-mode #rulesModal .rules-help,html.admin-dark-mode #rulesModal .rule-drag-handle{color:var(--admin-dark-muted)}
html.admin-dark-mode #rulesModal .rule-header{border-color:var(--admin-dark-border)}
html.admin-dark-mode #rulesModal .rule-pill-muted{background:#334155;color:#cbd5e1;border-color:#475569}
html.admin-dark-mode #rulesModal .rule-pill-part{background:#123e52;color:#8bd9fa;border-color:#256780}
html.admin-dark-mode #rulesModal .rule-pill-res{background:#173d32;color:#8be0b8;border-color:#29634e}
html.admin-dark-mode #rulesModal .rule-card.rule-participation{border-left-color:#0ea5e9}
html.admin-dark-mode #rulesModal .rule-card.rule-result{border-left-color:#16a34a}
html.admin-dark-mode #rulesModal .rule-card.rule-error{border-color:#dc3545}
html.admin-dark-mode #rulesModal .rule-card.rule-partial{border-left-color:#d39e00}
html.admin-dark-mode #rulesModal .rule-ghost{background:var(--admin-dark-surface-hover)}

html.admin-dark-mode .tourney-map-view .bracket-round-expanded .game-item{background:var(--admin-dark-surface-soft)!important;color:var(--admin-dark-text);box-shadow:0 1px 3px #0003}
html.admin-dark-mode .tourney-map-view .bracket-round-expanded .game-item h6{color:var(--admin-dark-text)!important}
