/**
 * RESL MWorks design tokens — Phase 7a
 * Primary: #152068 | On-primary: #ffffff
 */

:root {
    --resl-primary: #152068;
    --resl-primary-light: #2d4a9a;
    --resl-primary-dark: #0f1630;
    --resl-accent: #3b5cc9;
    --resl-on-primary: #ffffff;

    --resl-bg: #f4f6fb;
    --resl-surface: #ffffff;
    --resl-surface-elevated: #ffffff;
    --resl-text: #1f2937;
    --resl-text-muted: #6b7280;
    --resl-border: #e5e7eb;
    --resl-link: #2563eb;
    --resl-link-hover: #1d4ed8;
    --resl-muted: #94a3b8;
    --resl-track: #e2e8f0;

    --resl-navbar-bg: #ffffff;
    --resl-sidebar-bg: #ffffff;
    --resl-footer-bg: #ffffff;

    --bs-primary: #152068;
    --bs-link-color: #2563eb;
}

html[data-theme="dark"] {
    --resl-bg: #0f1630;
    --resl-surface: #1a1f3a;
    --resl-surface-elevated: #232a4a;
    --resl-text: #e8ecf4;
    --resl-text-muted: #a8b0c4;
    --resl-border: #2d3558;
    --resl-link: #93c5fd;
    --resl-link-hover: #bfdbfe;
    --resl-muted: #7b8aa8;
    --resl-track: #2d3558;

    --resl-navbar-bg: #1a1f3a;
    --resl-sidebar-bg: #151a32;
    --resl-footer-bg: #151a32;

    --bs-primary: #2d4a9a;
    --bs-link-color: #93c5fd;
    --bs-link-hover-color: #bfdbfe;

    --resl-btn-primary-bg: #4a6ee0;
    --resl-btn-primary-border: #5b7eeb;
    --resl-btn-primary-hover: #6b8ef5;
    --resl-btn-success-bg: #22c55e;
    --resl-btn-success-border: #16a34a;
    --resl-btn-success-hover: #2dd36f;
    --resl-btn-success-text: #ffffff;
}

/* AdminLTE shells — undo global purple gradient body rule */
body.hold-transition,
body.sidebar-mini,
body.layout-fixed {
    background-color: var(--resl-bg) !important;
    color: var(--resl-text);
    padding: 0 !important;
    min-height: 100vh;
}

html[data-theme="dark"] body.hold-transition,
html[data-theme="dark"] body.sidebar-mini,
html[data-theme="dark"] body.layout-fixed {
    color-scheme: dark;
}

/* AdminLTE primary overrides */
.btn-primary,
.bg-primary,
.badge-primary,
.alert-primary,
.card-primary:not(.card-outline) > .card-header {
    background-color: var(--resl-primary) !important;
    border-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--resl-primary-light) !important;
    border-color: var(--resl-primary-light) !important;
}

.btn-outline-primary {
    color: var(--resl-primary) !important;
    border-color: var(--resl-primary) !important;
}

.text-primary {
    color: var(--resl-primary) !important;
}

html[data-theme="dark"] .text-primary,
html[data-theme="dark"] a:not(.btn):not(.nav-link.active):not(.resl-google-sign-in-btn):not(.resl-welcome-btn),
html[data-theme="dark"] .btn-link,
html[data-theme="dark"] .page-link:not(.active),
html[data-theme="dark"] .table a:not(.btn),
html[data-theme="dark"] .card a:not(.btn):not(.resl-google-sign-in-btn),
html[data-theme="dark"] a.text-dark,
html[data-theme="dark"] .text-dark a {
    color: var(--resl-link) !important;
}

html[data-theme="dark"] a:not(.btn):not(.nav-link.active):not(.resl-google-sign-in-btn):not(.resl-welcome-btn):hover,
html[data-theme="dark"] .btn-link:hover,
html[data-theme="dark"] .page-link:not(.active):hover,
html[data-theme="dark"] .table a:not(.btn):hover,
html[data-theme="dark"] .card a:not(.btn):not(.resl-google-sign-in-btn):hover {
    color: var(--resl-link-hover) !important;
}

