:root{
    --green-deep:#308f59;
    --green-dark:#225a3a;
    --peach:#ffedd8;
    --mint:#cef3de;
    --text-dark:#0e0e0e;
    --sidebar-w:220px;
}
*{box-sizing:border-box;margin:0;padding:0;}
body{
    font-family:'Poppins',sans-serif;
    color:var(--text-dark);
    background:#fff;
    font-size:13px;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;cursor:pointer;border:none;background:none;}

.app{
    display:flex;
    min-height:100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar{
    width:var(--sidebar-w);
    flex-shrink:0;

    background:var(--green-deep);
    border-radius:0 28px 28px 0;

    display:flex;
    flex-direction:column;

    padding:24px 20px;
    color:#fff;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:10px;

    margin-bottom:38px;
}
.sidebar-brand img{
    width:34px;
    height:40px;
    object-fit:contain;
    flex-shrink:0;
}
.sidebar-brand span{
    font-size:12px;
    font-weight:500;
    line-height:1.35;
}

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap:19px;
}
.sidebar-link{
    display:flex;
    align-items:center;
    gap:11px;

    font-size:13px;
    font-weight:400;
    line-height:1.3;
    color:rgba(255,255,255,.85);
}
.sidebar-link.active{
    font-weight:700;
    color:#fff;
}
.sidebar-link svg{flex-shrink:0;width:15px;height:15px;}

.sidebar-admin{
    margin-top:auto;
    display:flex;
    align-items:center;
    gap:10px;

    font-size:13px;
    font-weight:600;
    color:#fff;
}
.sidebar-admin svg{width:17px;height:17px;}

/* ---------- MAIN CONTENT ---------- */
.main-content{
    flex:1;
    padding:28px 34px 40px;
    min-width:0;
}

.page-title{
    font-size:24px;
    font-weight:600;
    margin-bottom:20px;
}

/* ---------- STAT CARDS ---------- */
.stat-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:18px;

    margin-bottom:20px;
}
.stat-card{
    background:var(--peach);
    border:1px solid rgba(0,0,0,.35);
    border-radius:12px;

    padding:14px 18px 20px;
}
.stat-card h3{
    font-size:17px;
    font-weight:500;
    margin-bottom:14px;
}
.stat-card p{
    font-size:32px;
    font-weight:500;
}

/* ---------- TABLE PANEL ---------- */
.table-panel{
    background:var(--mint);
    border-radius:18px;
    padding:20px 22px;
}

.table-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;

    margin-bottom:18px;
}

.search-box{
    display:flex;
    align-items:center;
    gap:8px;

    width:230px;
    max-width:100%;
    height:32px;

    background:var(--green-dark);
    border:1px solid rgba(0,0,0,.35);
    border-radius:12px;

    padding:0 13px;

    color:rgba(255,237,216,.85);
}
.search-box input{
    flex:1;
    border:none;
    background:transparent;
    outline:none;

    font-family:inherit;
    font-size:13px;
    color:#ffedd8;
}
.search-box input::placeholder{
    color:rgba(255,237,216,.73);
}

.toolbar-right{
    display:flex;
    gap:10px;
}

/* Dropdown status (select asli) */
.status-select-wrap{
    position:relative;
    display:flex;
    align-items:center;
}
.status-select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;

    height:32px;
    padding:0 28px 0 14px;

    background:var(--green-dark);
    border:1px solid rgba(0,0,0,.35);
    border-radius:12px;

    color:#ffedd8;
    font-family:inherit;
    font-size:13px;

    cursor:pointer;
}
.status-select:focus{
    outline:2px solid rgba(255,255,255,.4);
    outline-offset:1px;
}
.status-select option{
    color:#000;
    background:#fff;
}
.status-select-arrow{
    position:absolute;
    right:13px;
    pointer-events:none;
    color:#ffedd8;
}

.pill-btn{
    display:flex;
    align-items:center;
    gap:8px;

    height:32px;
    padding:0 14px;

    background:var(--green-dark);
    border:1px solid rgba(0,0,0,.35);
    border-radius:12px;

    color:#ffedd8;
    font-size:13px;
    font-weight:400;

    white-space:nowrap;
}

/* ---------- MORE FILTER DROPDOWN ---------- */
.filter-dropdown{
    position:relative;
}
.filter-menu{
    display:none;
    position:absolute;
    top:calc(100% + 6px);
    right:0;
    min-width:210px;

    background:#fff;
    border:1px solid rgba(0,0,0,.2);
    border-radius:11px;
    box-shadow:0 10px 30px rgba(0,0,0,.14);
    padding:6px;

    z-index:20;
}
.filter-menu.show{
    display:flex;
    flex-direction:column;
    gap:2px;
}
.filter-menu-item{
    display:block;
    width:100%;
    text-align:left;

    padding:8px 12px;
    border-radius:8px;

    font-size:12px;
    color:var(--text-dark);
}
.filter-menu-item:hover{
    background:var(--mint);
}
.filter-menu-item.reset{
    margin-top:3px;
    border-top:1px solid rgba(0,0,0,.1);
    padding-top:10px;
    border-radius:0 0 8px 8px;
    color:#c0392b;
}

