:root{
    --primary:#2f9e44;
    --primary-hover:#2b8a3e;
    --background:#f5f7fb;
    --surface:#ffffff;
    --border:#e5e7eb;
    --text:#1f2937;
    --text-light:#6b7280;
    --danger:#dc2626;
    --shadow:0 10px 30px rgba(0,0,0,.08);
    --radius:18px;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Inter,system-ui,sans-serif;
}

body{
    background:var(--background);
    color:var(--text);
    display:flex;
    min-height:100vh;
}

.sidebar{
    width:220px;
    background:var(--surface);
    border-right:1px solid var(--border);
    padding:30px 20px;
    display:flex;
    flex-direction:column;
    gap:40px;
}

.sidebar-logo{
    display:flex;
    align-items:center;
    gap:30px;
}

.sidebar-logo img{
    width:48px;
    height:48px;
}

.sidebar-logo h2{
    font-size:22px;
    font-weight:700;
}

.sidebar-menu{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.menu-item{
    border:none;
    background:transparent;
    padding:14px 16px;
    border-radius:12px;
    cursor:pointer;
    text-align:left;
    font-size:15px;
    font-weight:600;
    transition:.25s;
}

.menu-item:hover{
    background:#eef8f0;
}

.menu-item.active{
    background:var(--primary);
    color:#fff;
}

.wrapper{
    flex:1;
    display:flex;
    flex-direction:column;
}

.header{
    background:var(--surface);
    border-bottom:1px solid var(--border);
    padding:20px 30px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.header h1{
    font-size:28px;
    font-weight:700;
}

.header p{
    color:var(--text-light);
    margin-top:6px;
}

.header-user{
    background:#eef8f0;
    color:var(--primary);
    padding:12px 18px;
    border-radius:999px;
    font-weight:600;
}

main{
    padding:25px;
    display:flex;
    flex-direction:column;
    gap:28px;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

.stats-card{
    background:var(--surface);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    min-height: 120px;
    cursor:pointer;
    transition:.25s;
    position:relative;
}
.card-badge{
    position:absolute;
    top:16px;
    right:16px;
    padding:5px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    background:#f3f4f6;
    color:#6b7280;
    border:1px solid #d1d5db;
    transition:.25s;
}

.card-badge.active{
    background:#dcfce7;
    color:#15803d;
    border-color:#22c55e;
}
.stats-card:hover{
    transform:translateY(-4px);
    box-shadow:0 16px 35px rgba(0,0,0,.12);
}
.stats-card h3{
    color:var(--text-light);
    font-size:15px;
    font-weight:500;
}

.stats-card h2{
    margin-top:12px;
    font-size:34px;
}

.chart-card,
.table-card{
    background:var(--surface);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:18px;
}
.toolbar{
    background:var(--surface);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:24px;
}
.chart-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    width:100%;
}
.chart-card{
    min-height:160px;
    width:100%;
    height:auto;
}

.card-title{
    margin-bottom:20px;
}

.toolbar{
    display:grid;
    grid-template-columns:2fr 1fr 1fr;
    gap:16px;
}

.toolbar input,
.toolbar select{
    width:100%;
    height:48px;
    border:1px solid var(--border);
    border-radius:12px;
    padding:0 16px;
    font-size:15px;
    outline:none;
}

.toolbar input{
    flex:1;
}

.toolbar input:focus,
.toolbar select:focus{
    border-color:var(--primary);
}

table{
    width:100%;
    border-collapse:collapse;
}
.table-info{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:16px;
    font-size:14px;
    color:var(--text-light);
    font-weight:600;
}
thead{
    background:#f9fafb;
}

th{
    padding:16px;
    text-align:left;
    font-size:14px;
}

td{
    padding:16px;
    border-top:1px solid var(--border);
    font-size:14px;
}

tbody tr{
    transition:.2s;
}

tbody tr:hover{
    background:#fafafa;
}

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999;
}

.modal.show{
    display:flex;
}

.modal-content{
    width:700px;
    max-width:95%;
    background:#fff;
    border-radius:18px;
    overflow:hidden;
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 24px;
    border-bottom:1px solid #eee;
}

.modal-header h2{
    margin:0;
}

.modal-header button{
    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
}

.modal-body{
    padding:24px;
    max-height:70vh;
    overflow:auto;
}

#closeModal{
    position:absolute;
    right:20px;
    top:20px;
    border:none;
    background:none;
    cursor:pointer;
    font-size:22px;
}
.pagination{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:20px;
}

.pagination button{
    border:none;
    background:var(--primary);
    color:#fff;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
    transition:.25s;
}

.pagination button:hover{
    background:var(--primary-hover);
}

.pagination button:disabled{
    opacity:.5;
    cursor:not-allowed;
}

#pageInfo{
    font-weight:600;
    color:var(--text-light);
}

.detail-section{
    margin-bottom:28px;
}

.detail-section h3{
    margin-bottom:14px;
    color:var(--primary);
}

.detail-table{
    width:100%;
    border-collapse:collapse;
}

.detail-table td{
    padding:10px 12px;
    border-bottom:1px solid #eee;
}

.detail-table td:first-child{
    width:180px;
    font-weight:600;
    color:#666;
}

#openSpreadsheet{
    margin-top:20px;
    padding:15px 30px;
    border:gray;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    cursor:pointer;
    font-weight:600;
    cursor: pointer;
}

#openPemakaian{
    margin-top:20px;
    padding:15px 30px;
    border:gray;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    cursor:pointer;
    font-weight:600;
    cursor: pointer;
}

#openRiwayat{
    margin-top:20px;
    padding:15px 30px;
    border:gray;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    cursor:pointer;
    font-weight:600;
    cursor: pointer;
}

#openSpreadsheet:hover{
    opacity:.9;
}

#adminPassword{
    width:100%;
    padding:12px;
    border:1px solid #ddd;
    border-radius:10px;
    font-size:15px;
    outline:none;
}

#adminPassword.error{
    border-color:#ef4444;
}

#loginError{
    color:#ef4444;
    font-size:13px;
    margin-top:10px;
    min-height:18px;
}
.form-group{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-bottom:18px;
}

.form-group label{
    font-weight:600;
    color:#374151;
}

.form-group input,
.form-group select,
.form-group textarea{
    width:100%;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font-size:14px;
    outline:none;
    transition:.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{
    border-color:var(--primary);
}

#savePemakaian{
    width:100%;
    padding:14px;
    border:none;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
}

#savePemakaian:hover{
    opacity:.9;
}
.form-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}

.search-result{
    margin-top:8px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    overflow:hidden;
    max-height:220px;
    overflow-y:auto;
    background:#fff;
}

.search-item{
    padding:12px 14px;
    cursor:pointer;
    transition:.2s;
    border-bottom:1px solid #f3f4f6;
}

.search-item:last-child{
    border-bottom:none;
}

.search-item:hover{
    background:#f3f4f6;
}

.search-item strong{
    display:block;
    font-size:14px;
}

.search-item small{
    color:#6b7280;
}
@media(max-width:600px){
    .chart-grid{
        grid-template-columns:1fr;
    }
}
@media(max-width:1100px){

    .stats-grid{
        grid-template-columns:repeat(2,1fr);
    }

}

@media(max-width:900px){

    body{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        border-right:none;
        border-bottom:1px solid var(--border);
    }

    .toolbar{
        flex-direction:column;
    }

}

@media(max-width:600px){

    .stats-grid{
        grid-template-columns:1fr;
    }

    .header{
        padding:20px;
    }

    main{
        padding:20px;
    }

}