html.manager-dark-theme body,
body.manager-dark-theme {
    background: #0f1724;
    color: #e8eefb;
}

body.manager-dark-theme .topbar,
body.manager-dark-theme .navbar-custom {
    background: #142033 !important;
}

body.manager-dark-theme .content-page,
body.manager-dark-theme .content,
body.manager-dark-theme .footer {
    background: #0f1724;
    color: #9fb0cc;
}

body.manager-dark-theme .footer {
    border-top: 1px solid rgba(145, 181, 255, 0.12);
}

/* style.css setzt global "a { color: #707070 }" fuers helle Theme - im Dunkelmodus
   ist dieses Grau vor dunklem Hintergrund kaum lesbar. Baseline-Fix fuer alle
   sonst nicht gesondert behandelten Links (z. B. plain <a> in Kartenkoerpern).
   :not(.btn) ausgenommen, sonst uebersteuert diese Regel per Selektor-
   Spezifitaet das eigene weisse .btn-primary/.btn-*-Textcolor (kein !important
   dort) und macht Buttons wie "Oeffnen" kaum lesbar. */
body.manager-dark-theme a:not(.btn) {
    color: #8fb8ff;
}

body.manager-dark-theme a:not(.btn):hover,
body.manager-dark-theme a:not(.btn):focus {
    color: #b7d3ff;
}

body.manager-dark-theme .card,
body.manager-dark-theme .modal-content,
body.manager-dark-theme .dropdown-menu,
body.manager-dark-theme .table,
body.manager-dark-theme .list-group-item,
body.manager-dark-theme .page-title-box,
body.manager-dark-theme .nav-tabs {
    background-color: #162235;
    color: #e8eefb;
    border-color: rgba(145, 181, 255, 0.12);
}

body.manager-dark-theme .table td,
body.manager-dark-theme .table th,
body.manager-dark-theme .card,
body.manager-dark-theme .modal-content,
body.manager-dark-theme .list-group-item,
body.manager-dark-theme .dropdown-divider,
body.manager-dark-theme .nav-tabs,
body.manager-dark-theme .nav-tabs .nav-link {
    border-color: rgba(145, 181, 255, 0.12);
}

/* Aktiver Tab muss sich sowohl von den inaktiven Tabs als auch vom Card-Hintergrund
   abheben (vorher identische Farbe wie .nav-tabs-Container -> unsichtbar), plus ein
   Hover-Zustand, der bisher komplett fehlte. */
body.manager-dark-theme .nav-tabs .nav-link.active {
    background-color: #1b2a42;
    color: #eef4ff !important;
    border-color: rgba(145, 181, 255, 0.28) rgba(145, 181, 255, 0.28) #1b2a42;
}

body.manager-dark-theme .nav-tabs .nav-link:hover,
body.manager-dark-theme .nav-tabs .nav-link:focus {
    background-color: rgba(95, 142, 230, 0.12);
    color: #eef4ff !important;
    border-color: rgba(145, 181, 255, 0.2);
}

body.manager-dark-theme .table-hover tbody tr:hover,
body.manager-dark-theme .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

body.manager-dark-theme .text-muted,
body.manager-dark-theme .page-title-box p,
body.manager-dark-theme small,
body.manager-dark-theme .table,
body.manager-dark-theme .breadcrumb-item,
body.manager-dark-theme .dropdown-item,
body.manager-dark-theme .nav-link,
body.manager-dark-theme label {
    color: #9fb0cc !important;
}

body.manager-dark-theme h1,
body.manager-dark-theme h2,
body.manager-dark-theme h3,
body.manager-dark-theme h4,
body.manager-dark-theme h5,
body.manager-dark-theme h6,
body.manager-dark-theme .page-title,
body.manager-dark-theme strong,
body.manager-dark-theme .dropdown-item:hover,
body.manager-dark-theme .dropdown-item:focus {
    color: #eef4ff !important;
}

body.manager-dark-theme .dropdown-item {
    background-color: transparent !important;
}

body.manager-dark-theme .dropdown-item:hover,
body.manager-dark-theme .dropdown-item:focus,
body.manager-dark-theme .dropdown-item:active {
    background-color: #1b2a42 !important;
    color: #eef4ff !important;
}

body.manager-dark-theme .form-control,
body.manager-dark-theme .custom-select,
body.manager-dark-theme .select2-selection,
body.manager-dark-theme input,
body.manager-dark-theme textarea {
    background: #101b2b !important;
    color: #e8eefb !important;
    border-color: rgba(145, 181, 255, 0.18) !important;
}

