* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    display: flex;
    background-color: #f4f6f9;
    color: #333;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #1e293b;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 1.2rem;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    color: #38bdf8;
}

.sidebar ul {
    list-style: none;
    margin-top: 15px;
}

.sidebar li {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar li:hover, .sidebar li.active {
    background-color: #0f172a;
    color: #38bdf8;
    border-left: 4px solid #38bdf8;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

header h1 {
    font-size: 1.6rem;
    color: #0f172a;
}

header p {
    color: #64748b;
    font-size: 0.9rem;
}

.btn-refresh {
    background: #0284c7;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: #0369a1;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#searchInput {
    width: 280px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
}

#searchInput:focus {
    border-color: #0284c7;
}

.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;    
    min-width: 75px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
}

tr:hover {
    background-color: #f8fafc;
}

.status-msg {
    text-align: center;
    color: #64748b;
    padding: 30px !important;
}

/* Styling Tombol & Form */
.btn-primary {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-primary:hover { background: #059669; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; color: #334155; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: #0ea5e9; }

/* Styling Modal Pop-up */
.modal {
    display: none; 
    position: fixed; 
    z-index: 999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    align-items: center;
    justify-content: center;
}
.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h2 { font-size: 1.3rem; margin-bottom: 20px; color: #0f172a; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;}
.close { position: absolute; right: 20px; top: 20px; font-size: 24px; font-weight: bold; color: #94a3b8; cursor: pointer; }
.close:hover { color: #ef4444; }

/* Styling Tombol Aksi di Tabel */
.btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 12px;
    transition: color 0.2s, transform 0.2s;
}
.btn-icon:hover {
    transform: scale(1.1);
}
.btn-icon.edit { color: #0ea5e9; }      /* Biru untuk Edit */
.btn-icon.edit:hover { color: #0284c7; }
.btn-icon.delete { color: #ef4444; }    /* Merah untuk Hapus */
.btn-icon.delete:hover { color: #dc2626; }

/* ================================================= */
/* MEDIA QUERIES UNTUK RESPONSIVE (TABLET & MOBILE)  */
/* ================================================= */

/* Layar Tablet & iPad (Lebar max 1024px) */
@media screen and (max-width: 1024px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        padding: 15px;
    }
    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 10px;
    }
    .sidebar li {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        background-color: #0f172a;
        border-radius: 4px;
    }
    .sidebar li.active {
        border-bottom: 3px solid #38bdf8;
    }
    .main-content {
        padding: 15px;
    }
}

/* Layar HP / Android / iPhone (Lebar max 768px) */
@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    header > div h1 {
        font-size: 1.3rem;
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #searchInput {
        width: 100% !important;
    }
    /* Kotak Filter Rekap di HP */
    #rekapView .card-header > div {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }
    #rekapView input[type="date"], 
    #rekapView select, 
    #rekapView button {
        width: 100% !important;
    }
    .modal-content {
        width: 95% !important;
        padding: 15px;
    }
}

/* ================================================= */
/* HAMBURGER MENU & RESPONSIVE SIDEBAR DRAWER        */
/* ================================================= */

.hamburger-btn {
    display: none; /* Sembunyikan di PC */
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #0f172a;
    cursor: pointer;
    padding: 5px 10px 5px 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
}

.close-sidebar {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
}

/* Background gelap transparan saat sidebar HP dibuka */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* Media Query untuk Tablet & HP (Max 1024px) */
@media screen and (max-width: 1024px) {
    .hamburger-btn {
        display: block; /* Munculkan tombol burger */
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Sembunyikan sidebar di luar layar sebelah kiri */
        width: 280px;
        height: 100%;
        z-index: 999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    }
    .sidebar.active {
        left: 0; /* Munculkan sidebar saat aktif */
    }
    .sidebar-header h2 {
        border-bottom: none;
        padding: 0;
    }
    .close-sidebar {
        display: block; /* Munculkan tombol X di dalam menu HP */
    }
    .sidebar ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 0;
    }
    .sidebar li {
        padding: 12px 20px;
        border-left: 4px solid transparent;
        border-bottom: none;
        background: transparent;
        border-radius: 0;
    }
    .sidebar li.active {
        background-color: #0f172a;
        border-left: 4px solid #38bdf8;
        border-bottom: none;
    }
    .sidebar-overlay.active {
        display: block;
    }
    body {
        flex-direction: row; /* Kembalikan flex row agar main content tidak turun */
    }
}

@media screen and (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .header-right {
        display: flex;
        gap: 5px;
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #searchInput {
        width: 100% !important;
    }
    #rekapView .card-header > div {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }
    #rekapView input[type="date"], 
    #rekapView select, 
    #rekapView button {
        width: 100% !important;
    }
}

/* ================================================= */
/* TAMPILAN HALAMAN LOGIN                             */
/* ================================================= */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #68512f;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.login-card {
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 12px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
    color: #15264b;
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.login-card p {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 25px;
}