* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #0f172a;
    display: flex;
    min-height: 100vh;
}

.mobile-header {
    display: none;
    background: #ffffff;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #cbd5e1;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.mobile-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: #2563eb;
}

.menu-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #cbd5e1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.brand {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 2rem;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: block;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-item.active a, .nav-item a:hover {
    background: #eff6ff;
    color: #2563eb;
    border-left: 4px solid #2563eb;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: hidden;
}

.header h1 {
    font-size: 1.4rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.header p {
    color: #475569;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* TABEL UTAMA */
.table-container {
    overflow-x: auto;
    background: transparent;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    background: #ffffff;
}

th {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.65rem 0.5rem;
    border-bottom: 2px solid #cbd5e1;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    text-align: center;
}

/* ZEBRA STRIPING BARIS GANJIL & GENAP */
tbody tr.clickable-row:nth-child(4n+1) {
    background-color: #ffffff;
}
tbody tr.clickable-row:nth-child(4n+3) {
    background-color: #f8fafc;
}

tr.clickable-row:hover td {
    background-color: #f0f9ff !important;
}

tr.clickable-row.active-row td {
    background-color: #e0f2fe !important;
}

/* FREEZE KOLOM PERTAMA (NAMA DESA / PPL) */
.col-text {
    text-align: left !important;
    min-width: 170px;
    white-space: nowrap;
    text-transform: uppercase; /* KAPITAL */
}

th.sticky-col, td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: inherit;
    border-right: 2px solid #cbd5e1;
}

th.sticky-col {
    z-index: 10;
    background-color: #f1f5f9;
}

.col-number {
    min-width: 65px;
    max-width: 90px;
}

/* INNER TABLE REKAP PPL */
tr.detail-row {
    display: none;
}

tr.detail-row.open {
    display: table-row !important;
}

.inner-box {
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.inner-box h4 {
    margin-bottom: 0.5rem;
    color: #2563eb;
    font-size: 0.85rem;
    text-align: left;
    text-transform: uppercase;
}

.inner-table {
    width: 100%;
    border: 1px solid #cbd5e1;
}

.inner-table th {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.5rem;
}

.inner-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.inner-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* RESPONSIVE HP */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .mobile-header { display: flex; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 1100;
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0,0,0,0.15);
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { padding: 0.85rem; }
}

/* Pewarnaan Kategori Header Tabel */
th.header-orange {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
    border-bottom: 2px solid #f97316 !important;
}

th.header-green {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border-bottom: 2px solid #22c55e !important;
}

th.header-red {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border-bottom: 2px solid #ef4444 !important;
}