/* style.css setzt fuer Select2 global dunkle Schrift mit !important. Ohne
   diesen Gegenpart ist die gewählte Veranstaltung im Dark-Mode kaum lesbar. */
body.manager-dark-theme .select2-container--default .select2-selection--single {
    background: #162840 !important;
}

body.manager-dark-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e8eefb !important;
}

body.manager-dark-theme .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-top-color: #b9c9e2 !important;
}

body.manager-dark-theme .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-bottom-color: #b9c9e2 !important;
}

body.manager-dark-theme .form-control::placeholder,
body.manager-dark-theme input::placeholder,
body.manager-dark-theme textarea::placeholder {
    color: #7e91af !important;
}

body.manager-dark-theme .bg-light {
    background-color: #101b2b !important;
    color: #e8eefb;
    border-color: rgba(145, 181, 255, 0.18) !important;
}

body.manager-dark-theme .bg-light a {
    color: #a9c8ff;
}

body.manager-dark-theme .card-header:hover {
    background-color: #1b2a42;
}

body.manager-dark-theme .ab-experiments .card-title,
body.manager-dark-theme .ab-experiments .card-title a {
    color: #eef4ff !important;
}

body.manager-dark-theme .ab-experiments .card-title a:hover,
body.manager-dark-theme .ab-experiments .card-title a:focus {
    color: #a9c8ff !important;
}

body.manager-dark-theme .ab-experiments .btn-stop-experiment {
    color: #e8eefb;
    border-color: #8294b0;
}

body.manager-dark-theme .ab-experiments .btn-stop-experiment:hover,
body.manager-dark-theme .ab-experiments .btn-stop-experiment:focus {
    color: #ffffff;
    background-color: #40516d;
    border-color: #9fb0cc;
}

body.manager-dark-theme .btn-outline-secondary,
body.manager-dark-theme .btn-secondary {
    color: #d7e4fb;
    border-color: rgba(145, 181, 255, 0.22);
}

/* Native <dialog>-Elemente liegen ausserhalb der Bootstrap-Modalstruktur
   und brauchen deshalb eigene Dark-Mode-Farben. */
body.manager-dark-theme dialog {
    background: #162235;
    color: #e8eefb;
    border-color: rgba(145, 181, 255, 0.22) !important;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

body.manager-dark-theme dialog::backdrop {
    background: rgba(3, 10, 22, 0.72);
}

body.manager-dark-theme dialog .text-muted {
    color: #9fb0cc !important;
}

body.manager-dark-theme dialog .btn-default {
    color: #d7e4fb;
    background: #1a2740;
    border-color: rgba(145, 181, 255, 0.22);
}

body.manager-dark-theme dialog .btn-default:hover,
body.manager-dark-theme dialog .btn-default:focus,
body.manager-dark-theme dialog .btn-outline-secondary:hover,
body.manager-dark-theme dialog .btn-outline-secondary:focus {
    color: #eef4ff;
    background: #223250;
    border-color: rgba(145, 181, 255, 0.38);
}

/* Bootstrap-Komponenten, die eigene helle Flaechen mitbringen, muessen im
   globalen Manager-Darkmode ebenfalls eine dunkle Oberflaeche erhalten. */
body.manager-dark-theme .card-header,
body.manager-dark-theme .card-footer,
body.manager-dark-theme .modal-header,
body.manager-dark-theme .modal-footer,
body.manager-dark-theme .input-group-text,
body.manager-dark-theme .custom-file-label,
body.manager-dark-theme .page-link,
body.manager-dark-theme .popover {
    background-color: #1a2740 !important;
    color: #d7e4fb !important;
    border-color: rgba(145, 181, 255, 0.16) !important;
}

body.manager-dark-theme hr,
body.manager-dark-theme .border,
body.manager-dark-theme .border-top,
body.manager-dark-theme .border-right,
body.manager-dark-theme .border-bottom,
body.manager-dark-theme .border-left {
    border-color: rgba(145, 181, 255, 0.16) !important;
}

body.manager-dark-theme code,
body.manager-dark-theme pre {
    color: #f0b7ff;
    background-color: #101b2b;
}

body.manager-dark-theme code {
    padding: 0.08rem 0.25rem;
    border-radius: 0.2rem;
}

body.manager-dark-theme .bg-white,
body.manager-dark-theme .btn-light,
body.manager-dark-theme .badge-light {
    background-color: #1a2740 !important;
    color: #d7e4fb !important;
    border-color: rgba(145, 181, 255, 0.16) !important;
}

body.manager-dark-theme .text-dark,
body.manager-dark-theme .text-secondary,
body.manager-dark-theme .custom-control-label,
body.manager-dark-theme .popover-body,
body.manager-dark-theme .popover-header {
    color: #d7e4fb !important;
}

/* .badge-warning keeps its light-yellow background in dark mode; the
   .text-dark override above would otherwise swap its label to a light
   color too, making it unreadable on that background. */
body.manager-dark-theme .badge-warning {
    color: #212529 !important;
}

body.manager-dark-theme .close {
    color: #eef4ff;
    text-shadow: none;
}

body.manager-dark-theme .alert {
    border-color: rgba(145, 181, 255, 0.2);
}

body.manager-dark-theme .alert-success {
    background-color: rgba(34, 197, 94, 0.14);
    border-color: rgba(74, 222, 128, 0.3);
    color: #bbf7d0;
}

body.manager-dark-theme .alert-warning {
    background-color: rgba(245, 158, 11, 0.14);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fde68a;
}

body.manager-dark-theme .alert-danger {
    background-color: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fecaca;
}

/* impersonation-banner.blade.php sets its colors as inline styles rather
   than Bootstrap alert classes, so it needs its own dark-mode override. */
body.manager-dark-theme .impersonation-banner {
    background-color: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    color: #fde68a !important;
}

body.manager-dark-theme .impersonation-banner-btn {
    background-color: #fde68a !important;
    color: #1a1400 !important;
}

body.manager-dark-theme .alert-info,
body.manager-dark-theme .alert-primary {
    background-color: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.3);
    color: #bfdbfe;
}

