[data-bs-theme="light"] {
    --bs-primary: #0d6efd;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-teal: #20c997;
    --bs-secondary: #6c757d;
    --bs-indigo: #6610f2;
    --bs-orange: #fd7e14;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-navbar: #212529;
    --bg-notif-unread: #f0f8ff;
    --bg-notif-read: #ffffff;
    --bg-notif-hover: #e9ecef;
    --bg-modal-header: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow-modal: rgba(0, 0, 0, 0.3);
    --shadow-btn: rgba(0, 0, 0, 0.2);
    --icon-sun-display: inline-block;
    --icon-moon-display: none;
}

[data-bs-theme="dark"] {
    --bs-primary: #5dade2;
    --bs-success: #00bc8c;
    --bs-danger: #e74c3c;
    --bs-warning: #f39c12;
    --bs-teal: #20c997;
    --bs-secondary: #6c757d;
    --bs-indigo: #6610f2;
    --bs-orange: #fd7e14;
    --bg-body: #212529;
    --bg-card: #343a40;
    --bg-navbar: #000000;
    --bg-notif-unread: #1a1a2e;
    --bg-notif-read: #343a40;
    --bg-notif-hover: #495057;
    --bg-modal-header: #343a40;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #adb5bd;
    --border-color: #495057;
    --shadow-modal: rgba(0, 0, 0, 0.6);
    --shadow-btn: rgba(255, 255, 255, 0.1);
    --icon-sun-display: none;
    --icon-moon-display: inline-block;
}

[data-bs-theme="dark"] .card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .modal-header {
    background-color: var(--bg-modal-header) !important;
    border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: var(--bg-card);
    --bs-table-border-color: var(--border-color);
}

[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] table.dataTable thead th {
    background-color: var(--bg-modal-header) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-bs-theme="dark"] table.dataTable tbody td {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .fc {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .fc-daygrid-day {
    background-color: var(--bg-card);
}

[data-bs-theme="dark"] .fc-col-header-cell {
    background-color: var(--bg-modal-header) !important;
}

[data-bs-theme="dark"] .fc-button {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .fc-button:hover {
    background-color: #2c4a6a !important;
}

[data-bs-theme="dark"] .fc-event {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .shadow-sm,
[data-bs-theme="dark"] .shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5) !important;
}

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

[data-bs-theme="dark"] .toast {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-notif-hover);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0;
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 3px 6px var(--shadow-btn);
}

#theme-toggle i {
    font-size: 1.1rem;
}

#theme-toggle .bi-sun { display: var(--icon-sun-display); }
#theme-toggle .bi-moon-stars { display: var(--icon-moon-display); }