/* ---------- TABLE ---------- */
.member-table{
    width:100%;
    border-collapse:collapse;
}
.member-table thead th{
    text-align:left;
    font-size:13px;
    font-weight:400;

    padding-bottom:12px;
    border-bottom:1px solid rgba(0,0,0,.2);
}
.member-table thead th:first-child{padding-left:4px;}
.member-table tbody td{
    font-size:13px;
    padding:11px 4px;
    border-bottom:1px solid rgba(0,0,0,.12);
    vertical-align:middle;
}
.member-table tbody tr:last-child td{border-bottom:none;}
.member-table tbody tr.hidden-row{display:none;}

.action-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    width:22px;height:22px;

    color:var(--text-dark);
}
.action-btn svg{width:14px;height:14px;}
.action-btn:hover{opacity:.6;}

/* ---------- TABLE FOOTER / PAGINATION ---------- */
.table-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;

    margin-top:16px;
}
.showing-text{
    font-size:13px;
}

.pagination{
    display:flex;
    align-items:center;
    gap:6px;

    background:#ffeec6;
    border:1px solid rgba(0,0,0,.35);
    border-radius:6px;

    padding:3px 6px;
}
.page-btn{
    min-width:16px;
    font-size:12px;
    color:var(--text-dark);
    padding:2px 4px;
    border-radius:4px;
}
.page-btn.active{
    font-weight:700;
}
.page-dots{
    font-size:12px;
    padding:0 2px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width:1100px){
    .stat-grid{grid-template-columns:1fr;}
    .member-table{display:block;overflow-x:auto;white-space:nowrap;}
}
@media (max-width:900px){
    .app{flex-direction:column;}
    .sidebar{
        width:100%;
        border-radius:0 0 28px 28px;
        flex-direction:row;
        align-items:center;
        flex-wrap:wrap;
        gap:16px;
    }
    .sidebar-nav{flex-direction:row;flex-wrap:wrap;}
    .sidebar-admin{margin-top:0;}
}

/* ---------- MODAL (Kelola Buku / Detail Buku) ---------- */
.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(14,14,14,.45);

    display:none;
    align-items:flex-start;
    justify-content:center;

    padding:60px 20px;
    overflow-y:auto;
    z-index:100;
}
.modal-overlay.show{
    display:flex;
}

.modal-box{
    position:relative;
    width:360px;
    max-width:100%;

    background:#fff;
    border-radius:22px;
    box-shadow:0 24px 60px rgba(0,0,0,.28);

    padding:32px 30px;
}

.modal-close{
    position:absolute;
    top:20px;
    right:20px;

    width:26px;height:26px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;

    color:var(--text-dark);
}
.modal-close:hover{
    background:rgba(0,0,0,.06);
}

.modal-title{
    font-size:19px;
    font-weight:600;
    margin-bottom:18px;
}

.modal-book-title{
    font-size:15px;
    font-weight:600;
    margin-bottom:3px;
}
.modal-book-sub{
    font-size:12px;
    color:rgba(14,14,14,.55);
    margin-bottom:18px;
}

.modal-field{
    margin-bottom:16px;
}
.modal-label{
    display:block;
    font-size:13px;
    font-weight:500;
    margin-bottom:8px;
}

.status-badge{
    display:inline-flex;
    align-items:center;

    padding:5px 18px;
    border-radius:20px;

    background:var(--green-deep);
    color:#fff;
    font-size:12px;
    font-weight:600;
}
.status-badge.inactive{
    background:#c0392b;
}

.modal-select,
.modal-input{
    width:100%;
    height:40px;

    border:1px solid rgba(0,0,0,.2);
    border-radius:10px;

    padding:0 14px;

    font-family:inherit;
    font-size:13px;
    color:var(--text-dark);
    outline:none;
    background:#fff;
}
.modal-select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;

    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%230e0e0e' stroke-width='1.5' fill='none'/></svg>");
    background-repeat:no-repeat;
    background-position:right 14px center;
}
.modal-select:focus,
.modal-input:focus{
    border-color:var(--green-deep);
}

.modal-actions{
    display:flex;
    gap:14px;
    margin-top:8px;
}
.modal-btn{
    flex:1;
    height:42px;

    border-radius:22px;

    font-size:14px;
    font-weight:600;

    display:flex;
    align-items:center;
    justify-content:center;
}
.modal-btn.outline{
    background:#fff;
    border:1px solid rgba(0,0,0,.25);
    color:var(--text-dark);
}
.modal-btn.outline:hover{
    background:rgba(0,0,0,.05);
}
.modal-btn.filled{
    background:var(--green-deep);
    color:#fff;
}
.modal-btn.filled:hover{
    background:var(--green-dark);
}

/* Detail Buku rows */
.detail-header{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;

    margin-bottom:6px;
}
.detail-header .judul{
    font-size:16px;
    font-weight:600;
}
.detail-header .id{
    font-size:13px;
    color:rgba(14,14,14,.55);
    white-space:nowrap;
}

.detail-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;

    padding:11px 0;
    border-bottom:1px solid rgba(0,0,0,.08);

    font-size:13px;
}
.detail-row:last-child{
    border-bottom:none;
}
.detail-row .label{
    color:rgba(14,14,14,.6);
}
.detail-row .value{
    font-weight:600;
    text-align:right;
}