html[data-theme="dark"] .nav-sidebar .nav-link:not(.active) {
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .nav-sidebar .nav-link:not(.active):hover,
html[data-theme="dark"] .nav-sidebar .nav-link.text-primary:not(.active) {
    color: var(--resl-link) !important;
}

html[data-theme="dark"] .nav-sidebar .nav-icon.text-primary:not(.text-white) {
    color: var(--resl-link) !important;
}

.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
}

.main-header.navbar,
.main-footer {
    background-color: var(--resl-navbar-bg) !important;
    border-color: var(--resl-border) !important;
}

.main-footer.resl-footer {
    padding: 0.3rem 0.75rem !important;
    margin: 0 !important;
    font-size: 0.75rem;
    line-height: 1.3;
    border-top: 1px solid var(--resl-border) !important;
}

.resl-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.15rem 0.75rem;
}

.resl-footer-copy,
.resl-footer-loaded {
    color: var(--resl-text-muted);
}

.resl-footer-copy a {
    color: var(--resl-link);
    font-weight: 600;
    text-decoration: none;
}

.resl-footer-copy a:hover {
    color: var(--resl-link-hover);
    text-decoration: underline;
}

.resl-footer-rights {
    font-weight: 400;
}

.resl-footer-loaded {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.main-sidebar,
.main-sidebar .brand-link {
    background-color: var(--resl-sidebar-bg) !important;
}

html[data-theme="dark"] .main-header.navbar,
html[data-theme="dark"] .main-header .nav-link,
html[data-theme="dark"] .main-footer {
    background-color: var(--resl-footer-bg) !important;
    color: var(--resl-text-muted);
    border-top-color: var(--resl-border) !important;
}

html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .card,
html[data-theme="dark"] .table {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text);
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-content {
    background-color: var(--resl-surface-elevated) !important;
    color: var(--resl-text);
    border-color: var(--resl-border);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select {
    background-color: var(--resl-surface-elevated);
    color: var(--resl-text);
    border-color: var(--resl-border);
}

/* RESL utility classes (used across blades) */
.resl-bg-primary {
    background-color: var(--resl-primary) !important;
}

.resl-bg-primary-light {
    background-color: var(--resl-primary-light) !important;
}

.resl-bg-accent {
    background-color: var(--resl-accent) !important;
}

.resl-text-white {
    color: var(--resl-on-primary) !important;
}

/* Dark mode toggle */
.resl-theme-toggle {
    border: 1px solid var(--resl-border);
    background: var(--resl-surface);
    color: var(--resl-text);
    border-radius: 0.375rem;
    padding: 0.35rem 0.65rem;
    line-height: 1;
    cursor: pointer;
}

.resl-theme-toggle:hover {
    background: var(--resl-track);
}

html[data-theme="dark"] .resl-theme-toggle,
html[data-resl-theme="dark"] .resl-theme-toggle {
    color: var(--resl-text) !important;
    background: var(--resl-surface-elevated) !important;
    border-color: var(--resl-border) !important;
}

html[data-theme="dark"] .resl-theme-toggle:hover,
html[data-resl-theme="dark"] .resl-theme-toggle:hover {
    background: var(--resl-track) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .resl-theme-toggle .fa-sun,
html[data-resl-theme="dark"] .resl-theme-toggle .fa-sun {
    display: inline;
    color: #fbbf24;
}

html[data-theme="dark"] .resl-theme-toggle .fa-moon,
html[data-resl-theme="dark"] .resl-theme-toggle .fa-moon {
    display: none;
}

html:not([data-theme="dark"]) .resl-theme-toggle .fa-sun,
html[data-resl-theme="light"] .resl-theme-toggle .fa-sun {
    display: none;
}

html:not([data-theme="dark"]) .resl-theme-toggle .fa-moon,
html[data-resl-theme="light"] .resl-theme-toggle .fa-moon {
    display: inline;
    color: var(--resl-text-muted);
}

/* Guest / login shell */
body.resl-guest-layout {
    background-color: var(--resl-bg) !important;
    color: var(--resl-text);
    min-height: 100vh;
}

body.resl-guest-layout .resl-guest-navbar {
    background-color: var(--resl-navbar-bg) !important;
    border-bottom: 1px solid var(--resl-border);
}

body.resl-guest-layout .resl-guest-navbar .navbar-brand {
    color: var(--resl-text);
    font-weight: 600;
}

body.resl-guest-layout .resl-guest-navbar .navbar-brand:hover,
body.resl-guest-layout .resl-guest-navbar .navbar-brand:focus {
    color: var(--resl-link);
}

body.resl-guest-layout .resl-guest-navbar .nav-link {
    color: var(--resl-link);
    font-weight: 500;
}

body.resl-guest-layout .resl-guest-navbar .nav-link:hover,
body.resl-guest-layout .resl-guest-navbar .nav-link:focus {
    color: var(--resl-link-hover);
}

html[data-theme="dark"] body.resl-guest-layout .resl-guest-navbar .navbar-toggler,
html[data-resl-theme="dark"] body.resl-guest-layout .resl-guest-navbar .navbar-toggler {
    border-color: var(--resl-border);
    color: var(--resl-text);
}

html[data-theme="dark"] body.resl-guest-layout .resl-guest-navbar .navbar-toggler-icon,
html[data-resl-theme="dark"] body.resl-guest-layout .resl-guest-navbar .navbar-toggler-icon {
    filter: invert(1) brightness(1.1);
}

html[data-theme="dark"] body.resl-guest-layout .card,
html[data-theme="dark"] body.resl-guest-layout .navbar {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text);
}

html[data-theme="dark"] body.resl-guest-layout a:not(.btn):not(.resl-google-sign-in-btn) {
    color: var(--resl-link) !important;
}

html[data-theme="dark"] body.resl-guest-layout a:not(.btn):not(.resl-google-sign-in-btn):hover {
    color: var(--resl-link-hover) !important;
}

/* --------------------------------------------------------------------------
   AdminLTE content shell
   -------------------------------------------------------------------------- */
.content-wrapper {
    background-color: var(--resl-bg) !important;
}

.content {
    color: var(--resl-text);
}

.content-header {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
}

html[data-theme="dark"] .content-header {
    border-bottom: 1px solid var(--resl-border);
}

/* --------------------------------------------------------------------------
   Cards & panels
   -------------------------------------------------------------------------- */
.card {
    border-color: var(--resl-border);
    box-shadow: 0 1px 2px rgba(15, 22, 48, 0.06);
    background-color: var(--resl-surface);
    color: var(--resl-text);
}

.card.bg-light {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text);
}

.resl-panel {
    background-color: var(--resl-surface) !important;
    border: 1px solid var(--resl-border);
    border-radius: 0.5rem;
}

.resl-section-title {
    background-color: var(--resl-primary);
    color: var(--resl-on-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin: 0.5rem 0 0.75rem;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

html[data-theme="dark"] .resl-section-title {
    background-color: var(--resl-surface-elevated);
    border: 1px solid var(--resl-border);
    color: var(--resl-text);
}

.resl-page-heading {
    color: var(--resl-text);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.resl-filter-actions {
    padding-top: 0.25rem;
    border-top: 1px solid var(--resl-border);
}

.resl-filter-form {
    font-size: 0.875rem;
}

.resl-filter-form .form-control-sm {
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Bootstrap utility harmonization
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .card.bg-light,
html[data-theme="dark"] .modal-body.bg-light,
html[data-theme="dark"] fieldset legend.bg-light {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text);
}

html[data-theme="dark"] .bg-gradient-light,
html[data-theme="dark"] .bg-gradient-secondary {
    background: var(--resl-surface) !important;
    background-image: none !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .bg-secondary {
    background-color: var(--resl-track) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .mtn-dashboard h3,
html[data-theme="dark"] .mtn-dashboard h5 {
    color: var(--resl-text);
}

html[data-theme="dark"] .Zebra_DatePicker {
    background: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
    border-color: var(--resl-border) !important;
}

html[data-theme="dark"] .Zebra_DatePicker .dp_header,
html[data-theme="dark"] .Zebra_DatePicker .dp_footer {
    background: var(--resl-surface) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .Zebra_DatePicker td,
html[data-theme="dark"] .Zebra_DatePicker th {
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .Zebra_DatePicker td.dp_not_in_month {
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .Zebra_DatePicker td.dp_selected {
    background: var(--resl-primary-light) !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .form-control.bg-white,
html[data-theme="dark"] input.bg-white {
    background-color: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .bg-dark,
html[data-theme="dark"] .bg-gradient-dark {
    background-color: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
    border: 1px solid var(--resl-border);
}

html[data-theme="dark"] .border-dark,
html[data-theme="dark"] .border-light {
    border-color: var(--resl-border) !important;
}

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

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

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
label,
.form-label,
.resl-label-1,
.form-group label,
.form-check-label,
legend,
.col-form-label {
    color: var(--resl-text-muted) !important;
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.form-group label i,
.resl-label-1 i {
    color: var(--resl-primary-light);
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .resl-label-1,
html[data-theme="dark"] .form-check-label,
html[data-theme="dark"] legend,
html[data-theme="dark"] .col-form-label {
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .form-group label i,
html[data-theme="dark"] .resl-label-1 i {
    color: var(--resl-link) !important;
}

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

.form-control,
.custom-select,
select.form-control,
select:not([multiple]):not(.select2-hidden-accessible) {
    background-color: var(--resl-surface);
    color: var(--resl-text);
    border-color: var(--resl-border);
    border-radius: 0.375rem;
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    line-height: 1.5 !important;
    font-size: 0.9375rem;
}

.form-control-sm,
select.form-control-sm {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8125rem;
    line-height: 1.5 !important;
}

html[data-theme="dark"] select option {
    background-color: var(--resl-surface-elevated);
    color: var(--resl-text);
}

.form-control:focus,
.custom-select:focus,
select.form-control:focus {
    background-color: var(--resl-surface);
    color: var(--resl-text);
    border-color: var(--resl-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(21, 32, 104, 0.12);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select,
html[data-theme="dark"] select.form-control {
    background-color: var(--resl-surface-elevated);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .custom-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 74, 154, 0.3);
}

textarea.form-control {
    height: auto !important;
    min-height: 2.5rem;
}

/* --------------------------------------------------------------------------
   Navigation & breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--resl-text-muted);
    font-size: 0.8125rem;
}

.breadcrumb-item.active {
    color: var(--resl-text);
}

html[data-theme="dark"] .main-header.navbar.navbar-white,
html[data-theme="dark"] .main-header.navbar.navbar-light {
    background-color: var(--resl-navbar-bg) !important;
}

html[data-theme="dark"] .main-header .nav-link {
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .main-header .nav-link:hover {
    color: var(--resl-link) !important;
}

html[data-theme="dark"] .brand-link,
html[data-theme="dark"] .nav-sidebar .nav-link p,
html[data-theme="dark"] .nav-sidebar .nav-header {
    color: var(--resl-text) !important;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    border-radius: 0.375rem;
    font-weight: 600;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.35rem 0.7rem;
    line-height: 1.25;
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(21, 32, 104, 0.18);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    box-shadow: 0 2px 4px rgba(21, 32, 104, 0.22);
}

.btn-success {
    background-color: #2d7a4f;
    border-color: #2d7a4f;
    box-shadow: 0 1px 2px rgba(45, 122, 79, 0.2);
}

.btn-success:hover,
.btn-success:focus {
    background-color: #3a9460;
    border-color: #3a9460;
}

html[data-theme="dark"] .btn-primary {
    background-color: var(--resl-btn-primary-bg) !important;
    border-color: var(--resl-btn-primary-border) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus,
html[data-theme="dark"] .btn-primary:active {
    background-color: var(--resl-btn-primary-hover) !important;
    border-color: var(--resl-btn-primary-hover) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-primary {
    color: #bfdbfe !important;
    border-color: var(--resl-btn-primary-border) !important;
    background-color: rgba(74, 110, 224, 0.14) !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus {
    background-color: var(--resl-btn-primary-bg) !important;
    border-color: var(--resl-btn-primary-border) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-success {
    background-color: var(--resl-btn-success-bg) !important;
    border-color: var(--resl-btn-success-border) !important;
    color: var(--resl-btn-success-text) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .btn-success:hover,
html[data-theme="dark"] .btn-success:focus {
    background-color: var(--resl-btn-success-hover) !important;
    border-color: var(--resl-btn-success-hover) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-secondary {
    background-color: var(--resl-surface-elevated);
    border-color: var(--resl-border);
    color: var(--resl-text);
}

html[data-theme="dark"] .btn-outline-secondary {
    color: var(--resl-text) !important;
    border-color: var(--resl-border) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus {
    background-color: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
    border-color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .btn-info {
    background-color: #0ea5e9 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-info:hover,
html[data-theme="dark"] .btn-info:focus {
    background-color: #38bdf8 !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
}

/* Horizontal action buttons inside tables (inner wrapper only — not on <td>) */
.resl-table-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
    max-width: 100%;
}

.resl-table-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.table th.resl-table-actions-col,
.table td.resl-table-actions-cell {
    display: table-cell !important;
    width: 1%;
    white-space: nowrap;
    text-align: right !important;
    vertical-align: middle !important;
}

/* --------------------------------------------------------------------------
   Tables & DataTables
   -------------------------------------------------------------------------- */
.table {
    color: var(--resl-text) !important;
}

.table thead th,
.table tfoot th,
.table tbody th,
.table td,
.table th {
    color: var(--resl-text) !important;
    border-color: var(--resl-border);
    vertical-align: middle;
}

.table thead th,
.table tfoot th {
    background-color: var(--resl-track) !important;
    background-image: none !important;
    font-weight: 600;
    font-size: 0.75rem;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table tbody th,
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table tfoot th {
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table tfoot th,
html[data-theme="dark"] .table tbody th {
    background-color: var(--resl-surface-elevated) !important;
    background-image: none !important;
}

html[data-theme="dark"] .job-details-table,
html[data-theme="dark"] .job-details-table td {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .job-details-table th {
    background: var(--resl-primary) !important;
    background-image: none !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .card-text,
html[data-theme="dark"] .lead,
html[data-theme="dark"] .content-wrapper .text-secondary {
    color: var(--resl-text);
}

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

.table-hover tbody tr:hover {
    background-color: rgba(21, 32, 104, 0.04);
}

html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover > td,
html[data-theme="dark"] .table-hover tbody tr:hover > th {
    background-color: rgba(45, 74, 154, 0.18) !important;
    color: var(--resl-text) !important;
}

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

html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: var(--resl-surface-elevated);
    color: var(--resl-text);
    border-color: var(--resl-border);
}

html[data-theme="dark"] .page-item .page-link {
    background-color: var(--resl-surface);
    border-color: var(--resl-border);
    color: var(--resl-link);
}

html[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--resl-primary);
    border-color: var(--resl-primary);
    color: var(--resl-on-primary);
}

/* Job status row colours — dark-mode friendly */
html[data-theme="dark"] .default_job_tbl_row {
    background-color: var(--resl-surface-elevated) !important;
}

html[data-theme="dark"] .default_job_tbl_row > td {
    color: var(--resl-text) !important;
}

/* --------------------------------------------------------------------------
   Select2 — replaces legacy resl_extra 35px height hack
   -------------------------------------------------------------------------- */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single,
.select2-container .select2-selection--single {
    border-color: var(--resl-border);
    border-radius: 0.375rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    height: auto !important;
    display: flex;
    align-items: center;
    padding: 0;
}

.select2-container--default .select2-selection--multiple,
.select2-container .select2-selection--multiple {
    border-color: var(--resl-border);
    border-radius: 0.375rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.125rem 0.25rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
    margin-top: 0 !important;
    color: var(--resl-text);
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0.5rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0.125rem 0.375rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    line-height: 1.4 !important;
    margin-top: 0.2rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--resl-primary-light) !important;
    color: var(--resl-on-primary) !important;
    border: 1px solid var(--resl-primary) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--resl-on-primary) !important;
    margin-right: 0.35rem;
    opacity: 0.85;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
    opacity: 1;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: var(--resl-surface-elevated);
    border-color: var(--resl-border);
}

html[data-theme="dark"] .select2-container--default .select2-selection__rendered {
    color: var(--resl-text);
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    border-color: var(--resl-primary-light) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .select2-dropdown {
    background-color: var(--resl-surface-elevated);
    border-color: var(--resl-border);
}

html[data-theme="dark"] .select2-container--default .select2-results__option {
    color: var(--resl-text);
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected='true'] {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected='true']:hover,
html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected='true'].select2-results__option--highlighted {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-disabled='true'] {
    background-color: transparent !important;
    color: var(--resl-text-muted) !important;
    opacity: 0.7;
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected='true']:not([aria-disabled='true']) {
    background-color: var(--resl-primary-light) !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] select option:disabled,
html[data-theme="dark"] select option[disabled] {
    color: var(--resl-text-muted);
    background-color: var(--resl-surface-elevated);
}

html[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--resl-surface);
    color: var(--resl-text);
    border-color: var(--resl-border);
}

/* --------------------------------------------------------------------------
   Modals & misc
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .close,
html[data-theme="dark"] .close span {
    color: var(--resl-text);
    text-shadow: none;
    opacity: 0.8;
}

html[data-theme="dark"] .modal-footer {
    border-top-color: var(--resl-border);
}

/* SweetAlert (sweetalert.min.js — .swal-modal) — theme tokens for light and dark */
.swal-overlay {
    background-color: rgba(15, 22, 48, 0.45) !important;
}

html[data-theme="dark"] .swal-overlay {
    background-color: rgba(0, 0, 0, 0.65) !important;
}

.swal-modal {
    background-color: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
    border: 1px solid var(--resl-border) !important;
    box-shadow: 0 12px 40px rgba(15, 22, 48, 0.2) !important;
}

html[data-theme="dark"] .swal-modal {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45) !important;
}

.swal-title {
    color: var(--resl-text) !important;
}

.swal-text {
    color: var(--resl-text-muted) !important;
}

.swal-footer {
    border-top: 1px solid var(--resl-border) !important;
    background-color: transparent !important;
}

.swal-button {
    box-shadow: none !important;
}

.swal-button:not(.swal-button--cancel):not(.swal-button--danger) {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
}

.swal-button:not(.swal-button--cancel):not(.swal-button--danger):hover {
    background-color: var(--resl-primary-light) !important;
}

html[data-theme="dark"] .swal-button:not(.swal-button--cancel):not(.swal-button--danger) {
    background-color: var(--resl-btn-primary-bg, var(--resl-primary-light)) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .swal-button:not(.swal-button--cancel):not(.swal-button--danger):hover {
    background-color: var(--resl-btn-primary-hover, var(--resl-primary-light)) !important;
}

.swal-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px var(--resl-surface-elevated), 0 0 0 4px rgba(45, 74, 154, 0.35) !important;
}

html[data-theme="dark"] .swal-button:focus {
    box-shadow: 0 0 0 2px var(--resl-surface-elevated), 0 0 0 4px rgba(74, 110, 224, 0.45) !important;
}

.swal-button--cancel {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text) !important;
    border: 1px solid var(--resl-border) !important;
}

.swal-button--cancel:hover {
    background-color: var(--resl-track) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .swal-button--cancel:hover {
    background-color: var(--resl-border) !important;
}

.swal-button--danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

.swal-button--danger:hover {
    background-color: #b91c1c !important;
}

.swal-button[disabled] {
    opacity: 0.55 !important;
}

.swal-content__input,
.swal-content__textarea {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text) !important;
    border: 1px solid var(--resl-border) !important;
}

.swal-content__input:focus,
.swal-content__textarea:focus {
    border-color: var(--resl-primary-light) !important;
    outline: none !important;
}

/* Status icons — vendor defaults assume a white modal background */
html[data-theme="dark"] .swal-icon--success:after,
html[data-theme="dark"] .swal-icon--success:before,
html[data-theme="dark"] .swal-icon--success__hide-corners {
    background: var(--resl-surface-elevated) !important;
}

html[data-theme="dark"] .swal-icon--success__line {
    background-color: #4ade80 !important;
}

html[data-theme="dark"] .swal-icon--success__ring {
    border-color: rgba(74, 222, 128, 0.28) !important;
}

html[data-theme="dark"] .swal-icon--error__line {
    background-color: #f87171 !important;
}

html[data-theme="dark"] .swal-icon--error {
    border-color: #f87171 !important;
}

html[data-theme="dark"] .swal-icon--warning__body,
html[data-theme="dark"] .swal-icon--warning__dot {
    background-color: #fbbf24 !important;
}

html[data-theme="dark"] .swal-icon--warning {
    border-color: #f59e0b !important;
}

html[data-theme="dark"] .swal-icon--info:before,
html[data-theme="dark"] .swal-icon--info:after {
    background-color: #93c5fd !important;
}

html[data-theme="dark"] .swal-icon--info {
    border-color: #60a5fa !important;
}

.swal-button__loader div {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

html[data-theme="dark"] .swal-button--cancel .swal-button__loader div {
    background-color: rgba(232, 236, 244, 0.75) !important;
}

html[data-theme="dark"] hr.bg-light {
    background-color: var(--resl-border) !important;
    opacity: 1;
}

html[data-theme="dark"] fieldset {
    border-color: var(--resl-border) !important;
}

/* Date/time picker (xdsoft) */
html[data-theme="dark"] .xdsoft_datetimepicker {
    background: var(--resl-surface-elevated) !important;
    border-color: var(--resl-border) !important;
    color: var(--resl-text) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label span {
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
    background: var(--resl-surface-elevated) !important;
    border-color: var(--resl-border) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
    color: var(--resl-text) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover,
html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
    background: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar th {
    background: var(--resl-surface-elevated) !important;
    color: var(--resl-text-muted) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar td,
html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar th,
html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div {
    background: var(--resl-surface) !important;
    color: var(--resl-text) !important;
    border-color: var(--resl-border) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month {
    color: var(--resl-text-muted) !important;
    opacity: 0.65;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
    color: var(--resl-link) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div.xdsoft_current {
    background: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_calendar td:hover,
html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div:hover {
    background: var(--resl-primary-light) !important;
    color: var(--resl-on-primary) !important;
}

html[data-theme="dark"] .xdsoft_datetimepicker .xdsoft_time_box {
    border-color: var(--resl-border) !important;
}

/* Bhumlu-lite v2 layout hooks */
html[data-theme="dark"] .layout-wrapper,
html[data-theme="dark"] .layout-content {
    background-color: var(--resl-bg);
    color: var(--resl-text);
}

html[data-theme="dark"] .layout-navbar.bg-white {
    background-color: var(--resl-navbar-bg) !important;
    border-bottom: 1px solid var(--resl-border);
}

html[data-theme="dark"] .layout-sidenav {
    background-color: var(--resl-sidebar-bg) !important;
}

/* --------------------------------------------------------------------------
   Legacy form / job pages (purple-gradient shells duplicated across blades)
   -------------------------------------------------------------------------- */
body.hold-transition.sidebar-mini.layout-fixed {
    background-color: var(--resl-bg) !important;
    background-image: none !important;
    padding: 0 !important;
}

.resl-gradient-bg,
.export-page-wrapper {
    background: var(--resl-bg) !important;
    background-image: none !important;
    min-height: auto;
    padding: 0 !important;
}

.main-card,
.main-container,
.resl-card,
.table-container,
.job-details-card,
.alert-card,
.error-card,
.export-card {
    background-color: var(--resl-surface) !important;
    color: var(--resl-text);
    border: 1px solid var(--resl-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 22, 48, 0.08);
}

.page-header,
.nav-buttons,
.resl-card-header,
.export-card .card-header {
    background: var(--resl-primary) !important;
    background-image: none !important;
    color: var(--resl-on-primary) !important;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: none;
}

.page-header h2,
.page-header h3,
.page-header h4,
.resl-card-header h2,
.resl-card-header h4 {
    color: var(--resl-on-primary) !important;
}

.export-heading-card {
    background: var(--resl-surface-elevated) !important;
    border: 1px solid var(--resl-border) !important;
    color: var(--resl-text) !important;
    backdrop-filter: none;
}

.form-section,
.action-bar,
.job-details-header,
.resl-card-footer {
    background-color: var(--resl-track) !important;
    color: var(--resl-text);
    border-left: 4px solid var(--resl-primary);
    border-radius: 0.375rem;
}

html[data-theme="dark"] .form-section,
html[data-theme="dark"] .action-bar,
html[data-theme="dark"] .job-details-header,
html[data-theme="dark"] .resl-card-footer {
    background-color: var(--resl-surface-elevated) !important;
}

.form-section .resl-label-1,
.main-card .resl-label-1,
.resl-card .resl-label-1 {
    color: var(--resl-text);
    font-weight: 600;
}

.form-section .resl-label-1 i,
.main-card .resl-label-1 i,
.resl-card .resl-label-1 i {
    color: var(--resl-primary-light);
}

html[data-theme="dark"] .form-section .resl-label-1 i,
html[data-theme="dark"] .main-card .resl-label-1 i {
    color: var(--resl-link);
}

.section-divider {
    border: none;
    height: 1px;
    background: var(--resl-border);
    margin: 1.5rem 0;
}

.error-card .card-header {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-bottom: 1px solid var(--resl-border);
    color: #dc2626 !important;
}

html[data-theme="dark"] .error-card .card-header {
    color: #fca5a5 !important;
}

.alert-card.success {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border-left-color: #10b981;
}

.main-card .btn-primary,
.form-section .btn-primary,
.resl-card .btn-primary,
.resl-btn-view {
    background: var(--resl-primary) !important;
    background-image: none !important;
    border-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    transform: none;
    box-shadow: none;
}

.main-card .btn-primary:hover,
.form-section .btn-primary:hover,
.resl-card .btn-primary:hover,
.resl-btn-view:hover {
    background: var(--resl-primary-light) !important;
    border-color: var(--resl-primary-light) !important;
    transform: none;
}

html[data-theme="dark"] .main-card .btn-primary,
html[data-theme="dark"] .form-section .btn-primary,
html[data-theme="dark"] .resl-card .btn-primary,
html[data-theme="dark"] .resl-panel .btn-primary,
html[data-theme="dark"] .resl-btn-view {
    background: var(--resl-btn-primary-bg) !important;
    border-color: var(--resl-btn-primary-border) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .main-card .btn-primary:hover,
html[data-theme="dark"] .form-section .btn-primary:hover,
html[data-theme="dark"] .resl-card .btn-primary:hover,
html[data-theme="dark"] .resl-panel .btn-primary:hover,
html[data-theme="dark"] .resl-btn-view:hover {
    background: var(--resl-btn-primary-hover) !important;
    border-color: var(--resl-btn-primary-hover) !important;
}

html[data-theme="dark"] .main-card .btn-success,
html[data-theme="dark"] .form-section .btn-success,
html[data-theme="dark"] .resl-card .btn-success,
html[data-theme="dark"] .resl-panel .btn-success,
html[data-theme="dark"] .action-bar .btn-success,
html[data-theme="dark"] .job-submit-actions .btn-success {
    background: var(--resl-btn-success-bg) !important;
    border-color: var(--resl-btn-success-border) !important;
    color: #ffffff !important;
}

.main-card .btn-danger,
.form-section .btn-danger {
    background-image: none !important;
    transform: none;
}

.main-card .btn-success,
.action-bar .btn-success {
    background-image: none !important;
    transform: none;
}

/* Tables inside legacy job cards */
.main-card .table thead th,
.table-container .table thead th,
.resl-card .table thead th,
#assigned_job_table thead {
    background: var(--resl-track) !important;
    background-image: none !important;
    color: var(--resl-text) !important;
    border-bottom: 2px solid var(--resl-primary) !important;
}

html[data-theme="dark"] .main-card .table thead th,
html[data-theme="dark"] #assigned_job_table thead,
html[data-theme="dark"] #assigned_job_table thead th {
    background: var(--resl-surface-elevated) !important;
    color: var(--resl-text) !important;
}

.main-card .table thead th i,
.table-container .table thead th i {
    color: var(--resl-primary-light);
}

html[data-theme="dark"] .main-card .table tbody tr:hover,
html[data-theme="dark"] #assigned_job_table tbody tr:hover {
    background: rgba(45, 74, 154, 0.12) !important;
    transform: none;
}

#assigned_job_table tbody tr {
    background: var(--resl-surface) !important;
}

#assigned_job_table tfoot {
    background: var(--resl-track) !important;
}

#assigned_job_table tfoot th {
    color: var(--resl-text) !important;
}

.export-tabs .nav-link {
    color: var(--resl-primary);
    background: var(--resl-surface);
    border-color: var(--resl-border);
}

.export-tabs .nav-link.active {
    background: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    border-color: var(--resl-primary) !important;
}

/* Select2 inside legacy form pages */
.form-section .select2-container--default .select2-selection--single,
.form-section .select2-container--default .select2-selection--multiple,
.main-card .select2-container--default .select2-selection--single,
.main-card .select2-container--default .select2-selection--multiple {
    border-color: var(--resl-border);
    border-radius: 0.375rem;
}

.form-section .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--resl-primary-light) !important;
    color: var(--resl-on-primary) !important;
    border-color: var(--resl-primary) !important;
}

html[data-theme="dark"] .form-section .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-theme="dark"] .main-card .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--resl-primary) !important;
    color: var(--resl-on-primary) !important;
    border-color: var(--resl-primary-light) !important;
}

