/*
 * Dark-theme overrides for stylesheets that hardcode light colors
 * (navigation.menu.css, login.css, legacy DataTables). Bootstrap 5.3
 * components adapt on their own via [data-bs-theme="dark"].
 */

.theme-toggle {
    line-height: 1;
}

/* --- Navigation --- */

[data-bs-theme="dark"] .navigation-clean-button {
    background: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] .navigation-clean-button .navbar-brand:hover {
    color: #fff;
}

[data-bs-theme="dark"] .navigation-clean-button .navbar-toggler {
    border-color: #495057;
}

[data-bs-theme="dark"] .navigation-clean-button .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28222, 226, 230, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav .nav-link {
    color: #adb5bd;
}

[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav .nav-link:focus,
[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav .nav-link:hover {
    color: #fff !important;
}

[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav a.active,
[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav a.active:focus,
[data-bs-theme="dark"] .navigation-clean-button.navbar-light .navbar-nav a.active:hover {
    color: #6c757d;
}

[data-bs-theme="dark"] .navigation-clean-button .navbar-nav > li > .dropdown-menu {
    background-color: #2b3035;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .4);
}

[data-bs-theme="dark"] .navigation-clean-button .dropdown-menu .dropdown-item {
    color: #dee2e6;
}

[data-bs-theme="dark"] .navigation-clean-button .dropdown-menu .dropdown-item:focus,
[data-bs-theme="dark"] .navigation-clean-button .dropdown-menu .dropdown-item:hover {
    background: #343a40;
}

/* --- Login page --- */

[data-bs-theme="dark"] .login-clean {
    background: #16191d;
}

[data-bs-theme="dark"] .login-clean form {
    background-color: #212529;
    color: #adb5bd;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .login-clean form .form-control {
    background: #2b3035;
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .login-clean form .forgot {
    color: #8b949e;
}

/* --- DataTables (legacy 1.10 stylesheet hardcodes #333 text) --- */

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_processing,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #6c757d !important;
    background: transparent;
    border-color: transparent;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #fff !important;
    background: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    background: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] table.dataTable tbody tr {
    background-color: transparent;
}

[data-bs-theme="dark"] table.dataTable.stripe tbody tr.odd,
[data-bs-theme="dark"] table.dataTable.display tbody tr.odd {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] table.dataTable.hover tbody tr:hover,
[data-bs-theme="dark"] table.dataTable.display tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

/* Ordered-column shading: the stock stylesheet hardcodes near-white
   backgrounds per odd/even/hover variant, so a blanket override is used. */
[data-bs-theme="dark"] table.dataTable tbody tr > .sorting_1,
[data-bs-theme="dark"] table.dataTable tbody tr > .sorting_2,
[data-bs-theme="dark"] table.dataTable tbody tr > .sorting_3 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover > .sorting_1,
[data-bs-theme="dark"] table.dataTable tbody tr:hover > .sorting_2,
[data-bs-theme="dark"] table.dataTable tbody tr:hover > .sorting_3 {
    background-color: rgba(255, 255, 255, 0.09) !important;
}

[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable thead td {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] table.dataTable.no-footer {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] table.dataTable.row-border tbody th,
[data-bs-theme="dark"] table.dataTable.row-border tbody td,
[data-bs-theme="dark"] table.dataTable.display tbody th,
[data-bs-theme="dark"] table.dataTable.display tbody td {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid #495057;
}