body.manager-dark-theme .alert-secondary,
body.manager-dark-theme .alert-light {
    background-color: #1a2740;
    border-color: rgba(145, 181, 255, 0.2);
    color: #d7e4fb;
}

body.manager-dark-theme .alert strong,
body.manager-dark-theme .alert a {
    color: inherit !important;
}

body.manager-dark-theme .page-link:hover,
body.manager-dark-theme .page-link:focus {
    background-color: #223250 !important;
    color: #eef4ff !important;
}

body.manager-dark-theme .page-item.disabled .page-link {
    background-color: #131f31 !important;
    color: #7185a4 !important;
}

body.manager-dark-theme select option {
    background-color: #101b2b;
    color: #e8eefb;
}

body.manager-dark-theme .left.side-menu,
body.manager-dark-theme .slimscroll-menu,
body.manager-dark-theme #sidebar-menu,
body.manager-dark-theme .metismenu {
    background: #111b2a !important;
}

body.manager-dark-theme .dataTables_wrapper .dataTables_length,
body.manager-dark-theme .dataTables_wrapper .dataTables_filter,
body.manager-dark-theme .dataTables_wrapper .dataTables_info,
body.manager-dark-theme .dataTables_wrapper .dataTables_processing,
body.manager-dark-theme .dataTables_wrapper .dataTables_paginate,
body.manager-dark-theme .dataTables_info,
body.manager-dark-theme .dataTables_paginate {
    color: #9fb0cc !important;
}

body.manager-dark-theme .dataTables_wrapper .dataTables_filter input,
body.manager-dark-theme .dataTables_wrapper .dataTables_length select,
body.manager-dark-theme .dataTables_wrapper select {
    background: #101b2b !important;
    color: #e8eefb !important;
    border: 1px solid rgba(145, 181, 255, 0.18) !important;
}

body.manager-dark-theme table.dataTable,
body.manager-dark-theme table.dataTable th,
body.manager-dark-theme table.dataTable td,
body.manager-dark-theme .table-bordered th,
body.manager-dark-theme .table-bordered td {
    border-color: rgba(145, 181, 255, 0.12) !important;
}

body.manager-dark-theme table.dataTable thead th,
body.manager-dark-theme table.dataTable thead td,
body.manager-dark-theme .table thead th,
body.manager-dark-theme .thead-light th {
    background: #1a2740 !important;
    color: #d7e4fb !important;
}

body.manager-dark-theme table.dataTable tbody tr,
body.manager-dark-theme table.dataTable tbody td,
body.manager-dark-theme table.dataTable tbody tr.odd td,
body.manager-dark-theme table.dataTable tbody tr.even td,
body.manager-dark-theme .table tbody td {
    background: #162235 !important;
    color: #d7e4fb !important;
}

