:root {
    --rs-theme-primary: #003366;
    --rs-theme-primary-strong: #08192f;
    --rs-theme-primary-soft: #2b4569;
    --rs-theme-text: #1a223e;
    --rs-theme-surface: #ffffff;
    --rs-theme-soft-surface: #f5f7fc;
    --rs-theme-border: #dde3ef;
    --rs-theme-body-bg-top: #eef1f7;
    --rs-theme-body-bg-bottom: #e7ebf3;
}

body {
    background: linear-gradient(180deg, var(--rs-theme-body-bg-top) 0%, var(--rs-theme-body-bg-bottom) 100%) !important;
    color: var(--rs-theme-text);
}

.container-fluid.mt-4 {
    background: transparent;
}

.view-container,
.card,
.modal-content,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--rs-theme-text);
}

.card,
.table,
.modal-content,
.form-control,
.form-select,
.input-group-text {
    border-color: var(--rs-theme-border);
}

.card,
.table,
.modal-content {
    box-shadow: 0 1px 3px rgba(22, 28, 45, 0.08);
}

.btn-primary,
.btn-search,
.btn-add,
.btn.btn-primary,
.modal-body .btn-primary {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border-color: var(--rs-theme-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-search:hover,
.btn-add:hover,
.btn.btn-primary:hover,
.modal-body .btn-primary:hover {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    border-color: var(--rs-theme-primary-strong) !important;
}

.btn-outline-primary {
    color: var(--rs-theme-primary) !important;
    border-color: var(--rs-theme-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--rs-theme-primary) !important;
    color: #fff !important;
}

/* Unify all bootstrap button variants to dashboard palette */
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-secondary,
.btn-dark,
.btn-light,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-light,
a.btn-success,
a.btn-danger,
a.btn-warning,
a.btn-info,
a.btn-secondary,
a.btn-dark,
a.btn-light,
button.btn-success,
button.btn-danger,
button.btn-warning,
button.btn-info,
button.btn-secondary,
button.btn-dark,
button.btn-light,
.edit-btn,
.delete-btn,
.view-remarks-btn,
.add-remarks-btn,
#add-agent-btn,
#add-branch-btn,
#add-clinic-btn,
#add-document-type-btn,
#add-training-center-btn,
#add-user-btn {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border-color: var(--rs-theme-primary) !important;
    color: #fff !important;
}

.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover,
.btn-secondary:hover,
.btn-dark:hover,
.btn-light:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.btn-outline-light:hover,
a.btn-success:hover,
a.btn-danger:hover,
a.btn-warning:hover,
a.btn-info:hover,
a.btn-secondary:hover,
a.btn-dark:hover,
a.btn-light:hover,
button.btn-success:hover,
button.btn-danger:hover,
button.btn-warning:hover,
button.btn-info:hover,
button.btn-secondary:hover,
button.btn-dark:hover,
button.btn-light:hover,
.edit-btn:hover,
.delete-btn:hover,
.view-remarks-btn:hover,
.add-remarks-btn:hover,
#add-agent-btn:hover,
#add-branch-btn:hover,
#add-clinic-btn:hover,
#add-document-type-btn:hover,
#add-training-center-btn:hover,
#add-user-btn:hover {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    border-color: var(--rs-theme-primary-strong) !important;
    color: #fff !important;
}

.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-light {
    background: #fff !important;
    color: var(--rs-theme-primary) !important;
    border-color: var(--rs-theme-primary) !important;
}

.btn-check:checked + .btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    border-color: var(--rs-theme-primary-strong) !important;
    color: #fff !important;
}

.table thead th,
.table-custom th,
.datagrid-header th,
[class*="table"] thead tr th {
    background-color: var(--rs-theme-primary) !important;
    color: #fff !important;
    border-color: var(--rs-theme-primary) !important;
}

.pagination .page-link,
.page-link {
    color: var(--rs-theme-primary) !important;
    border-color: var(--rs-theme-border) !important;
    background: #fff !important;
}

.pagination .page-item.active .page-link,
.page-link[aria-current="page"] {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    color: #fff !important;
    border-color: var(--rs-theme-primary) !important;
}

.navbar-nav .dropdown-menu {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
}

.navbar-nav .dropdown-menu .dropdown-item {
    color: #fff !important;
}

.navbar-nav .dropdown-menu .dropdown-item:hover,
.nav-links .nav-link:hover,
.nav-links .dropdown-toggle:hover,
.active-link,
.rs-navbar-theme .active-link {
    background-color: var(--rs-theme-primary-soft) !important;
    color: #fff !important;
}

.page-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--rs-theme-text);
}

.modal-header.bg-primary,
.bg-primary,
.badge.bg-primary {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border-color: var(--rs-theme-primary) !important;
}

