body {
    background-color: #f5f5f5;
    padding-top: 65px;
    /* sesuaikan dengan tinggi navbar */
}

.navbar-brand {
    font-weight: bold;
}

/* SIDEBAR / OFFCANVAS */
#sidebar {
    width: 260px;
    background: #2f3640;
    color: white;
    min-height: 100vh;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    transition: all 0.3s ease-in-out;
    z-index: 9999;
    margin-top: 60px;
    /* <<< FIX AGAR TIDAK MENUTUP HEADER */
}

/* AGAR KONTEN TIDAK TUMPAK */
#content {
    margin-left: 260px;
    padding: 20px;
    margin-top: 0px;
    /* agar konten tidak tertutup header di HP */
}

/* MODE HP – SIDEBAR DISSEMBUNYIKAN */
@media(max-width: 768px) {
    #sidebar {
        left: -260px;
        /* margin-top: 60px;  sidebar tetap turun */
    }

    #sidebar.active {
        left: 0;
    }

    #content {
        margin-left: 0;
        /* margin-top: 70px;   supaya konten tidak mentok ke navbar */
    }

    #menuToggleBtn {
        display: block !important;
    }

    #closeSidebar {
        display: block;
    }
}

/* TOMBOL HAMBURGER */
#menuToggleBtn {
    display: none;
    font-size: 26px;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
}

.active-menu {
    background: #00a8ff;
    color: white !important;
    border-radius: 6px;
    font-weight: bold;
}

.active-menu:hover {
    background: #0097e6;
}

.card-box {
    background: #4a78b8;
    color: white;
    padding: 20px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    font-size: 20px;
}

.count {
    font-size: 32px;
    font-weight: bold;
    margin-top: 10px;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    /* di bawah sidebar */
}

#overlay.active {
    display: block;
}

/* DARK MODE */
body.dark-mode {
    background-color: #1e272e;
    color: #d2dae2;
}

.navbar.dark-mode {
    background-color: #141417ff !important;
}

#sidebar.dark-mode {
    background: #141417ff;
}

.card-box.dark-mode {
    background: #485460 !important;
}

.dark-mode .nav-link {
    color: #d2dae2 !important;
}

.dark-mode .active-menu {
    background: #0fbcf9 !important;
    color: #000 !important;
}

/* ===== DARK MODE IMPROVEMENTS ===== */
.dark-mode table {
    background: #2d2d2d;
    color: #FFF;
}

.dark-mode table th {
    background: #3b3b3b !important;
    color: #FFF;
    border-color: #555;
}

.dark-mode table td {
    background: #2f2f2f;
    border-color: #444;
}

.dark-mode .btn-primary,
.dark-mode .btn-success,
.dark-mode .btn-info {
    background-color: #0097e6;
    color: white !important;
    border: none;
}

.dark-mode .btn-secondary,
.dark-mode .btn-outline-secondary {
    background: #57606f;
    color: white;
    border: none;
}

.dark-mode select,
.dark-mode input,
.dark-mode textarea {
    background: #2f3640 !important;
    color: #FFF !important;
    border: 1px solid #555 !important;
}

.dark-mode .badge-success {
    background: #2ecc71 !important;
}

.dark-mode .badge-danger {
    background: #e74c3c !important;
}

.dark-mode .badge-warning {
    background: #f39c12 !important;
    color: #000;
}

.dark-mode .card,
.dark-mode .filter-area,
.dark-mode .table-responsive {
    background: #2f3640 !important;
    border-color: #555 !important;
}

.dark-mode table tbody tr:hover {
    background: #3d3d3d !important;
}

/* ===== MODAL KHUSUS DARK MODE ===== */

/* Background modal */
body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #eaeaea !important;
}

/* Header & Footer modal */
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #444 !important;
}

/* Title modal */
body.dark-mode .modal-title {
    color: #f0f0f0;
    font-weight: bold;
}

/* Label input/modal */
body.dark-mode label {
    color: #cdd1da !important;
}

/* Input / Select / Textarea */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #555 !important;
}

/* Saat focus/klik */
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border: 1px solid #0097e6 !important;
    outline: none;
    box-shadow: none;
}

/* Dropdown option */
body.dark-mode select option {
    background-color: #2a2a2a;
    color: #fff;
}

/* Tombol Simpan & Batal */
body.dark-mode .btn-primary {
    background: #007bff !important;
    border-color: #007bff !important;
}

body.dark-mode .btn-secondary {
    background: #555 !important;
    border-color: #666 !important;
}

/* LIGHT MODE (default) */
.table-sm th {
    width: 180px;
}

img {
    transition: 0.3s;
    cursor: zoom-in;
}

img:hover {
    transform: scale(1.03);
}

.foto-wrapper {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
}

.foto-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
        DARK MODE VERSION
        Ketika body punya class: dark-mode
        ========================= */
body.dark-mode .table-sm th {
    background: #202020;
    color: #fff;
}

body.dark-mode .table-sm td {
    background: #292929;
    color: #ddd;
}

body.dark-mode .foto-wrapper {
    background: #333;
    border-color: #555;
}

body.dark-mode .foto-wrapper img {
    filter: brightness(0.9);
}

body.dark-mode img:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.modal {
    z-index: 99999;
    /* di bawah sidebar */
}

/* ===== FIXED FOOTER ===== */
.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: center;
    border-top: 1px solid #ddd;
    z-index: 999;
    font-size: 14px;
}

/* Agar konten tidak ketutup footer */
body {
    padding-bottom: 60px !important;
}

/* FOOTER DARK MODE */
body.dark-mode .footer-fixed {
    background: #141417ff !important;
    color: #d2dae2 !important;
    border-color: #333;
}

.card-clickable {
    cursor: pointer;
    transition: 0.2s;
}

.card-clickable:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.autocomplete-box {
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    position: absolute;
    z-index: 9999;
    width: 100%;
    display: none;
}

.search-item {
    padding: 8px;
    cursor: pointer;
}

.search-item:hover {
    background: #f0f0f0;
}

/* Container input dan tombol + */
.input-with-plus {
    display: flex;
    align-items: center;
    gap: 6px;
    /* jarak antara input & tombol */
}

/* Tombol plus kecil */
.btn-plus {
    padding: 6px 10px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Agar autocomplete box menempel dengan input */
.position-relative {
    position: relative !important;
}

/* Box autocomplete */
.autocomplete-box {
    border: 1px solid #ddd;
    background: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border-radius: 4px;
}

.search-item {
    padding: 8px;
    cursor: pointer;
}

.search-item:hover {
    background: #f5f5f5;
}

.search-empty {
    background: #fafafa;
    border-top: 1px solid #ddd;
    padding: 15px;
}

.autocomplete-box button {
    width: 100%;
}

.empty-row td {
    border-top: none !important;
    border-bottom: none !important;
    height: 20px !important;
    padding: 0 !important;
}

.text-end {
    text-align: right;
}

/* ===== SELECT2 = FORM-CONTROL ===== */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    /* tinggi default form-control */
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    display: flex;
    align-items: center;
    /* CENTER vertical */
}

/* Text di tengah */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    line-height: normal;
    color: #495057;
}

/* Arrow sejajar */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    top: 1px;
}

/* Fokus */
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}