:root {
    --dark-bg: #0d1520;
    --dark-surface: #141f2e;
    --dark-elevated: #1a2738;
    --dark-border: #273449;
    --dark-muted: #8ea0bc;
    --dark-text: #e7edf7;
    --dark-heading: #f5f8ff;
    --dark-primary: #4d8dff;
    --dark-success: #35c78a;
    --dark-info: #29b9e7;
    --dark-warning: #ffb23f;
    --dark-danger: #ff6f7d;
    --portal-sm-font-size: 0.875rem;
    --portal-sm-line-height: 1.5;
    --portal-sm-padding-y: 0.25rem;
    --portal-sm-padding-x: 0.5rem;
    --portal-sm-radius: 0.2rem;
    --portal-sm-control-height: calc(1.5em + 0.5rem + 2px);
}

/* Portal UI sizing: align controls to Bootstrap btn-sm scale. */
body.application .btn.btn-sm,
body.application .form-inline .btn,
body.application .filters-row .btn,
body.bg-gradient-primary .btn.btn-sm,
.loginView .btn,
body.application input[type="submit"].btn,
body.application input[type="button"].btn,
body.application input[type="reset"].btn,
body.bg-gradient-primary input[type="submit"].btn,
body.bg-gradient-primary input[type="button"].btn,
body.bg-gradient-primary input[type="reset"].btn,
.loginView input[type="submit"],
.loginView input[type="button"],
.loginView input[type="reset"] {
    font-size: var(--portal-sm-font-size);
    line-height: var(--portal-sm-line-height);
    padding: var(--portal-sm-padding-y) var(--portal-sm-padding-x);
    border-radius: var(--portal-sm-radius);
}

body.application .form-inline .btn,
body.application .filters-row .btn {
    min-height: var(--portal-sm-control-height);
}

body.application .form-control,
body.application .custom-select,
body.application .form-select,
body.application select.form-control,
body.bg-gradient-primary .form-control,
body.bg-gradient-primary .custom-select,
body.bg-gradient-primary .form-select,
.loginView .form-control,
.loginView .custom-select,
.loginView .form-select,
.loginView .formItem,
body.application input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.bg-gradient-primary input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
.loginView input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.bg-gradient-primary select.form-control,
.loginView select.form-control,
.loginView .formItem {
    font-size: var(--portal-sm-font-size);
    line-height: var(--portal-sm-line-height);
    padding: var(--portal-sm-padding-y) var(--portal-sm-padding-x);
    min-height: var(--portal-sm-control-height);
    border-radius: var(--portal-sm-radius);
}

body.application .custom-select,
body.bg-gradient-primary .custom-select,
.loginView .custom-select {
    padding-right: 1.75rem;
}

body.application .form-select,
body.bg-gradient-primary .form-select,
.loginView .form-select {
    padding-right: 2rem;
}

body.application textarea,
body.bg-gradient-primary textarea,
.loginView textarea {
    font-size: var(--portal-sm-font-size);
    line-height: var(--portal-sm-line-height);
    padding: var(--portal-sm-padding-y) var(--portal-sm-padding-x);
    border-radius: var(--portal-sm-radius);
}

body.application .select2-container--default .select2-selection--single,
body.bg-gradient-primary .select2-container--default .select2-selection--single {
    min-height: var(--portal-sm-control-height);
    border-radius: var(--portal-sm-radius);
}

body.application .select2-container--default .select2-selection--single .select2-selection__rendered,
body.bg-gradient-primary .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--portal-sm-control-height) - 2px);
    padding-left: var(--portal-sm-padding-x);
    padding-right: calc(var(--portal-sm-padding-x) + 0.8rem);
}

body.application .select2-container--default .select2-selection--single .select2-selection__arrow,
body.bg-gradient-primary .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--portal-sm-control-height) - 2px);
}