/* Modal header unification: readable white text + navbar-like background */
.modal .modal-header,
.modal .modal-header.bg-primary,
.modal .modal-header.bg-success,
.modal .modal-header.bg-danger,
.modal .modal-header.bg-warning,
.modal .modal-header.bg-info,
.modal .modal-header.bg-secondary,
.modal .modal-header[class*="bg-"] {
    background: linear-gradient(90deg, #003366 0%, #08192f 100%) !important;
    border-bottom: 1px solid #08192f !important;
    color: #fff !important;
}

.modal .modal-header .modal-title,
.modal .modal-header h1,
.modal .modal-header h2,
.modal .modal-header h3,
.modal .modal-header h4,
.modal .modal-header h5,
.modal .modal-header h6,
.modal .modal-header .bi,
.modal .modal-header .fa,
.modal .modal-header .fas,
.modal .modal-header .far {
    color: #fff !important;
}

.modal .modal-header .btn-close,
.modal .modal-header .btn-close-white {
    filter: brightness(0) invert(1) !important;
    opacity: 0.95;
}

[style*="#4169E1"],
[style*="#003366"],
[style*="#A20000"],
[style*="#a20000"],
[style*="#c7423e"] {
    color: #fff;
}

[style*="background-color: #4169E1"],
[style*="background-color:#4169E1"],
[style*="background-color: #003366"],
[style*="background-color:#003366"],
[style*="background-color: #A20000"],
[style*="background-color:#A20000"],
[style*="background-color: #a20000"],
[style*="background-color:#a20000"],
[style*="background: #A20000"],
[style*="background:#A20000"] {
    background-color: var(--rs-theme-primary) !important;
}

[style*="border-color: #4169E1"],
[style*="border-color:#4169E1"],
[style*="border-color: #003366"],
[style*="border-color:#003366"],
[style*="border-color: #A20000"],
[style*="border-color:#A20000"] {
    border-color: var(--rs-theme-primary) !important;
}

button[style*="background-color: #dd4b39"],
button[style*="background-color:#dd4b39"],
button[style*="background-color: #e9950f"],
button[style*="background-color:#e9950f"],
button[style*="background-color: #00a65b"],
button[style*="background-color:#00a65b"],
a[style*="background-color: #dd4b39"],
a[style*="background-color:#dd4b39"],
a[style*="background-color: #e9950f"],
a[style*="background-color:#e9950f"],
a[style*="background-color: #00a65b"],
a[style*="background-color:#00a65b"] {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border-color: var(--rs-theme-primary) !important;
    color: #fff !important;
}

#fabQuickTask,
#fabGoToTask {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    color: #fff !important;
}

#fabQuickTask:hover,
#fabGoToTask:hover {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    color: #fff !important;
}

/* Applicant Overview custom controls */
.action-btn,
.medical-btn,
.btn.action-btn,
.medical-inline .btn-add-clinic,
#submitMedicalClinicBtn,
.save-btn,
.remark-icon {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border: 1px solid var(--rs-theme-primary) !important;
    color: #fff !important;
}

.action-btn:hover,
.medical-btn:hover,
.btn.action-btn:hover,
.medical-inline .btn-add-clinic:hover,
#submitMedicalClinicBtn:hover,
.save-btn:hover,
.remark-icon:hover {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    border-color: var(--rs-theme-primary-strong) !important;
    color: #fff !important;
    opacity: 1 !important;
}

.medical-btn-light,
.medical-inline .btn-add-clinic.medical-btn-light {
    background: var(--rs-theme-soft-surface) !important;
    color: var(--rs-theme-primary) !important;
    border: 1px solid var(--rs-theme-border) !important;
}

.medical-btn-light:hover,
.medical-inline .btn-add-clinic.medical-btn-light:hover {
    background: #e9edf8 !important;
    color: var(--rs-theme-primary-strong) !important;
    border-color: var(--rs-theme-primary) !important;
}

.remark-icon:nth-child(1),
.remark-icon:nth-child(2),
.remark-icon:nth-child(3),
.remark-icon:nth-child(4) {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
}

.tabs,
.case-subtabs {
    background: #003366 !important;
    border: 1px solid var(--rs-theme-primary-strong) !important;
    border-radius: 10px !important;
    padding: 0.4rem !important;
    gap: 0.35rem;
}

