/* ==========================================================
   JUOS PANEL - MODERN UI & ELEGANT THEME STYLING
   ========================================================== */

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ----------------------------------------------------------
   1. FORM INPUT, SELECT, & TEXTAREA MODERN STYLING
   ---------------------------------------------------------- */
.form-control, .form-select {
    background-color: var(--bs-body-bg, #ffffff) !important;
    color: var(--bs-body-color, #212529) !important;
    border: 1px solid var(--bs-border-color, #ced4da) !important;
    border-radius: 0.5rem !important;
    padding: 0.55rem 0.85rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bs-body-bg, #ffffff) !important;
    color: var(--bs-body-color, #212529) !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Deteksi Dark Mode untuk Input Form */
[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select,
.dark .form-control,
.dark .form-select,
body.dark-mode .form-control,
body.dark-mode .form-select,
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #1a1d20 !important;
    color: #f8f9fa !important;
    border-color: #2b3035 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .form-control:focus, 
[data-bs-theme="dark"] .form-select:focus,
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

::placeholder {
    color: #adb5bd !important;
    opacity: 0.8;
}

/* ----------------------------------------------------------
   2. CARD & MODAL ELEGAN DENGAN SOFT SHADOW
   ---------------------------------------------------------- */
.card {
    border-radius: 1rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.05)) !important;
}

.modal-content {
    border-radius: 1rem !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
}

/* ----------------------------------------------------------
   3. TABEL MODERN, BERSIH & ELEGAN (ADAPTIF LIGHT & DARK)
   ---------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
    border-color: var(--bs-border-color, #dee2e6);
    vertical-align: middle;
}

/* Header Tabel Warna Biru Terang untuk Mode Terang */
.table thead, 
.table.table-dark thead, 
.table thead.table-dark, 
thead.table-dark {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.table thead th, 
.table.table-dark thead th, 
.table thead.table-dark th, 
thead.table-dark th {
    background-color: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.85rem 0.75rem;
}

/* Otomatis Berubah Gelap Ketika Dark Mode Aktif (Mendeteksi berbagai atribut tema) */
[data-bs-theme="dark"] .table thead,
[data-bs-theme="dark"] .table.table-dark thead,
[data-bs-theme="dark"] thead.table-dark,
.dark-mode .table thead,
body.dark-mode .table thead,
html.dark .table thead,
body.dark .table thead {
    background-color: #212529 !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table.table-dark thead th,
[data-bs-theme="dark"] thead.table-dark th,
.dark-mode .table thead th,
body.dark-mode .table thead th,
html.dark .table thead th,
body.dark .table thead th {
    background-color: transparent !important;
    color: #f8f9fa !important;
    border-bottom: 2px solid #2b3035 !important;
}

/* ==========================================================
   UNIVERSAL DARK MODE OVERRIDE UNTUK ELEMEN BER-BACKGROUND TERANG (.bg-light)
   ========================================================== */
html.dark .bg-light,
body.dark .bg-light,
[data-bs-theme="dark"] .bg-light,
body.dark-mode .bg-light,
html[data-bs-theme="dark"] .bg-light,
.dark-mode .bg-light,
.dark .bg-light {
    background-color: #f8f9fa !important;
    color: #111111 !important;
}

html.dark .bg-light *,
body.dark .bg-light *,
[data-bs-theme="dark"] .bg-light *,
body.dark-mode .bg-light *,
html[data-bs-theme="dark"] .bg-light *,
.dark-mode .bg-light *,
.dark .bg-light * {
    color: #111111 !important;
}

/* Pengecualian khusus untuk badge sukses agar warnanya tetap kontras bagus */
[data-bs-theme="dark"] .bg-light .badge.bg-success,
body.dark-mode .bg-light .badge.bg-success {
    color: #ffffff !important;
}

    /* Header Tabel Adaptif (Biru tema saat mode terang, Gelap saat mode malam) */
    .table-custom-header {
        background-color: #0d6efd !important;
        color: #fff !important;
    }
    [data-bs-theme="dark"] .table-custom-header,
    .dark-mode .table-custom-header,
    body.dark .table-custom-header {
        background-color: #212529 !important;
        color: #f8f9fa !important;
    }
    .table td, .table th {
        vertical-align: middle;
    }