/*** Light Theme Override ***/
[data-theme="light"] {
    --primary: #E48717;
    --secondary: #ffffff;
    --light: #495057;
    --dark: #f0f2f5;
}

[data-theme="light"] body {
    background-color: #f0f2f5;
    color: #212529;
}

[data-theme="light"] .content {
    background: #f0f2f5;
}

[data-theme="light"] .sidebar {
    background: #ffffff;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
}

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

[data-theme="light"] .sidebar .navbar .navbar-brand h3 {
    color: var(--primary);
}

[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link {
    color: #495057;
    border-left-color: #ffffff;
}

[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link:hover,
[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
    background: #f0f2f5;
    border-color: var(--primary);
}

[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link i {
    background: #f0f2f5;
    color: #495057;
}

[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link:hover i,
[data-theme="light"] .sidebar .navbar .navbar-nav .nav-link.active i {
    background: #ffffff;
    color: var(--primary);
}

[data-theme="light"] .sidebar .navbar .dropdown-item {
    color: #495057;
}

[data-theme="light"] .sidebar .navbar .dropdown-item:hover,
[data-theme="light"] .sidebar .navbar .dropdown-item.active {
    background: #f0f2f5;
}

/* Top navbar */
[data-theme="light"] .content .navbar {
    background: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

[data-theme="light"] .content .navbar .navbar-nav .nav-link {
    color: #495057;
}

[data-theme="light"] .content .navbar .navbar-nav .nav-link:hover,
[data-theme="light"] .content .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

[data-theme="light"] .content .navbar .sidebar-toggler,
[data-theme="light"] .content .navbar .navbar-nav .nav-link i {
    background: #f0f2f5;
    color: #495057;
}

[data-theme="light"] .content .navbar .dropdown-item {
    color: #495057;
}

[data-theme="light"] .content .navbar .dropdown-item:hover {
    background: #f0f2f5;
}

[data-theme="light"] .content .navbar .dropdown-menu {
    background: #ffffff;
    border: 1px solid #dee2e6;
}

/* Cards & panels */
[data-theme="light"] .bg-secondary {
    background-color: #ffffff !important;
    color: #212529;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

/* Text overrides */
[data-theme="light"] .text-light {
    color: #212529 !important;
}

[data-theme="light"] .text-muted {
    color: #6c757d !important;
}

[data-theme="light"] h1, [data-theme="light"] h2,
[data-theme="light"] h3, [data-theme="light"] h4,
[data-theme="light"] h5, [data-theme="light"] h6 {
    color: #212529;
}

/* Tables */
[data-theme="light"] .table {
    color: #212529;
}

[data-theme="light"] .table thead th {
    color: #495057;
    border-bottom-color: #dee2e6;
}

[data-theme="light"] .table td {
    border-bottom-color: #e9ecef;
}

[data-theme="light"] .table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Ensure forced-white table text stays readable in light mode */
[data-theme="light"] .table.text-white,
[data-theme="light"] .table.text-white td,
[data-theme="light"] .table.text-white th,
[data-theme="light"] .table.text-white a:not(.btn) {
    color: #212529 !important;
}

/* Forms */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #ced4da;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    background-color: #fff;
    color: #212529;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(228, 135, 23, 0.15);
}

[data-theme="light"] .form-floating label {
    color: #6c757d;
}

[data-theme="light"] .form-check-input {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

/* Pagination */
[data-theme="light"] .page-link {
    background-color: #ffffff;
    color: var(--primary);
    border-color: #dee2e6;
}

[data-theme="light"] .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Badges */
[data-theme="light"] .badge.bg-dark {
    background-color: #e9ecef !important;
    color: #212529;
}

/* Alerts */
[data-theme="light"] .alert-info {
    background-color: #cff4fc;
    color: #055160;
    border-color: #b6effb;
}

[data-theme="light"] .alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-color: #ffecb5;
}

[data-theme="light"] .alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

[data-theme="light"] .alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

/* Borders */
[data-theme="light"] .border-bottom {
    border-color: #dee2e6 !important;
}

/* Collapse detail rows */
[data-theme="light"] .collapse .bg-dark,
[data-theme="light"] .collapsing .bg-dark {
    background-color: #f8f9fa !important;
}

/* Chart containers */
[data-theme="light"] canvas {
    filter: none;
}

/* Theme toggle button */
[data-theme="light"] #themeToggle {
    border-color: #495057;
    color: #495057;
}

[data-theme="light"] #themeToggle:hover {
    background-color: #f0f2f5;
}

/* Pre/code */
[data-theme="light"] pre,
[data-theme="light"] code {
    color: #212529;
}

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e9ecef;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

[data-theme="light"] .sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

[data-theme="light"] .sidebar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

/* Dropdown divider */
[data-theme="light"] .dropdown-divider {
    border-color: #dee2e6;
}