html[data-theme="dark"] body,
body.application,
body.bg-gradient-primary {
    background: radial-gradient(circle at 20% 0%, #16253a 0%, var(--dark-bg) 50%, #0b121c 100%) fixed;
    color: var(--dark-text);
}

html[data-theme="dark"] .container-fluid.container-application,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] #footer-main,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .note-editor.note-frame,
html[data-theme="dark"] .note-editor .note-toolbar,
html[data-theme="dark"] .note-editor .note-editing-area,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .pagination .page-link,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .btn,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .sidenav {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] #footer-main,
html[data-theme="dark"] .footer-auto-bottom1 {
    background: transparent;
    color: var(--dark-text);
}

html[data-theme="dark"] .page-title h5,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-title {
    color: var(--dark-heading) !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small,
html[data-theme="dark"] label,
html[data-theme="dark"] .col-form-label {
    color: var(--dark-muted) !important;
}

html[data-theme="dark"] a,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .btn-link {
    color: #b9cbeb;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .dropdown-item:hover {
    color: #ffffff;
}

html[data-theme="dark"] .navbar.n-top-header,
html[data-theme="dark"] .navbar-main {
    background: rgba(20, 31, 46, 0.92) !important;
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    margin: 12px 12px 0;
    backdrop-filter: blur(7px);
}

html[data-theme="dark"] .navbar .text-dark,
html[data-theme="dark"] .navbar .mb-0 {
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .navbar-nav,
html[data-theme="dark"] .navbar-nav .nav-item,
html[data-theme="dark"] .navbar .navbar-nav {
    background: transparent !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .navbar-nav .nav-link,
html[data-theme="dark"] .navbar-nav .nav-link-icon,
html[data-theme="dark"] .navbar-nav .dropdown-toggle,
html[data-theme="dark"] .navbar-nav .media-pill,
html[data-theme="dark"] .navbar-nav .avatar,
html[data-theme="dark"] .navbar-nav .align-middle {
    color: var(--dark-text) !important;
    background: transparent !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .navbar-nav .nav-link:hover,
html[data-theme="dark"] .navbar-nav .nav-link:focus,
html[data-theme="dark"] .navbar-nav .nav-link-icon:hover,
html[data-theme="dark"] .navbar-nav .nav-link-icon:focus {
    color: #ffffff !important;
    background: rgba(77, 141, 255, 0.16) !important;
    border-radius: 8px;
}

html[data-theme="dark"] .sidenav.custom-sidenav,
html[data-theme="dark"] .sidenav {
    background: linear-gradient(180deg, #081b3b 0%, #07152d 100%) !important;
    border-right: 1px solid #12305f;
}

html[data-theme="dark"] .sidenav .navbar-brand,
html[data-theme="dark"] .sidenav .nav-link,
html[data-theme="dark"] .sidenav .nav-link i,
html[data-theme="dark"] .sidenav .nav-link span {
    color: #d6e4ff !important;
}

html[data-theme="dark"] .sidenav .nav-link:hover,
html[data-theme="dark"] .sidenav .nav-link.active {
    background: rgba(77, 141, 255, 0.18) !important;
    border-left: 3px solid #7babff;
    color: #ffffff !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card.card-box,
html[data-theme="dark"] .dashboardView .card {
    background: linear-gradient(180deg, var(--dark-elevated) 0%, var(--dark-surface) 100%) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(5, 10, 22, 0.35);
}

html[data-theme="dark"] .card-header {
    background: rgba(14, 22, 34, 0.75);
    border-bottom: 1px solid var(--dark-border);
}

html[data-theme="dark"] .card-body,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .card-footer {
    background: transparent !important;
    color: var(--dark-text);
}

html[data-theme="dark"] .card .card-body,
html[data-theme="dark"] .card.card-box .card-body,
html[data-theme="dark"] .page-content .card-body,
html[data-theme="dark"] .dashboardView .card-body,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .table .bg-white,
html[data-theme="dark"] .list-group-item.bg-white {
    background-color: var(--dark-surface) !important;
    color: var(--dark-text) !important;
    border-radius: 20px;
}

html[data-theme="dark"] .card .list-group,
html[data-theme="dark"] .card .list-group.list-group-flush {
    background: transparent !important;
}

html[data-theme="dark"] .card .list-group-item,
html[data-theme="dark"] .card .list-group-item.list-group-item-action,
html[data-theme="dark"] .list-group.list-group-flush > .list-group-item {
    background: var(--dark-surface) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

html[data-theme="dark"] .list-group.list-group-flush > .list-group-item {
    border-radius: 0 !important;
}

html[data-theme="dark"] .card .list-group-item:hover,
html[data-theme="dark"] .card .list-group-item:focus {
    background: rgba(77, 141, 255, 0.12) !important;
}

html[data-theme="dark"] .number-icon {
    color: #ffffff !important;
}

html[data-theme="dark"] .left-card h4,
html[data-theme="dark"] .left-card h4 span {
    color: #d9e6ff !important;
}

html[data-theme="dark"] .icon-box {
    box-shadow: 0 10px 22px rgba(8, 13, 28, 0.35);
}

html[data-theme="dark"] .table {
    color: var(--dark-text);
    background-color: transparent;
}

html[data-theme="dark"] .table thead th {
    color: #d9e6ff;
    border-bottom: 1px solid var(--dark-border);
    background: rgba(19, 32, 48, 0.8);
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table-bordered td,
html[data-theme="dark"] .table-bordered th {
    border-color: var(--dark-border) !important;
}

html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(77, 141, 255, 0.08);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .note-editor.note-frame {
    background-color: #111c2b !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .custom-select:focus,
html[data-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--multiple,
html[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--dark-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(77, 141, 255, 0.25) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #7f93b1;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .select2-dropdown {
    background: #132034 !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text);
}

html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--dark-border);
}

html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .select2-results__option--highlighted[aria-selected] {
    background: rgba(77, 141, 255, 0.2) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-success,
html[data-theme="dark"] .btn-info,
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .btn-warning {
    border-color: transparent;
}

html[data-theme="dark"] .btn-primary {
    background: linear-gradient(180deg, #4d8dff, #2f71e6);
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus {
    background: linear-gradient(180deg, #6ba2ff, #3d7df0);
}

html[data-theme="dark"] .btn-secondary {
    background: #1e2d42;
    color: var(--dark-text);
}

html[data-theme="dark"] .btn-light {
    background: #22324a;
    color: var(--dark-text);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-success,
html[data-theme="dark"] .btn-outline-danger,
html[data-theme="dark"] .btn-outline-warning,
html[data-theme="dark"] .btn-outline-info {
    color: #d6e4ff;
    border-color: #476389;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-success:hover,
html[data-theme="dark"] .btn-outline-danger:hover,
html[data-theme="dark"] .btn-outline-warning:hover,
html[data-theme="dark"] .btn-outline-info:hover {
    background: rgba(77, 141, 255, 0.2);
    border-color: #6d96d2;
}

/* Global badge accessibility (default/light theme) */
.badge {
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.badge-primary {
    background-color: #1f5ec9 !important;
    color: #ffffff !important;
}

.badge-secondary {
    background-color: #495b73 !important;
    color: #ffffff !important;
}

.badge-success {
    background-color: #1f7a4a !important;
    color: #ffffff !important;
}

.badge-info {
    background-color: #0d6f92 !important;
    color: #ffffff !important;
}

.badge-warning {
    background-color: #b26a00 !important;
    color: #101828 !important;
}

.badge-danger {
    background-color: #b4232a !important;
    color: #ffffff !important;
}

.badge-light {
    background-color: #e7eef7 !important;
    color: #1f2937 !important;
}

.badge-dark {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

.badge-white,
.badge.badge-white {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #94a3b8 !important;
    text-shadow: none !important;
}

a.badge-primary:hover,
a.badge-secondary:hover,
a.badge-success:hover,
a.badge-info:hover,
a.badge-danger:hover,
a.badge-dark:hover,
a.badge-primary:focus,
a.badge-secondary:focus,
a.badge-success:focus,
a.badge-info:focus,
a.badge-danger:focus,
a.badge-dark:focus {
    color: #ffffff !important;
}

a.badge-warning:hover,
a.badge-warning:focus,
a.badge-light:hover,
a.badge-light:focus {
    color: #101828 !important;
}

/* Global soft-badge accessibility */
.badge-soft-primary {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #93c5fd !important;
}

.badge-soft-secondary {
    background-color: #e5e7eb !important;
    color: #1f2937 !important;
    border: 1px solid #cbd5e1 !important;
}

.badge-soft-success {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #86efac !important;
}

/* Exact combo selector used in markup: class="badge badge-soft-success" */
.badge.badge-soft-success {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
    text-shadow: none !important;
}

.badge-soft-info {
    background-color: #dbeafe !important;
    color: #0c4a6e !important;
    border: 1px solid #7dd3fc !important;
}

.badge-soft-warning {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    border: 1px solid #fcd34d !important;
}

.badge-soft-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

.badge-soft-dark {
    background-color: #e5e7eb !important;
    color: #111827 !important;
    border: 1px solid #9ca3af !important;
}

.badge-soft-light,
.badge-soft-white {
    background-color: #f8fafc !important;
    color: #1f2937 !important;
    border: 1px solid #cbd5e1 !important;
}

html[data-theme="dark"] .badge-soft-primary {
    background-color: #1e3a8a !important;
    color: #dbeafe !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .badge-soft-secondary {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .badge-soft-success {
    background-color: #14532d !important;
    color: #dcfce7 !important;
    border-color: #22c55e !important;
}

html[data-theme="dark"] .badge.badge-soft-success {
    background-color: #14532d !important;
    color: #dcfce7 !important;
    border-color: #22c55e !important;
    text-shadow: none !important;
}

html[data-theme="dark"] .badge-soft-info {
    background-color: #164e63 !important;
    color: #e0f2fe !important;
    border-color: #22d3ee !important;
}

html[data-theme="dark"] .badge-soft-warning {
    background-color: #78350f !important;
    color: #fef3c7 !important;
    border-color: #f59e0b !important;
}

html[data-theme="dark"] .badge-soft-danger {
    background-color: #7f1d1d !important;
    color: #fee2e2 !important;
    border-color: #ef4444 !important;
}

html[data-theme="dark"] .badge-soft-dark {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

html[data-theme="dark"] .badge-soft-light,
html[data-theme="dark"] .badge-soft-white {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

html[data-theme="dark"] .badge-white,
html[data-theme="dark"] .badge.badge-white {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    text-shadow: none !important;
}

html[data-theme="dark"] .badge-light {
    background: #22324a;
    color: var(--dark-text);
}

html[data-theme="dark"] .badge {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .badge-primary {
    background: #3f7feb;
}

html[data-theme="dark"] .badge-secondary {
    background: #405776;
}

html[data-theme="dark"] .badge-success {
    background: #31b37e;
}

html[data-theme="dark"] .badge-info {
    background: #2b8eb0;
}

html[data-theme="dark"] .badge-warning {
    background: #b9831f;
}

html[data-theme="dark"] .badge-danger {
    background: #d95465;
}

html[data-theme="dark"] .alert {
    background: #182638 !important;
    background-color: #182638 !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .alert-success {
    background: rgba(53, 199, 138, 0.16) !important;
    background-color: rgba(53, 199, 138, 0.16) !important;
    border-color: rgba(53, 199, 138, 0.35) !important;
}

html[data-theme="dark"] .alert-danger {
    background: rgba(255, 111, 125, 0.16) !important;
    background-color: rgba(255, 111, 125, 0.16) !important;
    border-color: rgba(255, 111, 125, 0.35) !important;
}

html[data-theme="dark"] .alert-warning {
    background: rgba(255, 178, 63, 0.16) !important;
    background-color: rgba(255, 178, 63, 0.16) !important;
    border-color: rgba(255, 178, 63, 0.35) !important;
}

html[data-theme="dark"] .alert-info {
    background: rgba(41, 185, 231, 0.16) !important;
    background-color: rgba(41, 185, 231, 0.16) !important;
    border-color: rgba(41, 185, 231, 0.35) !important;
}

html[data-theme="dark"] .alert-primary,
html[data-theme="dark"] .alert-secondary,
html[data-theme="dark"] .alert-light,
html[data-theme="dark"] .alert-dark {
    background: #1b2a3e !important;
    background-color: #1b2a3e !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .alert-link,
html[data-theme="dark"] .alert-heading {
    color: #eaf1ff !important;
}

html[data-theme="dark"] .pagination .page-link {
    background: #16243a;
    border-color: var(--dark-border);
    color: #cfe0ff;
}

html[data-theme="dark"] .pagination .page-item.active .page-link {
    background: #3f7feb;
    border-color: #3f7feb;
    color: #fff;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_info,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
html[data-theme="dark"] .dataTables_wrapper .dataTables_processing {
    color: var(--dark-muted) !important;
}

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

html[data-theme="dark"] .dataTables_wrapper,
html[data-theme="dark"] .dataTables_wrapper .row,
html[data-theme="dark"] .dataTables_wrapper .col-sm-12,
html[data-theme="dark"] .dataTables_wrapper .col-md-6,
html[data-theme="dark"] .dataTables_wrapper .col-md-7,
html[data-theme="dark"] .dataTables_wrapper .col-md-5,
html[data-theme="dark"] .dataTables_wrapper .dataTables_scroll,
html[data-theme="dark"] .dataTables_wrapper .dataTables_scrollHead,
html[data-theme="dark"] .dataTables_wrapper .dataTables_scrollBody,
html[data-theme="dark"] .dataTables_wrapper .dataTables_scrollFoot {
    background: #141f2e !important;
    background-color: #141f2e !important;
}

html[data-theme="dark"] table.dataTable,
html[data-theme="dark"] table.dataTable.no-footer,
html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] table.dataTable thead td,
html[data-theme="dark"] table.dataTable tbody tr,
html[data-theme="dark"] table.dataTable tbody th,
html[data-theme="dark"] table.dataTable tbody td,
html[data-theme="dark"] table.dataTable tfoot th,
html[data-theme="dark"] table.dataTable tfoot td {
    background: #141f2e !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

html[data-theme="dark"] table.dataTable.display tbody tr.odd,
html[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
html[data-theme="dark"] table.dataTable.display tbody tr.even,
html[data-theme="dark"] table.dataTable.stripe tbody tr.even,
html[data-theme="dark"] table.dataTable.display tbody tr>.sorting_1,
html[data-theme="dark"] table.dataTable.display tbody tr>.sorting_2,
html[data-theme="dark"] table.dataTable.display tbody tr>.sorting_3,
html[data-theme="dark"] table.dataTable.order-column tbody tr>.sorting_1,
html[data-theme="dark"] table.dataTable.order-column tbody tr>.sorting_2,
html[data-theme="dark"] table.dataTable.order-column tbody tr>.sorting_3 {
    background: #172334 !important;
}

html[data-theme="dark"] table.dataTable.hover tbody tr:hover,
html[data-theme="dark"] table.dataTable.display tbody tr:hover,
html[data-theme="dark"] table.dataTable.display tbody tr:hover>.sorting_1,
html[data-theme="dark"] table.dataTable.display tbody tr:hover>.sorting_2,
html[data-theme="dark"] table.dataTable.display tbody tr:hover>.sorting_3 {
    background: #1d2c42 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #16243a !important;
    border-color: var(--dark-border) !important;
    color: #dce8ff !important;
}

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

html[data-theme="dark"] .dataTables_wrapper .dataTables_processing {
    background: linear-gradient(90deg, rgba(20, 31, 46, 0) 0%, rgba(20, 31, 46, 0.95) 25%, rgba(20, 31, 46, 0.95) 75%, rgba(20, 31, 46, 0) 100%) !important;
    color: #dce8ff !important;
}

html[data-theme="dark"] section.nav-tabs,
html[data-theme="dark"] .our-system,
html[data-theme="dark"] .our-system .row,
html[data-theme="dark"] .our-system .col-lg-12,
html[data-theme="dark"] .our-system .tab-content,
html[data-theme="dark"] .our-system .tab-content .tab-pane,
html[data-theme="dark"] #site-settings,
html[data-theme="dark"] #email-settings,
html[data-theme="dark"] #pusher-settings,
html[data-theme="dark"] #recaptcha-settings,
html[data-theme="dark"] #payment-settings,
html[data-theme="dark"] #custom-fields-settings {
    background: #141f2e !important;
    background-color: #141f2e !important;
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .our-system ul.nav.nav-tabs,
html[data-theme="dark"] ul.nav-tabs {
    background: #0f1b2b !important;
    border: 1px solid var(--dark-border) !important;
}

html[data-theme="dark"] .our-system .nav.nav-tabs li a,
html[data-theme="dark"] .nav.nav-tabs li a {
    color: #b9cbeb !important;
    background: transparent !important;
}

html[data-theme="dark"] .our-system .nav.nav-tabs li a:hover,
html[data-theme="dark"] .our-system .nav.nav-tabs li a.active,
html[data-theme="dark"] .nav.nav-tabs li a:hover,
html[data-theme="dark"] .nav.nav-tabs li a.active {
    background: #27496f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .logo-content,
html[data-theme="dark"] .setting-logo-box .logo-content,
html[data-theme="dark"] .card.setting-card,
html[data-theme="dark"] .card.setting-card.setting-logo-box {
    background: #182638 !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-theme="dark"] .select2-container--default .select2-results__option,
html[data-theme="dark"] .note-editor .note-editable,
html[data-theme="dark"] .note-editor .note-toolbar,
html[data-theme="dark"] .note-editor .note-statusbar {
    color: var(--dark-text) !important;
    background: #111c2b !important;
}

html[data-theme="dark"] .note-editor .note-toolbar,
html[data-theme="dark"] .note-editor .note-statusbar,
html[data-theme="dark"] .note-editor.note-frame,
html[data-theme="dark"] .note-editor.note-airframe {
    border-color: var(--dark-border) !important;
}

html[data-theme="dark"] .apexcharts-text,
html[data-theme="dark"] .apexcharts-legend-text,
html[data-theme="dark"] .apexcharts-xaxis text,
html[data-theme="dark"] .apexcharts-yaxis text {
    fill: #aebfdb !important;
}

html[data-theme="dark"] .apexcharts-gridline {
    stroke: #2a3a53 !important;
}

html[data-theme="dark"] .theme-toggle-wrapper,
html[data-theme="dark"] .theme-toggle {
    display: none !important;
}

/* Global responsive table behavior for all portals */
.table-responsive,
.table-responsive-auto {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > table,
.table-responsive-auto > table {
    width: 100%;
    min-width: max-content;
}

.table-responsive > table.table,
.table-responsive-auto > table.table,
.table-responsive > table.dataTable,
.table-responsive-auto > table.dataTable {
    white-space: nowrap;
}

table.dataTable {
    width: 100% !important;
}

@media (max-width: 767.98px) {
    .table-responsive,
    .table-responsive-auto {
        border: 0;
    }

    .table-responsive > table,
    .table-responsive-auto > table {
        font-size: 0.92rem;
    }
}