/* ===== ACCORDION FIX ===== */

[data-bs-theme="light"] .accordion-button {
    background: #fff !important;
    color: #374151 !important;
}

[data-bs-theme="light"] .accordion-body {
    background: #fff !important;
    color: #374151 !important;
}

[data-bs-theme="light"] .accordion-button::after {
    background-color: transparent !important;
    box-shadow: none !important;
    background-image: var(--bs-accordion-btn-icon) !important;
    filter: none !important;
}

/* ===== DARK MODE VARIABLES ===== */

[data-bs-theme="dark"] {
    --bs-body-bg: #0b1220 !important;
    --bs-paper-bg: #172033 !important;
    --bs-body-color: #e5e7eb !important;
    --bs-heading-color: #ffffff !important;
    --bs-border-color: #334155 !important;
}

/* ===== BODY ===== */

[data-bs-theme="dark"] body {
    background: linear-gradient(
        135deg,
        #0b1220 0%,
        #111827 50%,
        #0f172a 100%
    ) !important;
    color: var(--bs-body-color) !important;
}

/* ===== CARDS ===== */

[data-bs-theme="dark"] .card {
    background: #172033 !important;
    border: 1px solid #2a3954 !important;
    box-shadow: 0 0 25px rgba(0,0,0,.35);
    color: #e5e7eb !important;
}

/* ===== ACCORDION DARK ===== */

[data-bs-theme="dark"] .accordion-item {
    background: #172033 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .accordion-button {
    background: #172033 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background: #1d2a42 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .accordion-body {
    background: #172033 !important;
    color: #e5e7eb !important;
}

[data-bs-theme="dark"] .accordion-button::after {
    background-color: transparent !important;
    box-shadow: none !important;
    background-image: var(--bs-accordion-btn-icon) !important;
    filter: brightness(0) invert(1) !important;
}

/* ===== FORMS ===== */

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #243041 !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-control:focus {
    border-color: #7367f0 !important;
    box-shadow: 0 0 0 0.15rem rgba(115,103,240,.25) !important;
}

[data-bs-theme="dark"] .form-label {
    color: #f1f5f9 !important;
}

/* ===== TEXT ===== */

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .text-muted {
    color: #cbd5e1 !important;
}

/* ===== NAVBAR ===== */

[data-bs-theme="dark"] .layout-navbar,
[data-bs-theme="dark"] .navbar-detached {
    background: #172033 !important;
    color: #e5e7eb !important;
}

/* ===== SIDEBAR ===== */

[data-bs-theme="dark"] .bg-menu-theme {
    background: #1a2433 !important;
}

[data-bs-theme="dark"] .bg-menu-theme *,
[data-bs-theme="dark"] .menu-link,
[data-bs-theme="dark"] .menu-icon,
[data-bs-theme="dark"] .app-brand-text,
[data-bs-theme="dark"] .menu-header-text {
    color: #dbe4ff !important;
}

[data-bs-theme="dark"] .bg-menu-theme .menu-item.active > .menu-link {
    background: #7367f0 !important;
    color: #fff !important;
    border-radius: .375rem !important;
    box-shadow: 0 2px 6px rgba(115,103,240,.48) !important;
}

[data-bs-theme="dark"] .bg-menu-theme .menu-link:hover {
    background: rgba(115,103,240,.16) !important;
    color: #fff !important;
}

/* ===== TABLES ===== */

[data-bs-theme="dark"] table,
[data-bs-theme="dark"] .table {
    color: #e5e7eb !important;
}

/* ===== THEME BUTTON ===== */

#themeToggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transition: all .2s ease;
}

#themeToggle:hover {
    background: rgba(115,103,240,.15) !important;
    color: #7367f0 !important;
    border-color: #7367f0 !important;
}

[data-bs-theme="dark"] .btn:hover,
[data-bs-theme="dark"] .btn:focus {
    background-color: #7367f0 !important;
    color: #fff !important;
    border-color: #7367f0 !important;
}

.btn:hover {
    background-color: #7367f0 !important;
    color: #fff !important;
    border-color: #7367f0 !important;
}