/**
 * Global Theme CSS - workPro
 * Accessible, high-contrast dark & light theme
 * WCAG-friendly color system
 */

/* ============================================
   ROOT THEME VARIABLES (DARK MODE DEFAULT)
   ============================================ */
:root {
    --theme-bg: #0d1117;
    --theme-surface: #161b22;
    --theme-surface-alt: #1f2630;

    --theme-text: #f0f3f6;
    --theme-text-muted: #9aa4af;

    --theme-accent: #38bdf8;
    --theme-accent-contrast: #06283a;

    --theme-border: #30363d;
    --theme-focus: rgba(56, 189, 248, 0.35);
}

/* ============================================
   LIGHT MODE (PHP / DATA ATTRIBUTE)
   ============================================ */
[data-theme="light"] {
    --theme-bg: #f8fafc;
    --theme-surface: #ffffff;
    --theme-surface-alt: #e8ecf1;

    --theme-text: #1a202c;
    --theme-text-muted: #64748b;

    --theme-accent: #0284c7;
    --theme-accent-contrast: #ffffff;

    --theme-border: #cbd5e1;
    --theme-focus: rgba(2, 132, 199, 0.35);
}

/* ============================================
   BODY & MAIN CONTAINER
   ============================================ */
html,
body,
main {
    background-color: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

/* ============================================
   MAIN CONTENT - SIDEBAR RESPONSIVE
   ============================================ */
main {
    margin-left: 12%;
    width: 88%;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Main content when sidebar is collapsed (auto-hide mode) */
main.sidebar-collapsed {
    margin-left: 60px;
    width: calc(100% - 60px);
}

/* Mobile responsive - full width */
@media (max-width: 768px) {
    main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    main.sidebar-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
    background-color: var(--theme-surface) !important;
    border-bottom: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .navbar,
[data-theme="light"] .navbar.bg-dark,
[data-theme="light"] .navbar.navbar-dark {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.navbar.bg-dark {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.navbar.navbar-dark {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.navbar-dark .navbar-brand {
    color: var(--theme-accent) !important;
}

[data-theme="light"] .navbar-dark .navbar-brand {
    color: #0284c7 !important;
}

.navbar-brand {
    color: var(--theme-accent) !important;
}

.navbar .nav-link,
.navbar-dark .nav-link {
    color: var(--theme-text) !important;
}

[data-theme="light"] .navbar .nav-link,
[data-theme="light"] .navbar-dark .nav-link {
    color: #1a202c !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active,
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: var(--theme-accent) !important;
    border-bottom: 3px solid var(--theme-accent) !important;
}

[data-theme="light"] .navbar .nav-link:hover,
[data-theme="light"] .navbar .nav-link.active,
[data-theme="light"] .navbar-dark .nav-link:hover,
[data-theme="light"] .navbar-dark .nav-link.active {
    color: #0284c7 !important;
    border-bottom: 3px solid #0284c7 !important;
}

.dropdown-menu {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

.dropdown-menu-dark {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

.dropdown-item {
    color: var(--theme-text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-accent) !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
}

.dropdown-divider {
    border-color: var(--theme-border) !important;
}

.dropdown-header {
    color: var(--theme-text) !important;
}

/* ============================================
   BOOTSTRAP UTILITY CLASS OVERRIDES
   ============================================ */
/* Override Bootstrap's bg-dark to use theme variables */
.bg-dark {
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] .bg-dark {
    background-color: #ffffff !important;
}

/* Override Bootstrap's text utilities */
.text-light {
    color: var(--theme-text) !important;
}

[data-theme="light"] .text-light {
    color: #1a202c !important;
}

.text-dark {
    color: var(--theme-text) !important;
}

[data-theme="light"] .text-dark {
    color: #1a202c !important;
}

.text-secondary {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] .text-secondary {
    color: #64748b !important;
}

.border-secondary {
    border-color: var(--theme-border) !important;
}

[data-theme="light"] .border-secondary {
    border-color: #cbd5e1 !important;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    background-color: var(--theme-surface) !important;
    border-right: 1px solid var(--theme-border) !important;
}

.sidebar .nav-link {
    color: var(--theme-text) !important;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-accent) !important;
    border-left: 4px solid var(--theme-accent) !important;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--theme-surface) !important;
    border-top: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] footer {
    background-color: #ffffff !important;
    border-top-color: #cbd5e1 !important;
    color: #1a202c !important;
}

footer.bg-dark {
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] footer.bg-dark {
    background-color: #ffffff !important;
}

footer a,
footer a:visited {
    color: var(--theme-accent) !important;
}

[data-theme="light"] footer a,
[data-theme="light"] footer a:visited {
    color: #0284c7 !important;
}

footer .text-light {
    color: var(--theme-text) !important;
}

[data-theme="light"] footer .text-light {
    color: #1a202c !important;
}

footer .text-muted {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] footer .text-muted {
    color: #64748b !important;
}

footer h6 {
    color: var(--theme-text) !important;
}

[data-theme="light"] footer h6 {
    color: #1a202c !important;
}

footer .border-secondary {
    border-color: var(--theme-border) !important;
}

[data-theme="light"] footer .border-secondary {
    border-color: #cbd5e1 !important;
}

/* Footer text classes must override Bootstrap */
footer .text-light,
footer h6.text-light {
    color: var(--theme-text) !important;
}

[data-theme="light"] footer .text-light,
[data-theme="light"] footer h6.text-light {
    color: #1a202c !important;
}

footer .container-fluid {
    width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin: 0 auto !important;
}

footer .text-center {
    text-align: center !important;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--theme-surface) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .card {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

.card-header,
.card-footer {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="light"] .card-header,
[data-theme="light"] .card-footer {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
}

.card-subtitle {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] .card-subtitle {
    color: #64748b !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select,
textarea {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] textarea {
    background-color: #e8ecf1 !important;
    color: #1a202c !important;
    border-color: #cbd5e1 !important;
}

.form-control::placeholder,
textarea::placeholder {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] .form-control::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #64748b !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 0.25rem var(--theme-focus) !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 0.25rem rgba(2, 132, 199, 0.25) !important;
}

.form-label,
.form-check-label {
    color: var(--theme-text) !important;
}

[data-theme="light"] .form-label,
[data-theme="light"] .form-check-label {
    color: #1a202c !important;
}

/* ============================================
   FORM BUTTONS & TEXT (RADIO/CHECKBOX BUTTONS)
   ============================================ */
.btn-check:checked + .btn-outline-secondary,
.btn-outline-secondary.active {
    color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
}

[data-theme="light"] .btn-check:checked + .btn-outline-secondary,
[data-theme="light"] .btn-outline-secondary.active {
    color: #0284c7 !important;
    border-color: #0284c7 !important;
    background-color: rgba(2, 132, 199, 0.1) !important;
}

[data-theme="light"] .btn-outline-secondary {
    color: #1a202c !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .btn-outline-secondary:hover {
    background-color: #e8ecf1 !important;
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

/* ============================================
   SMALL TEXT & MUTED TEXT IN FORMS
   ============================================ */
.form-group small,
.form-group .text-muted,
.form-check + .text-muted,
.form-check .small,
[class*="form-"] .small {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] .form-group small,
[data-theme="light"] .form-group .text-muted,
[data-theme="light"] .form-check + .text-muted,
[data-theme="light"] .form-check .small,
[data-theme="light"] [class*="form-"] .small {
    color: #64748b !important;
}

/* ============================================
   DENSITY & OPTIONS BUTTONS
   ============================================ */
[data-theme="light"] .btn-group .btn-outline-secondary {
    color: #1a202c !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .btn-group .btn-outline-secondary:hover {
    background-color: #f0f4f8 !important;
    color: #0284c7 !important;
}

[data-theme="light"] .btn-group .btn:checked + .btn-outline-secondary {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* ============================================
   INTERFACE OPTIONS SECTION
   ============================================ */
[data-theme="light"] .settings-group h6 {
    color: #1a202c !important;
}

[data-theme="light"] .settings-group p {
    color: #1a202c !important;
}

[data-theme="light"] .settings-group .text-muted {
    color: #64748b !important;
}

[data-theme="light"] .form-select option {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
    font-weight: 600;
}

.btn-secondary {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.btn-outline-secondary {
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-accent) !important;
}

/* ============================================
   TABLES (Bootstrap .table classes)
   ============================================ */
.table {
    color: var(--theme-text) !important;
    background-color: var(--theme-surface) !important;
    border-collapse: collapse;
    width: 100%;
}

[data-theme="light"] .table {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.table th,
.table thead th {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-accent) !important;
    border-color: var(--theme-border) !important;
    font-weight: 700;
    padding: 0.75rem !important;
    border-bottom: 2px solid var(--theme-border) !important;
}

[data-theme="light"] .table th,
[data-theme="light"] .table thead th {
    background-color: #e8ecf1 !important;
    color: #0284c7 !important;
    border-color: #cbd5e1 !important;
}

.table td {
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    padding: 0.75rem !important;
    vertical-align: middle;
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] .table td {
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
    background-color: #ffffff !important;
}

.table tbody tr {
    background-color: var(--theme-surface) !important;
    transition: background-color 0.15s ease-in-out;
}

[data-theme="light"] .table tbody tr {
    background-color: #ffffff !important;
}

.table-hover tbody tr:hover {
    background-color: var(--theme-focus) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .table-hover tbody tr:hover {
    background-color: rgba(2, 132, 199, 0.1) !important;
    color: #1a202c !important;
}

.table-hover tbody tr:hover td {
    background-color: var(--theme-focus) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .table-hover tbody tr:hover td {
    background-color: rgba(2, 132, 199, 0.1) !important;
    color: #1a202c !important;
}

.table-dark {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.table-dark th,
.table-dark td {
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

/* Table inside cards */
.card .table {
    margin-bottom: 0;
}

.card .table thead th {
    border-top: none !important;
}

/* Table responsive wrapper */
.table-responsive {
    background-color: var(--theme-surface);
    border-radius: 4px;
}

[data-theme="light"] .table-responsive {
    background-color: #ffffff;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-color: var(--theme-border) !important;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #bbf7d0 !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #fecaca !important;
}

.alert-info {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #bae6fd !important;
}

.alert-warning {
    background-color: rgba(250, 204, 21, 0.15) !important;
    color: #fef3c7 !important;
}

/* Light mode alert overrides */
[data-theme="light"] .alert {
    border-color: var(--theme-border) !important;
}

[data-theme="light"] .alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #166534 !important;
    border-color: #22c55e !important;
}

[data-theme="light"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #991b1b !important;
    border-color: #ef4444 !important;
}

[data-theme="light"] .alert-info {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #0369a1 !important;
    border-color: #38bdf8 !important;
}

[data-theme="light"] .alert-warning {
    background-color: rgba(250, 204, 21, 0.15) !important;
    color: #854d0e !important;
    border-color: #facc15 !important;
}

/* Alert close button light mode */
[data-theme="light"] .alert .btn-close {
    filter: none !important;
}

/* ============================================
   TOOLTIPS
   ============================================ */
.tooltip {
    --bs-tooltip-bg: var(--theme-surface);
    --bs-tooltip-color: var(--theme-text);
}

.tooltip-inner {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border: 1px solid var(--theme-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    font-size: 0.875rem;
    max-width: 250px;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: var(--theme-surface) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: var(--theme-surface) !important;
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: var(--theme-surface) !important;
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: var(--theme-surface) !important;
}

/* Light mode tooltips */
[data-theme="light"] .tooltip-inner {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

[data-theme="light"] .bs-tooltip-top .tooltip-arrow::before,
[data-theme="light"] .bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: #1f2937 !important;
}

[data-theme="light"] .bs-tooltip-bottom .tooltip-arrow::before,
[data-theme="light"] .bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: #1f2937 !important;
}

[data-theme="light"] .bs-tooltip-start .tooltip-arrow::before,
[data-theme="light"] .bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #1f2937 !important;
}

[data-theme="light"] .bs-tooltip-end .tooltip-arrow::before,
[data-theme="light"] .bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #1f2937 !important;
}

/* ============================================
   MODALS & POPOVERS
   ============================================ */
.modal-content,
.popover {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.modal-header,
.modal-footer,
.popover-header {
    background-color: var(--theme-surface-alt) !important;
}

.modal-header {
    border-bottom: 1px solid var(--theme-border) !important;
}

.modal-footer {
    border-top: 1px solid var(--theme-border) !important;
}

.modal-title {
    color: var(--theme-text) !important;
    font-weight: 600;
}

.modal-body {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

.modal-body .form-label,
.modal-body .form-control,
.modal-body .form-select,
.modal-body label {
    color: var(--theme-text) !important;
}

.modal-body .form-control,
.modal-body .form-select {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 0.25rem var(--theme-focus) !important;
}

.modal-body .form-control-plaintext {
    color: var(--theme-text) !important;
}

.btn-close {
    filter: invert(1) !important;
}

.btn-close:hover {
    filter: invert(1) brightness(1.2) !important;
}

/* ============================================
   NAV TABS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid var(--theme-border) !important;
}

.nav-tabs .nav-link {
    color: var(--theme-text-muted) !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
    color: var(--theme-accent) !important;
    border-bottom: 3px solid var(--theme-accent) !important;
}

/* ============================================
   SELECT2 DROPDOWN THEME
   ============================================ */
.select2-container--default .select2-selection--single {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .select2-container--default .select2-selection--single {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--theme-text) !important;
}

[data-theme="light"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1a202c !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    color: var(--theme-text) !important;
}

[data-theme="light"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    color: #1a202c !important;
}

.select2-dropdown {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="light"] .select2-dropdown {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.select2-results__option {
    color: var(--theme-text) !important;
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] .select2-results__option {
    color: #1a202c !important;
    background-color: #ffffff !important;
}

.select2-results__option--highlighted[aria-selected],
.select2-results__option[aria-selected=true] {
    background-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
}

[data-theme="light"] .select2-results__option--highlighted[aria-selected],
[data-theme="light"] .select2-results__option[aria-selected=true] {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--theme-accent) !important;
}

[data-theme="light"] .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0284c7 !important;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination .page-link {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.pagination .page-item.active .page-link {
    background-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
}

/* ============================================
   HEADINGS
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--theme-text) !important;
}

/* ============================================
   LINKS & TEXT
   ============================================ */
a {
    color: var(--theme-accent) !important;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* ============================================
   SCROLLBAR
   ============================================ */
main::-webkit-scrollbar {
    width: 8px;
}

main::-webkit-scrollbar-thumb {
    background: var(--theme-border) !important;
    border-radius: 4px;
}

/* ============================================
   FILTER & SEARCH SECTIONS
   ============================================ */
.filter-section,
.search-box,
.filter-area,
.search-section,
.filters-panel {
    background-color: var(--theme-surface-alt) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

[data-theme="light"] .filter-section,
[data-theme="light"] .search-box,
[data-theme="light"] .filter-area,
[data-theme="light"] .search-section,
[data-theme="light"] .filters-panel {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

.filter-section h5,
.search-box h5,
.filter-area h5,
.search-section h5,
.filters-panel h5,
.filter-section h6,
.search-box h6,
.filter-area h6,
.search-section h6,
.filters-panel h6 {
    color: var(--theme-text) !important;
}

[data-theme="light"] .filter-section h5,
[data-theme="light"] .search-box h5,
[data-theme="light"] .filter-area h5,
[data-theme="light"] .search-section h5,
[data-theme="light"] .filters-panel h5,
[data-theme="light"] .filter-section h6,
[data-theme="light"] .search-box h6,
[data-theme="light"] .filter-area h6,
[data-theme="light"] .search-section h6,
[data-theme="light"] .filters-panel h6 {
    color: #1a202c !important;
}
* {
    transition: background-color 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}


/* ============================================
   DATATABLES THEME (INTEGRATED)
   ============================================ */

/* DataTables Wrapper Styling */
.dataTables_wrapper {
    font-size: 14px;
    margin-top: 20px;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper {
    color: #1a202c !important;
}

.dataTables_wrapper * {
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper * {
    color: #1a202c !important;
}

.dataTables_wrapper .dataTables_header {
    padding: 8px 15px;
    background-color: var(--theme-surface-alt) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 4px 4px 0 0;
}

/* Table Styling */
.dataTables_wrapper table {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-collapse: collapse;
}

[data-theme="light"] .dataTables_wrapper table {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.dataTables_wrapper table thead {
    background-color: var(--theme-surface-alt) !important;
    border-bottom: 2px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper table thead {
    background-color: #e8ecf1 !important;
    border-bottom-color: #cbd5e1 !important;
    color: #1a202c !important;
}

.dataTables_wrapper table thead th {
    color: var(--theme-text) !important;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid var(--theme-border) !important;
    vertical-align: middle;
    background-color: var(--theme-surface-alt) !important;
}

[data-theme="light"] .dataTables_wrapper table thead th {
    color: #1a202c !important;
    background-color: #e8ecf1 !important;
    border-bottom-color: #cbd5e1 !important;
}

.dataTables_wrapper table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--theme-border) !important;
    vertical-align: middle;
    color: var(--theme-text) !important;
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] .dataTables_wrapper table tbody td {
    border-bottom-color: #cbd5e1 !important;
    color: #1a202c !important;
    background-color: #ffffff !important;
}

/* Hyperlinks in DataTable cells */
.dataTables_wrapper table tbody td a,
.dataTables_wrapper table tbody td a:visited {
    color: var(--theme-accent);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    padding-bottom: 2px;
}

.dataTables_wrapper table tbody td a:hover {
    color: var(--theme-accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.dataTables_wrapper table tbody td a:active {
    color: var(--theme-accent);
}

/* Hyperlinks in table headers */
.dataTables_wrapper table thead th a,
.dataTables_wrapper table thead th a:visited {
    color: var(--theme-text);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.dataTables_wrapper table thead th a:hover {
    color: var(--theme-accent);
    border-bottom: 2px solid var(--theme-accent);
}

.dataTables_wrapper table tbody tr {
    background-color: var(--theme-surface) !important;
    transition: background-color 0.15s ease-in-out;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper table tbody tr {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.dataTables_wrapper table tbody tr:hover {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper table tbody tr:hover {
    background-color: #e8ecf1 !important;
    color: #1a202c !important;
}

.dataTables_wrapper table tbody tr.odd {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper table tbody tr.odd {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.dataTables_wrapper table tbody tr.odd:hover {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .dataTables_wrapper table tbody tr.odd:hover {
    background-color: #e8ecf1 !important;
    color: #1a202c !important;
}

/* DataTables Controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--theme-text) !important;
    padding: 8px 15px;
    background-color: transparent !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: var(--theme-text) !important;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 3px var(--theme-focus) !important;
}

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate {
    padding: 8px 15px;
    background-color: var(--theme-surface-alt) !important;
    border: 1px solid var(--theme-border) !important;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    background-color: var(--theme-surface) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 4px;
    color: var(--theme-text) !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* DataTables Info Section */
.dataTables_wrapper .dataTables_info {
    color: var(--theme-text-muted) !important;
    padding: 8px 15px;
    background-color: var(--theme-surface-alt) !important;
    border: 1px solid var(--theme-border) !important;
    border-top: none;
    border-radius: 0 0 4px 4px;
    font-size: 13px;
}

/* DataTables Scrolling */
.dataTables_wrapper .dataTables_scroll {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
}

/* DataTables No Records Message */
.dataTables_wrapper table tbody tr.no-data td {
    text-align: center;
    padding: 20px 15px;
    color: var(--theme-text-muted);
    font-style: italic;
}

/* DataTables Responsive */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-repeat: no-repeat;
    background-position: center right;
    padding-right: 30px;
}

table.dataTable thead .sorting {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23999" d="M0 3h6l-3 3-3-3zm6 6h6l-3-3-3 3z"/></svg>');
}

table.dataTable thead .sorting_asc {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="var(--theme-accent)" d="M0 6h6l-3-3-3 3zm6 0h6l-3 3-3-3z"/></svg>');
}

table.dataTable thead .sorting_desc {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="var(--theme-accent)" d="M0 3h6l-3 3-3-3zm6 6h6l-3-3-3 3z"/></svg>');
}

/* DataTables Buttons */
.dt-buttons {
    margin-bottom: 15px;
}

.dt-buttons .dt-button {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
    padding: 8px 12px;
    margin-right: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 13px;
}

.dt-buttons .dt-button:hover {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    color: white;
}

.dt-buttons .dt-button.active {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    color: white;
}

/* DataTables Processing Message */
.dataTables_wrapper .dataTables_processing {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200px;
    margin-left: -100px;
    margin-top: -25px;
    text-align: center;
    padding: 1em;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* DataTable Direct Styling (table.dataTable) */
table.dataTable {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-collapse: collapse;
    width: 100% !important;
}

[data-theme="light"] table.dataTable {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

table.dataTable thead th {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-accent) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    white-space: nowrap;
    padding: 0.75rem !important;
}

[data-theme="light"] table.dataTable thead th {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

table.dataTable tbody tr {
    border-color: var(--theme-border) !important;
    transition: all 0.2s;
}

table.dataTable tbody tr:hover {
    background-color: var(--theme-focus) !important;
}

[data-theme="light"] table.dataTable tbody tr:hover {
    background-color: rgba(2, 132, 199, 0.1) !important;
}

table.dataTable tbody td {
    border-color: var(--theme-border) !important;
    padding: 0.75rem !important;
    vertical-align: middle;
    color: var(--theme-text) !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="light"] table.dataTable tbody td {
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

/* DataTable Column Sizing - Dynamic */
table.dataTable th:nth-child(1),
table.dataTable th:nth-child(2) {
    min-width: 50px;
}

table.dataTable th:nth-child(3),
table.dataTable th:nth-child(4),
table.dataTable th:nth-child(5),
table.dataTable th:nth-child(6) {
    min-width: 100px;
}

table.dataTable th:nth-child(7) {
    min-width: 90px;
}

table.dataTable th:nth-child(8),
table.dataTable th:nth-child(9) {
    min-width: 70px;
}

table.dataTable th:nth-child(10) {
    min-width: 120px;
}

table.dataTable th:nth-child(11) {
    min-width: 80px;
}

/* DataTables Pagination Theming */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-accent-contrast) !important;
    font-weight: 600;
}

/* DataTable Odd/Even Row Styling */
table.dataTable tbody tr.odd {
    background-color: var(--theme-surface) !important;
}

[data-theme="light"] table.dataTable tbody tr.odd {
    background-color: #ffffff !important;
}

table.dataTable tbody tr.even {
    background-color: var(--theme-surface-alt) !important;
}

[data-theme="light"] table.dataTable tbody tr.even {
    background-color: #f8fafc !important;
}

table.dataTable tbody tr:hover td {
    background-color: var(--theme-focus) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] table.dataTable tbody tr:hover td {
    background-color: rgba(2, 132, 199, 0.1) !important;
    color: #1a202c !important;
}

/* DataTable Badge Styling */
table.dataTable .badge {
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

/* Status Badge - Pending (Warning) - Orange/Amber for better visibility */
table.dataTable .badge.bg-warning,
.dataTables_wrapper .badge.bg-warning {
    background-color: #f59e0b !important;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: none;
}

[data-theme="light"] table.dataTable .badge.bg-warning,
[data-theme="light"] .dataTables_wrapper .badge.bg-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

/* Status Badge - Success (Approved) */
table.dataTable .badge.bg-success,
.dataTables_wrapper .badge.bg-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
    font-weight: 600;
}

[data-theme="light"] table.dataTable .badge.bg-success,
[data-theme="light"] .dataTables_wrapper .badge.bg-success {
    background-color: #059669 !important;
    color: #ffffff !important;
}

/* Status Badge - Danger (Rejected) */
table.dataTable .badge.bg-danger,
.dataTables_wrapper .badge.bg-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 600;
}

[data-theme="light"] table.dataTable .badge.bg-danger,
[data-theme="light"] .dataTables_wrapper .badge.bg-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Status Badge - Info (Completed) */
table.dataTable .badge.bg-info,
.dataTables_wrapper .badge.bg-info {
    background-color: #06b6d4 !important;
    color: #1a1a1a !important;
    font-weight: 600;
}

[data-theme="light"] table.dataTable .badge.bg-info,
[data-theme="light"] .dataTables_wrapper .badge.bg-info {
    background-color: #0891b2 !important;
    color: #ffffff !important;
}

/* Status Badge - Secondary */
table.dataTable .badge.bg-secondary,
.dataTables_wrapper .badge.bg-secondary {
    background-color: #6b7280 !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* ============================================
   AGGRESSIVE OVERRIDES FOR INLINE STYLES
   ============================================ */

/* Specific overrides for known hardcoded colors */
[data-theme="light"] [style*="#0d1117"],
[data-theme="light"] [style*="#1a1a1a"],
[data-theme="light"] [style*="#161b22"],
[data-theme="light"] [style*="#1f2630"],
[data-theme="light"] [style*="#242424"],
[data-theme="light"] [style*="#2d2d2d"],
[data-theme="light"] [style*="#495057"],
[data-theme="light"] [style*="background: linear-gradient(135deg, #1e1e1e"],
[data-theme="light"] [style*="background: linear-gradient(135deg, #0d1117"] {
    background-color: var(--theme-surface) !important;
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

/* Modal overrides */
[data-theme="light"] .modal-content {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

[data-theme="light"] .modal-header {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

[data-theme="light"] .modal-body {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

[data-theme="light"] .modal-footer {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* Form controls override */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="file"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

[data-theme="light"] input[style*="#e0e0e0"],
[data-theme="light"] select[style*="#e0e0e0"],
[data-theme="light"] textarea[style*="#e0e0e0"] {
    color: #1a202c !important;
}

/* Override hardcoded text colors */
[data-theme="light"] *[style*="color: #e0e0e0"],
[data-theme="light"] *[style*="color:#e0e0e0"] {
    color: #1a202c !important;
}

/* Filter and search sections */
[data-theme="light"] .card[style*="#1a1a1a"],
[data-theme="light"] .card[style*="#242424"] {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* Summary rows */
[data-theme="light"] .summary-row[style*="#0d1117"] {
    background-color: #e8ecf1 !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

/* ============================================
   FORM ELEMENTS - WORK ENTRY & MODALS
   ============================================ */

/* Form input and textarea styling */
.form-control[style*="background-color"],
.form-select[style*="background-color"],
textarea[style*="background-color"],
input[type="text"][style*="background-color"],
input[type="number"][style*="background-color"],
input[type="file"][style*="background-color"] {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
}

[data-theme="light"] .form-control[style*="background-color"],
[data-theme="light"] .form-select[style*="background-color"],
[data-theme="light"] textarea[style*="background-color"],
[data-theme="light"] input[type="text"][style*="background-color"],
[data-theme="light"] input[type="number"][style*="background-color"],
[data-theme="light"] input[type="file"][style*="background-color"] {
    background-color: #ffffff !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

/* Form labels with theme colors */
.form-label[style*="color: #00ffff"],
.form-label[style*="color: #a0e7e5"] {
    color: var(--theme-accent) !important;
}

[data-theme="light"] .form-label[style*="color: #00ffff"],
[data-theme="light"] .form-label[style*="color: #a0e7e5"] {
    color: #0284c7 !important;
}

/* Heading colors in modals */
h6[style*="color: #00ffff"] {
    color: var(--theme-accent) !important;
}

[data-theme="light"] h6[style*="color: #00ffff"] {
    color: #0284c7 !important;
}

/* HR elements */
hr[style*="border-color: #495057"] {
    border-color: var(--theme-border) !important;
}

[data-theme="light"] hr[style*="border-color: #495057"] {
    border-color: #cbd5e1 !important;
}

/* Modal footer styling */
.modal-footer[style*="background-color: #2d2d2d"],
.modal-footer[style*="background-color: #242424"] {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-accent) !important;
}

[data-theme="light"] .modal-footer[style*="background-color: #2d2d2d"],
[data-theme="light"] .modal-footer[style*="background-color: #242424"] {
    background-color: #f5f5f5 !important;
    border-color: #0dcaf0 !important;
}

/* Icon colors */
i[style*="color: #17a2b8"],
.fa-info-circle[style*="color: #17a2b8"],
[style*="color: #17a2b8"] {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] i[style*="color: #17a2b8"],
[data-theme="light"] .fa-info-circle[style*="color: #17a2b8"],
[data-theme="light"] [style*="color: #17a2b8"] {
    color: #17a2b8 !important;
}

/* Status and action buttons with color styling - preserve Bootstrap semantic colors */
/* These use standard Bootstrap status colors which work across themes */

/* Button styling */
button[style*="background-color: #0dcaf0"],
button[style*="background-color: #ff6b6b"] {
    background-color: var(--theme-accent) !important;
    color: #000 !important;
}

[data-theme="light"] button[style*="background-color: #0dcaf0"] {
    background-color: #0dcaf0 !important;
}

/* Image styling in modals */
img[style*="max-width"],
img[style*="border: 2px solid #0dcaf0"] {
    border-color: var(--theme-accent) !important;
}

[data-theme="light"] img[style*="border: 2px solid #0dcaf0"] {
    border-color: #0dcaf0 !important;
}

/* ============================================
   ICON COLORS - SEMANTIC STATUS INDICATORS
   ============================================ */

/* Accent/Primary icons */
i[style*="color: #0dcaf0"],
.fa-building[style*="color: #0dcaf0"],
.fa-server[style*="color: #0dcaf0"],
.fa-tasks[style*="color: #0dcaf0"] {
    color: var(--theme-accent) !important;
}

[data-theme="light"] i[style*="color: #0dcaf0"],
[data-theme="light"] .fa-building[style*="color: #0dcaf0"],
[data-theme="light"] .fa-server[style*="color: #0dcaf0"],
[data-theme="light"] .fa-tasks[style*="color: #0dcaf0"] {
    color: #0dcaf0 !important;
}

/* Info icons */
i[style*="color: #17a2b8"],
.fa-project-diagram[style*="color: #17a2b8"],
.fa-briefcase[style*="color: #17a2b8"],
.fa-image[style*="color: #17a2b8"] {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] i[style*="color: #17a2b8"],
[data-theme="light"] .fa-project-diagram[style*="color: #17a2b8"],
[data-theme="light"] .fa-briefcase[style*="color: #17a2b8"],
[data-theme="light"] .fa-image[style*="color: #17a2b8"] {
    color: #17a2b8 !important;
}

/* Success icons */
i[style*="color: #198754"],
i[style*="color: #28a745"],
.fa-plug[style*="color: #198754"],
.fa-check-double[style*="color: #28a745"] {
    color: var(--bs-success, #198754) !important;
}

[data-theme="light"] i[style*="color: #198754"],
[data-theme="light"] i[style*="color: #28a745"],
[data-theme="light"] .fa-plug[style*="color: #198754"],
[data-theme="light"] .fa-check-double[style*="color: #28a745"] {
    color: #198754 !important;
}

/* Success alternate */
i[style*="color: #20c997"],
.fa-box[style*="color: #20c997"] {
    color: var(--bs-teal, #20c997) !important;
}

[data-theme="light"] i[style*="color: #20c997"],
[data-theme="light"] .fa-box[style*="color: #20c997"] {
    color: #20c997 !important;
}

/* Warning icons */
i[style*="color: #ffc107"],
i[style*="color: #fd7e14"],
.fa-calendar[style*="color: #ffc107"],
.fa-cube[style*="color: #fd7e14"],
.fa-clock[style*="color: #ffc107"] {
    color: var(--bs-warning, #ffc107) !important;
}

[data-theme="light"] i[style*="color: #ffc107"],
[data-theme="light"] i[style*="color: #fd7e14"],
[data-theme="light"] .fa-calendar[style*="color: #ffc107"],
[data-theme="light"] .fa-cube[style*="color: #fd7e14"],
[data-theme="light"] .fa-clock[style*="color: #ffc107"] {
    color: #ffc107 !important;
}

/* Purple/Secondary icons */
i[style*="color: #6f42c1"],
.fa-building[style*="color: #6f42c1"] {
    color: var(--bs-secondary, #6f42c1) !important;
}

[data-theme="light"] i[style*="color: #6f42c1"],
[data-theme="light"] .fa-building[style*="color: #6f42c1"] {
    color: #6f42c1 !important;
}

/* ============================================
   REPORT BADGES & ICONS
   ============================================ */

.report-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Success badge (green) */
.report-badge[style*="color: #198754"],
.report-badge.badge-success {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: var(--bs-success, #198754) !important;
}

[data-theme="light"] .report-badge[style*="color: #198754"],
[data-theme="light"] .report-badge.badge-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
    color: #198754 !important;
}

/* Warning badge (yellow) */
.report-badge[style*="color: #ffc107"],
.report-badge.badge-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: var(--bs-warning, #ffc107) !important;
}

[data-theme="light"] .report-badge[style*="color: #ffc107"],
[data-theme="light"] .report-badge.badge-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107 !important;
}

/* Info badge (teal) */
.report-badge[style*="color: #17a2b8"],
.report-badge.badge-info {
    background-color: rgba(23, 162, 184, 0.2) !important;
    color: var(--bs-info, #17a2b8) !important;
}

[data-theme="light"] .report-badge[style*="color: #17a2b8"],
[data-theme="light"] .report-badge.badge-info {
    background-color: rgba(23, 162, 184, 0.15) !important;
    color: #17a2b8 !important;
}

/* Danger badge (red) */
.report-badge[style*="color: #dc3545"],
.report-badge.badge-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: var(--bs-danger, #dc3545) !important;
}

[data-theme="light"] .report-badge[style*="color: #dc3545"],
[data-theme="light"] .report-badge.badge-danger {
    background-color: rgba(220, 53, 69, 0.15) !important;
    color: #dc3545 !important;
}

/* Report icons - preserve status colors */
.report-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.report-icon[style*="color: #198754"] {
    color: var(--bs-success, #198754) !important;
}

.report-icon[style*="color: #ffc107"] {
    color: var(--bs-warning, #ffc107) !important;
}

.report-icon[style*="color: #17a2b8"] {
    color: var(--bs-info, #17a2b8) !important;
}

.report-icon[style*="color: #dc3545"] {
    color: var(--bs-danger, #dc3545) !important;
}

/* Image preview borders */
img.preview-image,
img[style*="border: 2px solid #0dcaf0"] {
    border-color: var(--theme-accent) !important;
}

[data-theme="light"] img[style*="border: 2px solid #0dcaf0"] {
    border-color: #0dcaf0 !important;
}

/* Dashboard icon styling */
.dashboard-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--theme-accent);
}

/* Dashboard stat card styling */
.stat-card {
    border-left: 4px solid var(--theme-accent) !important;
}

[data-theme="light"] .stat-card {
    border-left-color: #0dcaf0 !important;
}

/* ============================================
   STATUS VALUE DISPLAY STYLING
   ============================================ */
.form-value {
    font-weight: 600;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.form-value.item-uom {
    font-size: 1.3rem;
    color: var(--bs-secondary, #6f42c1);
}

.form-value.total-qty,
.form-value.done-qty,
.form-value.awaiting-qty {
    font-size: 1.4rem;
    justify-content: center;
    text-align: center;
}

.form-value.total-qty {
    color: var(--bs-teal, #20c997);
}

.form-value.done-qty {
    color: var(--bs-success, #28a745);
}

.form-value.awaiting-qty {
    color: var(--bs-warning, #ffc107);
}

.form-value.light-text {
    color: var(--theme-text, #e0e0e0);
}

[data-theme="light"] .form-value.item-uom {
    color: #6f42c1;
}

[data-theme="light"] .form-value.total-qty {
    color: #20c997;
}

[data-theme="light"] .form-value.done-qty {
    color: #28a745;
}

[data-theme="light"] .form-value.awaiting-qty {
    color: #ffc107;
}

[data-theme="light"] .form-value.light-text {
    color: #000000;
}

/* Layout utilities - preserve these as-is */

/* ============================================
   FOOTER STYLING WITH THEME VARIABLES
   ============================================ */

/* Main footer container */
.footer-theme {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

/* Footer headings */
.footer-theme h6 {
    color: var(--theme-text) !important;
}

/* Footer text and small text */
.footer-theme .text-light {
    color: var(--theme-text) !important;
}

.footer-theme .text-muted {
    color: var(--theme-text-muted) !important;
}

/* Footer accent text (info) */
.footer-theme .text-info {
    color: var(--theme-accent) !important;
}

.footer-theme .text-success {
    color: #22c55e !important;
}

.footer-theme .text-secondary {
    color: var(--theme-text-muted) !important;
}

/* Footer links */
.footer-theme a {
    color: var(--theme-text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-theme a:hover {
    color: var(--theme-accent) !important;
    transform: translateX(4px);
}

.footer-theme a:focus {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Footer buttons */
.footer-theme .btn-outline-secondary {
    border-color: var(--theme-border) !important;
    color: var(--theme-text-muted) !important;
    transition: all 0.3s ease;
}

.footer-theme .btn-outline-secondary:hover {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
}

.footer-theme .btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.25rem var(--theme-focus) !important;
}

/* Footer badges */
.footer-theme .badge {
    background-color: #22c55e !important;
    color: #ffffff !important;
}

/* Footer horizontal lines */
.footer-theme {
    border-top: 1px solid var(--theme-border) !important;
}

/* Footer spacing */
.footer-theme .container-fluid {
    max-width: 100%;
}

.footer-theme .col-lg-2 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-theme .list-unstyled {
    text-align: center;
}

/* Footer server time display */
.footer-theme #serverTime {
    color: var(--theme-accent);
    font-weight: bold;
}

/* Light mode specific footer overrides */
[data-theme="light"] .footer-theme {
    background-color: #f8fafc !important;
}

[data-theme="light"] .footer-theme h6 {
    color: #1a202c !important;
}

[data-theme="light"] .footer-theme .text-light {
    color: #1a202c !important;
}

[data-theme="light"] .footer-theme .text-muted {
    color: #64748b !important;
}

[data-theme="light"] .footer-theme a {
    color: #64748b;
}

[data-theme="light"] .footer-theme a:hover {
    color: #0284c7 !important;
}

[data-theme="light"] .footer-theme .text-info {
    color: #0284c7 !important;
}

[data-theme="light"] .footer-theme .btn-outline-secondary {
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

[data-theme="light"] .footer-theme .btn-outline-secondary:hover {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

[data-theme="light"] .footer-theme .transition-link {
    transition: all 0.3s ease;
}

/* Responsive footer */
@media (max-width: 576px) {
    .footer-theme .container-fluid {
        padding: 0 15px;
    }

    .footer-theme .col-lg-3,
    .footer-theme .col-lg-2 {
        margin-bottom: 20px;
    }

    .footer-theme .row:last-child {
        flex-direction: column;
    }

    .footer-theme .text-end {
        text-align: left !important;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--theme-border);
    }
}

/* ============================================
   REPORT PAGE STYLING WITH THEME VARIABLES
   ============================================ */

/* Report Cards */
.report-card {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.report-card:hover {
    border-color: var(--theme-accent) !important;
}

.report-title {
    color: var(--theme-text) !important;
}

.report-description {
    color: var(--theme-text-muted) !important;
}

.report-badge {
    background-color: var(--theme-focus) !important;
    color: var(--theme-accent) !important;
}

/* Filter Section */
.filter-section {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

/* Card Components */
.card {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

.card-header {
    background-color: var(--theme-surface-alt) !important;
    border-bottom-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.card-body {
    color: var(--theme-text) !important;
}

/* KPI Cards */
.kpi-card {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

.kpi-value {
    color: var(--theme-accent) !important;
}

.kpi-label {
    color: var(--theme-text-muted) !important;
}

/* Section Headers */
.section-header {
    border-bottom-color: var(--theme-border) !important;
}

.section-header h3 {
    color: var(--theme-text) !important;
}

.section-header h3 i {
    color: var(--theme-accent) !important;
}

.section-header p {
    color: var(--theme-text-muted) !important;
}

/* Tables in Report */
table.dataTable {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

table.dataTable thead th {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-accent) !important;
}

table.dataTable tbody td {
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

table.dataTable tbody tr:hover {
    background-color: var(--theme-focus) !important;
}

/* Select2 Dropdowns */
.select2-container--bootstrap-5 .select2-selection--single {
    background-color: var(--theme-surface-alt) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--theme-text) !important;
}

.select2-dropdown.select2-dropdown--below {
    background-color: var(--theme-surface) !important;
}

.select2-results {
    background-color: var(--theme-surface) !important;
}

.select2-results__option {
    color: var(--theme-text) !important;
}

.select2-results__option--highlighted {
    background-color: var(--theme-accent) !important;
    color: var(--theme-bg) !important;
}

/* Light Mode Specific Report Overrides */
[data-theme="light"] .report-card {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .report-card:hover {
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] .report-title {
    color: #1a202c !important;
}

[data-theme="light"] .report-description {
    color: #64748b !important;
}

[data-theme="light"] .report-badge {
    background-color: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
}

[data-theme="light"] .filter-section {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .card {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .card-header {
    background-color: #f1f5f9 !important;
    border-bottom-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

[data-theme="light"] .card-body {
    color: #1a202c !important;
}

[data-theme="light"] .kpi-card {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .kpi-value {
    color: #0284c7 !important;
}

[data-theme="light"] .kpi-label {
    color: #64748b !important;
}

[data-theme="light"] .section-header {
    border-bottom-color: #cbd5e1 !important;
}

[data-theme="light"] .section-header h3 {
    color: #1a202c !important;
}

[data-theme="light"] .section-header h3 i {
    color: #0284c7 !important;
}

[data-theme="light"] .section-header p {
    color: #64748b !important;
}

[data-theme="light"] table.dataTable {
    background-color: #ffffff !important;
    color: #1a202c !important;
}

[data-theme="light"] table.dataTable thead th {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

[data-theme="light"] table.dataTable tbody td {
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

[data-theme="light"] table.dataTable tbody tr:hover {
    background-color: rgba(2, 132, 199, 0.05) !important;
}

[data-theme="light"] .select2-container--bootstrap-5 .select2-selection--single {
    background-color: #f1f5f9 !important;
    border-color: #0284c7 !important;
    color: #1a202c !important;
}

[data-theme="light"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #1a202c !important;
}

[data-theme="light"] .select2-dropdown.select2-dropdown--below {
    background-color: #ffffff !important;
}

[data-theme="light"] .select2-results {
    background-color: #ffffff !important;
}

[data-theme="light"] .select2-results__option {
    color: #1a202c !important;
}

[data-theme="light"] .select2-results__option--highlighted {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

/* ============================================
   REPORT DAILY SUMMARY PAGE STYLING
   ============================================ */

/* KPI Cards */
.kpi-card {
    background-color: var(--theme-surface) !important;
    border-left-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
}

.kpi-value {
    color: var(--theme-accent) !important;
}

.kpi-label {
    color: var(--theme-text-muted) !important;
}

.kpi-subtitle {
    color: var(--theme-text-muted) !important;
}

/* Chart Container */
.chart-container {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

/* Loading Indicator */
.loading {
    color: var(--theme-accent) !important;
}

.spinner-border {
    color: var(--theme-accent) !important;
}

/* Status Badges */
.status-approved {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #22c55e !important;
    border-color: #22c55e !important;
}

.status-pending {
    background-color: rgba(250, 204, 21, 0.2) !important;
    color: #facc15 !important;
    border-color: #facc15 !important;
}

.status-rejected {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

/* Light Mode Specific Daily Summary Overrides */
[data-theme="light"] .kpi-card {
    background-color: #f8fafc !important;
    border-left-color: #0284c7 !important;
}

[data-theme="light"] .kpi-value {
    color: #0284c7 !important;
}

[data-theme="light"] .kpi-label {
    color: #64748b !important;
}

[data-theme="light"] .kpi-subtitle {
    color: #64748b !important;
}

[data-theme="light"] .chart-container {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1a202c !important;
}

[data-theme="light"] .loading {
    color: #0284c7 !important;
}

[data-theme="light"] .spinner-border {
    color: #0284c7 !important;
}

[data-theme="light"] .status-approved {
    background-color: rgba(34, 197, 94, 0.1) !important;
    color: #16a34a !important;
    border-color: #16a34a !important;
}

[data-theme="light"] .status-pending {
    background-color: rgba(202, 138, 4, 0.1) !important;
    color: #ca8a04 !important;
    border-color: #ca8a04 !important;
}

[data-theme="light"] .status-rejected {
    background-color: rgba(220, 38, 38, 0.1) !important;
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* ============================================
   THEME PREVIEW CARDS (Settings Page)
   ============================================ */
/* Prevent light-mode overrides from affecting theme preview cards.
   Each card should display its intended theme colors regardless of active theme. */

.theme-preview {
    background: inherit !important;
    color: inherit !important;
}

.theme-preview div,
.theme-preview p {
    color: inherit !important;
}

/* Ensure Dark Mode card stays dark */
.theme-preview[style*="#0d1117"],
.col-lg-4:nth-child(1) .theme-preview {
    background-color: #0d1117 !important;
}

.col-lg-4:nth-child(1) .theme-preview div {
    background-color: #1a1a1a !important;
}

.col-lg-4:nth-child(1) .theme-preview p {
    color: #e0e0e0 !important;
}

/* Ensure Light Mode card stays light */
.col-lg-4:nth-child(2) .theme-preview {
    background-color: #f8f9fa !important;
}

.col-lg-4:nth-child(2) .theme-preview div {
    background-color: #ffffff !important;
}

.col-lg-4:nth-child(2) .theme-preview p {
    color: #212529 !important;
}

/* Ocean Theme card */
.col-lg-4:nth-child(3) .theme-preview {
    background-color: #0a1628 !important;
}

.col-lg-4:nth-child(3) .theme-preview div {
    background-color: #1e3a5f !important;
}

.col-lg-4:nth-child(3) .theme-preview p {
    color: #90e0ef !important;
}

/* Forest Theme card */
.col-lg-4:nth-child(4) .theme-preview {
    background-color: #0d2818 !important;
}

.col-lg-4:nth-child(4) .theme-preview div {
    background-color: #1b4332 !important;
}

.col-lg-4:nth-child(4) .theme-preview p {
    color: #74c69d !important;
}

/* Sunset Theme card */
.col-lg-4:nth-child(5) .theme-preview {
    background-color: #1a0c0c !important;
}

.col-lg-4:nth-child(5) .theme-preview div {
    background-color: #3d1f1f !important;
}

.col-lg-4:nth-child(5) .theme-preview p {
    color: #ffb378 !important;
}

/* Purple Theme card */
.col-lg-4:nth-child(6) .theme-preview {
    background-color: #1a0f2e !important;
}

.col-lg-4:nth-child(6) .theme-preview div {
    background-color: #3c1e70 !important;
}

.col-lg-4:nth-child(6) .theme-preview p {
    color: #d8b4fe !important;
}

/* Monochrome Theme card */
.col-lg-4:nth-child(7) .theme-preview {
    background-color: #101010 !important;
}

.col-lg-4:nth-child(7) .theme-preview div {
    background-color: #262626 !important;
}

.col-lg-4:nth-child(7) .theme-preview p {
    color: #d4d4d4 !important;
}

/* Terminal Theme card */
.col-lg-4:nth-child(8) .theme-preview {
    background-color: #0d0221 !important;
}

.col-lg-4:nth-child(8) .theme-preview div {
    background-color: #1a0033 !important;
}

.col-lg-4:nth-child(8) .theme-preview p {
    color: #10b981 !important;
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .navbar,
    .sidebar,
    footer {
        display: none !important;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    z-index: 1080 !important;
}

.toast {
    background-color: var(--theme-accent-contrast) !important;
    border: 2px solid var(--theme-accent) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.toast-header {
    background-color: var(--theme-accent) !important;
    border-bottom: none !important;
    color: var(--theme-accent-contrast) !important;
    font-weight: 600;
}

.toast-header .btn-close {
    filter: none !important;
    opacity: 0.7;
}

.toast-header .btn-close:hover {
    opacity: 1;
}

.toast-body {
    color: var(--theme-text) !important;
    background-color: var(--theme-accent-contrast) !important;
}

.toast-body code {
    background-color: var(--theme-surface-alt) !important;
    color: var(--theme-accent) !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.875em;
}

/* Light mode toast overrides */
[data-theme="light"] .toast {
    background-color: #ffffff !important;
    border: 2px solid var(--theme-accent) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .toast-header {
    background-color: var(--theme-accent) !important;
    color: #ffffff !important;
}

[data-theme="light"] .toast-body {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

[data-theme="light"] .toast-body code {
    background-color: #f3f4f6 !important;
    color: #0369a1 !important;
}

/* Light mode specific adjustments */
[data-theme="light"] .btn-close {
    filter: invert(0) !important;
}

.text-success {
    color: #22c55e !important;
}

.text-danger {
    color: #ef4444 !important;
}

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

