/* Shared appearance control, also available on the sign-in screen. */
#lg2.site-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px; padding-top: 8px; padding-bottom: 8px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #cbd5ce; border-radius: 20px; background: #f4f7f5; color: #254332; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 36px; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: #e5efe8; }
.theme-toggle:focus-visible { outline: 3px solid #198754; outline-offset: 3px; }
.theme-switch { width: 28px; height: 16px; border-radius: 10px; background: #748179; padding: 2px; }
.theme-switch::after { content: ''; display: block; width: 12px; height: 12px; border-radius: 50%; background: white; }
.theme-toggle[aria-pressed="true"] .theme-switch { background: #198754; }
.theme-toggle[aria-pressed="true"] .theme-switch::after { transform: translateX(12px); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --bs-body-bg: #141c22; --bs-body-color: #e4eaf0; --bs-border-color: #42515e; --bs-link-color: #83beff; --bs-link-hover-color: #b3d8ff; --bs-code-color: #f49ac2; }
html[data-theme="dark"] body { background-color: #141c22; color: #e4eaf0; }
html[data-theme="dark"] .theme-toggle { background: #22322b; border-color: #50665a; color: #e4efe7; }
html[data-theme="dark"] .theme-toggle:hover { background: #304739; }
.aena-logo-dark { display: none; }
html[data-theme="dark"] .aena-logo-light { display: none; }
html[data-theme="dark"] .aena-logo-dark { display: inline-block; }
html[data-theme="dark"] .linkrevela { color: #e4eaf0; }
html[data-theme="dark"] .text-muted, html[data-theme="dark"] .form-text { color: #abb8c5 !important; }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-light { background-color: #1d2832 !important; }
html[data-theme="dark"] .text-dark, html[data-theme="dark"] .text-black { color: #e4eaf0 !important; }
html[data-theme="dark"] .card, html[data-theme="dark"] .modal-content, html[data-theme="dark"] .list-group-item, html[data-theme="dark"] .popover, html[data-theme="dark"] .toast { background-color: #1d2832; color: #e4eaf0; border-color: #42515e; }
html[data-theme="dark"] .card-header, html[data-theme="dark"] .card-footer, html[data-theme="dark"] .modal-header, html[data-theme="dark"] .modal-footer { border-color: #42515e; }
html[data-theme="dark"] .dropdown-menu { --bs-dropdown-bg: #1d2832; --bs-dropdown-color: #e4eaf0; --bs-dropdown-link-color: #e4eaf0; --bs-dropdown-link-hover-color: #fff; --bs-dropdown-link-hover-bg: #304252; --bs-dropdown-border-color: #42515e; --bs-dropdown-divider-bg: #42515e; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select, html[data-theme="dark"] .form-check-input, html[data-theme="dark"] .dataTables_wrapper input, html[data-theme="dark"] .dataTables_wrapper select { background-color: #18232d; color: #e4eaf0; border-color: #536474; }
html[data-theme="dark"] .form-control::placeholder { color: #a7b4c2; }
html[data-theme="dark"] .form-control:disabled, html[data-theme="dark"] .form-select:disabled, html[data-theme="dark"] .input-group-text { background-color: #2c3844; color: #b9c4ce; border-color: #536474; }
html[data-theme="dark"] .form-control:focus, html[data-theme="dark"] .form-select:focus { border-color: #62b98f; box-shadow: 0 0 0 .2rem rgba(98,185,143,.25); }
html[data-theme="dark"] .form-check-input:checked { background-color: #198754; }
html[data-theme="dark"] .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dce6ef' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .table, html[data-theme="dark"] table.dataTable { --bs-table-color: #e4eaf0; --bs-table-bg: #1d2832; --bs-table-striped-bg: #263440; --bs-table-striped-color: #e4eaf0; --bs-table-hover-bg: #304252; --bs-table-hover-color: #fff; --bs-table-active-bg: #354c5c; --bs-table-active-color: #fff; --bs-table-border-color: #42515e; color: #e4eaf0; border-color: #42515e; }
html[data-theme="dark"] table.dataTable tbody tr { background-color: #1d2832; }
html[data-theme="dark"] table.dataTable thead, html[data-theme="dark"] table.dataTable tfoot { background-color: #263440; }
html[data-theme="dark"] .table th[colspan][style*="#d1ecf1"] { background-color: #203e48 !important; color: #b4e1ed !important; }
html[data-theme="dark"] .dataTables_wrapper, html[data-theme="dark"] .dataTables_info, html[data-theme="dark"] .dataTables_length, html[data-theme="dark"] .dataTables_filter, html[data-theme="dark"] .dataTables_processing { color: #e4eaf0 !important; }
html[data-theme="dark"] .dataTables_processing, html[data-theme="dark"] div.dt-button-collection, html[data-theme="dark"] div.dtr-modal div.dtr-modal-display { background: #1d2832; color: #e4eaf0; }
html[data-theme="dark"] .pagination { --bs-pagination-bg: #1d2832; --bs-pagination-color: #83beff; --bs-pagination-border-color: #42515e; --bs-pagination-hover-bg: #304252; --bs-pagination-hover-color: #fff; --bs-pagination-hover-border-color: #536474; --bs-pagination-disabled-bg: #222d37; --bs-pagination-disabled-color: #abb8c5; --bs-pagination-disabled-border-color: #42515e; }
html[data-theme="dark"] .estado.verde .texto, html[data-theme="dark"] .icono.verde { color: #62d798 !important; }
html[data-theme="dark"] .estado.gris .texto { color: #b0bcc8; }
html[data-theme="dark"] .estado.azul .texto { color: #92baff; }
html[data-theme="dark"] span[style*="color:blue"], html[data-theme="dark"] span[style*="color:#1A1A9A"] { color: #92baff !important; }
html[data-theme="dark"] span[style*="color:#198754"] { color: #62d798 !important; }
/* Black PNG action/navigation icons need contrast on dark backgrounds.
   Screen-only so printed tables retain their original black icons. */
@media screen {
    html[data-theme="dark"] img[src$="/database-fill-add.png"],
    html[data-theme="dark"] img[src$="/eraser-fill.png"],
    html[data-theme="dark"] img[src$="/pen-fill.png"],
    html[data-theme="dark"] img[src$="/home.png"],
    html[data-theme="dark"] img[src$="/logout.png"] {
        filter: invert(1);
    }
    /* Keep both sort directions visible and highlight the active direction. */
    html[data-theme="dark"] table.dataTable thead > tr > :is(th, td):is(.sorting, .sorting_asc, .sorting_desc)::before,
    html[data-theme="dark"] table.dataTable thead > tr > :is(th, td):is(.sorting, .sorting_asc, .sorting_desc)::after {
        opacity: .55;
    }
    html[data-theme="dark"] table.dataTable thead > tr > :is(th, td).sorting_asc::before,
    html[data-theme="dark"] table.dataTable thead > tr > :is(th, td).sorting_desc::after {
        opacity: 1;
    }
}
@media (max-width: 575.98px) { #center { display: none; } #lg2.site-tools { gap: 4px; } .site-version { width: 100%; font-size: 10px; } }
@media print { .theme-toggle { display: none !important; } html[data-theme] { color-scheme: light; } html[data-theme] body, html[data-theme] .table { background: white !important; color: black !important; --bs-table-bg: white; --bs-table-color: black; --bs-table-striped-bg: #eee; --bs-table-striped-color: black; } }
@media print { html[data-theme] .aena-logo-light { display: inline-block; } html[data-theme] .aena-logo-dark { display: none; } }