body.manager-dark-theme table.dataTable tbody tr.even td,
body.manager-dark-theme .table-striped tbody tr:nth-of-type(even) td {
    background: #18263c !important;
}

body.manager-dark-theme table.dataTable tbody tr:hover td,
body.manager-dark-theme .table-hover tbody tr:hover td {
    background: #1b2a42 !important;
}

body.manager-dark-theme table.dataTable tbody a:not(.btn),
body.manager-dark-theme .table tbody a:not(.btn) {
    color: #a9c8ff !important;
}

body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #d7e4fb !important;
    border: 1px solid rgba(145, 181, 255, 0.14) !important;
    background: #162235 !important;
}

body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
body.manager-dark-theme .dataTables_wrapper .dataTables_paginate span .paginate_button,
body.manager-dark-theme .dataTables_paginate .paginate_button,
body.manager-dark-theme .dataTables_paginate .paginate_button a {
    color: #d7e4fb !important;
}

body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.manager-dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #eef4ff !important;
    border-color: rgba(95, 142, 230, 0.3) !important;
    background: #223250 !important;
}

body.manager-dark-theme table.dataTable thead .sorting,
body.manager-dark-theme table.dataTable thead .sorting_asc,
body.manager-dark-theme table.dataTable thead .sorting_desc,
body.manager-dark-theme table.dataTable thead .sorting_asc_disabled,
body.manager-dark-theme table.dataTable thead .sorting_desc_disabled {
    color: #d7e4fb !important;
}

body.manager-dark-theme #sidebar-menu ul li a,
body.manager-dark-theme #sidebar-menu ul li a i,
body.manager-dark-theme .menu-title {
    color: #a9bcdb !important;
}

body.manager-dark-theme #sidebar-menu ul li.mm-active > a i,
body.manager-dark-theme #sidebar-menu ul li.mm-active > a span,
body.manager-dark-theme #sidebar-menu ul li a:hover i,
body.manager-dark-theme #sidebar-menu ul li a:hover span,
body.manager-dark-theme #sidebar-menu ul li a:focus i,
body.manager-dark-theme #sidebar-menu ul li a:focus span {
    color: #d8e5ff !important;
}

body.manager-dark-theme #sidebar-menu ul li.mm-active > a,
body.manager-dark-theme #sidebar-menu ul li a:hover,
body.manager-dark-theme #sidebar-menu ul li a:focus {
    background: rgba(95, 142, 230, 0.08) !important;
    color: #d8e5ff !important;
}

body.manager-dark-theme #sidebar-menu ul li.mm-active > ul,
body.manager-dark-theme #sidebar-menu ul li.mm-show,
body.manager-dark-theme #sidebar-menu ul li ul {
    background: rgba(255, 255, 255, 0.015) !important;
}

body.manager-dark-theme #sidebar-menu > ul > li > a.active,
body.manager-dark-theme #sidebar-menu > ul > li > ul > li > a.active {
    color: #8fc4ff !important;
    background-color: rgba(95, 142, 230, 0.18) !important;
    border-left: 4px solid #5f8ee6;
}

body.manager-dark-theme #sidebar-menu > ul > li > ul {
    background: rgba(255, 255, 255, 0.025) !important;
    border-left-color: rgba(169, 188, 219, 0.3);
}

body.manager-dark-theme #sidebar-menu > ul > li.has-sub.active > a {
    color: #d8e5ff !important;
    background: rgba(95, 142, 230, 0.13) !important;
    border-left: 4px solid #5f8ee6;
}

body.manager-dark-theme #sidebar-menu > ul > li > ul > li > a.active {
    color: #8fc4ff !important;
    background: rgba(95, 142, 230, 0.18) !important;
    border-left: 0;
    box-shadow: inset 3px 0 0 #5f8ee6;
}

body.manager-dark-theme .left.side-menu #sidebar-menu > ul > li > ul > .menu-title {
    color: #91a6c8 !important;
}

body.manager-dark-theme .manager-theme-toggle {
    background: #1a2740;
    color: #eef4ff;
    border-color: rgba(145, 181, 255, 0.18);
}

body.manager-dark-theme .manager-theme-toggle:hover,
body.manager-dark-theme .manager-theme-toggle:focus {
    color: #eef4ff;
}

body.manager-dark-theme .manager-theme-toggle .fa-sun {
    display: none;
}

body.manager-dark-theme .manager-theme-toggle .fa-moon {
    display: inline-block;
}