.tab,
.case-subtab,
.tabs .dropdown > a,
.tabs .dropdown > button,
.case-subtabs .dropdown > a,
.case-subtabs .dropdown > button {
    color: #fff !important;
    border-radius: 8px !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab:hover,
.case-subtab:hover,
.tabs .dropdown > a:hover,
.tabs .dropdown > button:hover,
.case-subtabs .dropdown > a:hover,
.case-subtabs .dropdown > button:hover,
.tab.active,
.case-subtab.active {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
}

.tabs .dropdown-menu,
.case-subtabs .dropdown-menu,
.action-menu {
    background: var(--rs-theme-surface) !important;
    border: 1px solid var(--rs-theme-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(22, 28, 45, 0.14) !important;
    overflow: hidden;
}

.tabs .dropdown-menu a,
.case-subtabs .dropdown-menu a,
.action-menu .action-item {
    color: var(--rs-theme-text) !important;
    background: var(--rs-theme-surface) !important;
    border-bottom: 1px solid #edf1f8 !important;
}

.tabs .dropdown-menu a:last-child,
.case-subtabs .dropdown-menu a:last-child,
.action-menu .action-item:last-child {
    border-bottom: 0 !important;
}

.tabs .dropdown-menu a:hover,
.case-subtabs .dropdown-menu a:hover,
.action-item:hover {
    background: var(--rs-theme-soft-surface) !important;
    color: var(--rs-theme-primary) !important;
}

.medical-modal-header,
.case-source-modal-header,
.case-nature-modal-header,
.modal-box > .modal-header {
    background: #003366 !important;
    color: #fff !important;
}

.medical-modal-header .modal-close,
.case-source-modal-header .modal-close,
.case-nature-modal-header .modal-close,
.modal-box > .modal-header .modal-close {
    color: #fff !important;
}

/* Applicant Overview partials root-folder buttons */
.btn-add-document,
.btn-add-medical,
.btn-add-training,
.btn-add-skill,
.btn-add-license,
.btn-add-education,
.case-btn-add,
.case-lookup-btn,
.processing-save-btn,
.processing-input-group-btn,
.save-bank-btn,
.btn-nav,
.remarks-history-btn,
.lineup-btn,
.lineup-btn-submit,
.lineup-btn-save-status,
.lineup-btn-close,
.case-mini-btn,
.btn-icon-edit,
.btn-icon-delete,
.btn-icon-edit-training,
.btn-icon-delete-training,
.btn-icon-edit-medical,
.btn-icon-delete-medical,
.btn-icon-edit-skill,
.btn-icon-delete-skill,
.btn-icon-edit-license,
.btn-icon-delete-license,
.btn-icon-edit-education,
.btn-icon-delete-education,
.btn-icon-edit-case,
.btn-icon-delete-case,
.lineup-modal button:not(.btn-close):not(.modal-close),
#cameraModal button,
#sendCVModal button:not(.modal-close),
#remarkModal button:not(.modal-close),
#viewLogsModal button:not(.modal-close),
#viewResumeModal button:not(.modal-close),
#agencyResumeModal button:not(.modal-close),
#agencyVersionResumeModal button:not(.modal-close),
#employerVersionResumeModal button:not(.modal-close),
#documentTypeModal button:not(.modal-close) {
    background: linear-gradient(180deg, var(--rs-theme-primary-soft) 0%, var(--rs-theme-primary) 100%) !important;
    border: 1px solid var(--rs-theme-primary) !important;
    color: #fff !important;
}

.btn-add-document:hover,
.btn-add-medical:hover,
.btn-add-training:hover,
.btn-add-skill:hover,
.btn-add-license:hover,
.btn-add-education:hover,
.case-btn-add:hover,
.case-lookup-btn:hover,
.processing-save-btn:hover,
.processing-input-group-btn:hover,
.save-bank-btn:hover,
.btn-nav:hover,
.remarks-history-btn:hover,
.lineup-btn:hover,
.lineup-btn-submit:hover,
.lineup-btn-save-status:hover,
.lineup-btn-close:hover,
.case-mini-btn:hover,
.btn-icon-edit:hover,
.btn-icon-delete:hover,
.btn-icon-edit-training:hover,
.btn-icon-delete-training:hover,
.btn-icon-edit-medical:hover,
.btn-icon-delete-medical:hover,
.btn-icon-edit-skill:hover,
.btn-icon-delete-skill:hover,
.btn-icon-edit-license:hover,
.btn-icon-delete-license:hover,
.btn-icon-edit-education:hover,
.btn-icon-delete-education:hover,
.btn-icon-edit-case:hover,
.btn-icon-delete-case:hover,
.lineup-modal button:not(.btn-close):not(.modal-close):hover,
#cameraModal button:hover,
#sendCVModal button:not(.modal-close):hover,
#remarkModal button:not(.modal-close):hover,
#viewLogsModal button:not(.modal-close):hover,
#viewResumeModal button:not(.modal-close):hover,
#agencyResumeModal button:not(.modal-close):hover,
#agencyVersionResumeModal button:not(.modal-close):hover,
#employerVersionResumeModal button:not(.modal-close):hover,
#documentTypeModal button:not(.modal-close):hover {
    background: linear-gradient(180deg, var(--rs-theme-primary) 0%, var(--rs-theme-primary-strong) 100%) !important;
    border-color: var(--rs-theme-primary-strong) !important;
    color: #fff !important;
}

.btn-nav.disabled,
.remarks-history-btn.disabled,
button:disabled.btn-nav,
button:disabled.remarks-history-btn,
.lineup-btn:disabled,
.processing-save-btn:disabled {
    background: #cfd7e8 !important;
    border-color: #cfd7e8 !important;
    color: #6b748d !important;
}
