* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    font-family: Arial, Helvetica, sans-serif;
    color: #20242a;
}


/* =====================================================
   NAVBAR
===================================================== */

.navbar-admin {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 78px;
    background: #ffffff;

    display: flex;
    align-items: center;
    gap: 30px;

    padding: 0 35px;

    border-bottom: 1px solid #e8ebf0;

    z-index: 1000;
}


.logo-area {
    width: 240px;

    display: flex;
    align-items: center;
    gap: 12px;
}


.logo-icon {
    width: 45px;
    height: 45px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 12px;

    background: #e8f1ff;
    color: #276fd6;

    font-size: 24px;
}


.logo-area h4 {
    margin: 0;

    font-size: 18px;
    font-weight: 800;
}


.logo-area small {
    color: #7a8089;
    font-size: 11px;
}


.pencarian-navbar {
    flex: 1;

    max-width: 600px;

    height: 46px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 18px;

    background: #f7f8fa;

    border: 1px solid #e2e5e9;
    border-radius: 25px;
}


.pencarian-navbar i {
    color: #7a8089;
}


.pencarian-navbar input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;

    font-size: 14px;
}


.profil-navbar {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 17px;
}


.notifikasi {
    position: relative;

    border: none;
    background: transparent;

    font-size: 20px;

    cursor: pointer;
}


.notifikasi span {
    position: absolute;

    width: 7px;
    height: 7px;

    right: 2px;
    top: 1px;

    background: #e74c3c;

    border-radius: 50%;
}


.profil-admin {
    display: flex;
    align-items: center;
    gap: 10px;
}


.profil-admin div:last-child {
    display: flex;
    flex-direction: column;
}


.profil-admin small {
    font-size: 11px;
    color: #8a8f98;
}


.profil-admin strong {
    font-size: 14px;
}


.avatar-admin {
    width: 39px;
    height: 39px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #edf3ff;
    color: #316fc5;

    border-radius: 50%;

    font-size: 18px;
}


.btn-logout {
    color: #757b84;
    font-size: 19px;

    text-decoration: none;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    position: fixed;

    top: 78px;
    left: 0;
    bottom: 0;

    width: 250px;

    background: #ffffff;

    border-right: 1px solid #e8ebf0;

    padding: 24px 15px;

    overflow-y: auto;
}


.menu-sidebar {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.menu-item {
    min-height: 48px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 0 17px;

    border-radius: 12px;

    text-decoration: none;

    color: #555b64;

    font-size: 14px;
    font-weight: 600;

    transition: .2s;
}


.menu-item i {
    width: 22px;

    font-size: 18px;
}


.menu-item:hover {
    background: #f0f5ff;
    color: #2366c1;
}


.menu-item.aktif {
    background: #e7f0ff;
    color: #2366c1;
}


.judul-menu {
    margin: 18px 17px 5px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;

    color: #a1a6ae;
}


/* =====================================================
   KONTEN
===================================================== */

.konten-admin {
    margin-left: 250px;
    padding: 108px 30px 40px;
    min-height: 100vh;
}


.judul-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 25px;
}


.judul-dashboard h2 {
    margin: 3px 0 5px;

    font-size: 27px;
    font-weight: 800;
}


.judul-dashboard p {
    margin: 0;

    color: #7a8089;
    font-size: 13px;
}


.judul-dashboard .teks-kecil {
    color: #3274ce;

    font-size: 12px;
    font-weight: 700;
}


.tanggal-dashboard {
    background: #ffffff;

    padding: 10px 16px;

    border: 1px solid #e3e6eb;
    border-radius: 10px;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
}


/* =====================================================
   STATISTIK
===================================================== */

.statistik-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 17px;

    margin-bottom: 20px;
}


.kartu-statistik {
    background: #ffffff;

    min-height: 125px;

    border: 1px solid #e8ebef;
    border-radius: 17px;

    padding: 20px;

    display: flex;
    align-items: center;
    gap: 16px;

    box-shadow: 0 4px 14px rgba(0,0,0,.025);
}


.ikon-statistik {
    width: 51px;
    height: 51px;

    flex-shrink: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 14px;

    font-size: 22px;
}


.ikon-statistik.buku {
    background: #eaf2ff;
    color: #3476d4;
}


.ikon-statistik.anggota {
    background: #f0ebff;
    color: #7456c8;
}


.ikon-statistik.tersedia {
    background: #e6f8ef;
    color: #1f9d67;
}


.ikon-statistik.dipinjam {
    background: #fff1e4;
    color: #e17b23;
}


.kartu-statistik p {
    margin: 0;

    font-size: 12px;
    color: #777d86;
}


.kartu-statistik h3 {
    margin: 3px 0;

    font-size: 26px;
    font-weight: 800;
}


.kartu-statistik span {
    font-size: 10px;
    color: #9a9fa6;
}


/* =====================================================
   KARTU DASHBOARD
===================================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns: 1fr 1fr 1.3fr;

    gap: 18px;

    margin-bottom: 18px;
}


.kartu-dashboard {
    background: #ffffff;

    border: 1px solid #e7eaee;
    border-radius: 17px;

    padding: 20px;

    box-shadow: 0 4px 15px rgba(0,0,0,.025);
}


.judul-kartu {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 18px;
}


.judul-kartu h4 {
    margin: 0 0 3px;

    font-size: 16px;
    font-weight: 750;
}


.judul-kartu p {
    margin: 0;

    color: #90959d;
    font-size: 11px;
}


.judul-kartu > i {
    color: #3173ce;
    font-size: 20px;
}


.judul-kartu a {
    font-size: 11px;

    color: #3274ce;

    text-decoration: none;
}


/* =====================================================
   TRANSAKSI CEPAT
===================================================== */

.tombol-transaksi {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.btn-pinjam,
.btn-kembali {
    min-height: 67px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 14px;

    border-radius: 13px;

    text-decoration: none;

    transition: .2s;
}


.btn-pinjam {
    background: #eaf3ff;
    color: #256bc6;
}


.btn-kembali {
    background: #e9f8f1;
    color: #16865a;
}


.btn-pinjam:hover,
.btn-kembali:hover {
    transform: translateY(-2px);
}


.ikon-transaksi {
    width: 40px;
    height: 40px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(255,255,255,.7);

    border-radius: 10px;

    font-size: 19px;
}


.btn-pinjam div:nth-child(2),
.btn-kembali div:nth-child(2) {
    flex: 1;

    display: flex;
    flex-direction: column;
}


.btn-pinjam strong,
.btn-kembali strong {
    font-size: 13px;
}


.btn-pinjam small,
.btn-kembali small {
    margin-top: 2px;

    font-size: 9px;
    opacity: .75;
}


/* =====================================================
   RINGKASAN
===================================================== */

.ringkasan-hari {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 8px;
}


.ringkasan-hari div {
    min-height: 95px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background: #f8f9fb;

    border-radius: 12px;
}


.ringkasan-hari span {
    color: #7f858e;
    font-size: 10px;
}


.ringkasan-hari strong {
    margin-top: 6px;

    font-size: 24px;
}


/* =====================================================
   JATUH TEMPO
===================================================== */

.daftar-jatuh-tempo {
    display: flex;
    flex-direction: column;
}


.item-jatuh-tempo {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 10px 0;

    border-bottom: 1px solid #eef0f3;
}


.item-jatuh-tempo:last-child {
    border-bottom: none;
}


.ikon-buku-kecil {
    width: 37px;
    height: 37px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #f1f5fb;

    border-radius: 9px;

    color: #4e75aa;
}


.info-jatuh-tempo {
    flex: 1;

    display: flex;
    flex-direction: column;
}


.info-jatuh-tempo strong {
    font-size: 12px;
}


.info-jatuh-tempo span {
    margin-top: 2px;

    color: #858b94;

    font-size: 10px;
}


.status {
    padding: 5px 8px;

    border-radius: 20px;

    font-size: 9px;
    font-weight: 700;
}


.status.terlambat {
    background: #ffe7e7;
    color: #d64545;
}


.status.hari-ini {
    background: #fff1d9;
    color: #c97913;
}


.status.segera {
    background: #e8f1ff;
    color: #3274ce;
}


/* =====================================================
   BAGIAN BAWAH
===================================================== */

.bagian-bawah-dashboard {
    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 18px;
}


.tabel-aktivitas {
    margin: 0;

    font-size: 11px;
}


.tabel-aktivitas th {
    padding: 11px;

    color: #737983;

    background: #f8f9fb;

    font-size: 10px;

    border-bottom: 1px solid #eceef1;
}


.tabel-aktivitas td {
    padding: 12px 11px;

    vertical-align: middle;

    border-color: #f0f1f3;
}


.aktivitas-label {
    padding: 5px 8px;

    border-radius: 20px;

    font-size: 9px;
    font-weight: 700;
}


.aktivitas-label.pinjam {
    background: #e9f2ff;
    color: #286bc5;
}


.aktivitas-label.kembali {
    background: #e8f8f0;
    color: #198b5c;
}


.aktivitas-label.tambah {
    background: #f1edff;
    color: #7258bf;
}


/* =====================================================
   AKSES CEPAT
===================================================== */

.akses-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 0;

    color: #272b31;

    text-decoration: none;

    border-bottom: 1px solid #eff1f3;
}


.akses-item:last-child {
    border-bottom: none;
}


.akses-icon {
    width: 40px;
    height: 40px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #f0f4fa;

    border-radius: 10px;

    color: #4772ad;
}


.akses-item div:nth-child(2) {
    flex: 1;

    display: flex;
    flex-direction: column;
}


.akses-item strong {
    font-size: 12px;
}


.akses-item span {
    margin-top: 2px;

    color: #8b9098;

    font-size: 9px;
}


/* =====================================================
   FOOTER
===================================================== */

.footer-admin {
    margin-left: 250px;

    padding: 15px 30px;

    background: #ffffff;

    border-top: 1px solid #e7eaee;

    text-align: center;

    color: #8c929a;

    font-size: 11px;
}


.footer-admin p {
    margin: 0;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1200px) {

    .statistik-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .jatuh-tempo {
        grid-column: 1 / -1;
    }

}


@media (max-width: 800px) {

    .sidebar {
        display: none;
    }

    .konten-admin,
    .footer-admin {
        margin-left: 0;
    }

    .logo-area {
        width: auto;
    }

    .logo-area div:last-child {
        display: none;
    }

    .pencarian-navbar {
        display: none;
    }

    .statistik-grid,
    .dashboard-grid,
    .bagian-bawah-dashboard {
        grid-template-columns: 1fr;
    }

    .judul-dashboard {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

}

/* =====================================================
   TAMBAHAN DASHBOARD ADMIN - GRAFIK DAN RESPONSIVE
   Catatan: CSS asli di atas dipertahankan. Bagian ini hanya
   menambahkan/menyesuaikan tampilan dashboard admin.
===================================================== */

/* Area grafik transaksi 7 hari terakhir */
.grafik-transaksi-dashboard {
    width: 100%;
    margin-bottom: 18px;
}

.area-grafik {
    position: relative;
    width: 100%;
    height: 290px;
    min-height: 220px;
}

.area-grafik canvas {
    display: block;
    max-width: 100%;
}

/* Penanda jumlah buku yang terlambat */
.angka-terlambat {
    color: #d64545;
}

/* Penyesuaian tablet dan HP tanpa menghapus aturan responsive lama */
@media (max-width: 800px) {
    .konten-admin {
        width: 100%;
        padding: 100px 16px 28px;
        margin-left: 0;
        overflow-x: hidden;
    }

    .footer-admin {
        width: 100%;
        margin-left: 0;
    }

    /* Empat kartu statistik tampil dua kolom di HP */
    .statistik-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kartu-statistik {
        min-width: 0;
        min-height: 108px;
        padding: 13px;
        gap: 10px;
    }

    .ikon-statistik {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .kartu-statistik h3 {
        font-size: 21px;
    }

    .kartu-statistik span {
        font-size: 9px;
    }

    /* Bagian dashboard lain tetap satu kolom agar tidak terpotong */
    .dashboard-grid,
    .bagian-bawah-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }

    .ringkasan-hari {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ringkasan-hari span {
        font-size: 9px;
        text-align: center;
    }

    .ringkasan-hari strong {
        font-size: 21px;
    }

    .area-grafik {
        height: 240px;
    }

    .judul-dashboard h2 {
        font-size: 23px;
    }

    .tanggal-dashboard {
        padding: 8px 12px;
    }

    /* Tabel aktivitas tetap bisa digeser horizontal jika layar sempit */
    .aktivitas-terbaru .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 420px) {
    .konten-admin {
        padding-right: 12px;
        padding-left: 12px;
    }

    .kartu-statistik {
        padding: 10px;
        gap: 8px;
    }

    .ikon-statistik {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .kartu-statistik h3 {
        font-size: 19px;
    }

    .ringkasan-hari {
        gap: 5px;
    }

    .ringkasan-hari span {
        font-size: 8px;
    }

    .ringkasan-hari strong {
        font-size: 19px;
    }

    .area-grafik {
        height: 220px;
    }
}


/* =====================================================
   SIDEBAR ADMIN RESPONSIVE - MENU HAMBURGER DI HP
===================================================== */
.admin-sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e3e9f2;
    border-radius: 10px;
    background: #f4f7fc;
    color: #276fd6;
    font-size: 23px;
    cursor: pointer;
}

.admin-sidebar-overlay {
    display: none;
}

@media (max-width: 800px) {
    .navbar-admin {
        padding: 0 14px;
        gap: 12px;
    }

    .admin-sidebar-toggle {
        display: inline-flex;
    }

    .sidebar {
        display: block;
        position: fixed;
        top: 78px;
        left: 0;
        bottom: 0;
        width: min(280px, 85vw);
        z-index: 1200;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(20, 35, 60, .12);
    }

    .admin-sidebar-overlay {
        display: block;
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1150;
        background: rgba(15, 23, 42, .38);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .admin-sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .profil-navbar {
        gap: 10px;
    }

    .profil-admin small {
        display: none;
    }
}

@media (max-width: 420px) {
    .navbar-admin {
        padding: 0 10px;
    }

    .logo-icon {
        width: 39px;
        height: 39px;
    }

    .profil-admin strong {
        max-width: 105px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }
}


/* =====================================================
   PERBAIKAN FINAL NAVBAR DAN SIDEBAR RESPONSIVE
   Seluruh CSS sebelumnya tetap dipertahankan.
===================================================== */

/* Tombol hamburger hanya tampil pada layar HP/tablet */
.navbar-admin .admin-sidebar-toggle {
    display: none !important;
}

.navbar-admin .logo-area {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
}

.navbar-admin .logo-area > span:last-child {
    display: block;
    min-width: 0;
}

.navbar-admin .logo-area h4 {
    white-space: nowrap;
    line-height: 1.2;
}

.admin-sidebar-overlay {
    display: none;
}

@media (min-width: 801px) {
    .navbar-admin .admin-sidebar-toggle {
        display: none !important;
    }

    .sidebar {
        display: block !important;
        transform: none !important;
    }

    .admin-sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 800px) {
    .navbar-admin {
        gap: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .navbar-admin .admin-sidebar-toggle {
        display: inline-flex !important;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        padding: 0;
    }

    .navbar-admin .logo-area {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        gap: 8px;
    }

    .navbar-admin .logo-area > span:last-child {
        min-width: 0;
    }

    .navbar-admin .logo-area h4 {
        font-size: 16px;
        white-space: nowrap;
    }

    .navbar-admin .logo-area small {
        display: none;
    }

    .navbar-admin .profil-navbar {
        flex: 0 0 auto;
        margin-left: auto;
        gap: 8px;
    }

    .navbar-admin .profil-admin {
        gap: 6px;
        min-width: 0;
    }

    .navbar-admin .avatar-admin {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }

    .navbar-admin .profil-admin small {
        display: none !important;
    }

    .navbar-admin .profil-admin strong {
        display: block;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    .sidebar {
        display: block !important;
        top: 78px;
        z-index: 1200;
        transform: translateX(-105%);
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .admin-sidebar-overlay {
        display: block;
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1150;
        background: rgba(15, 23, 42, .38);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .admin-sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

@media (max-width: 420px) {
    .navbar-admin {
        gap: 7px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .navbar-admin .logo-area {
        gap: 6px;
    }

    .navbar-admin .logo-area h4 {
        font-size: 14px;
    }

    .navbar-admin .logo-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 19px;
    }

    .navbar-admin .profil-admin strong {
        max-width: 66px;
        font-size: 11px;
    }

    .navbar-admin .avatar-admin {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .navbar-admin .btn-logout {
        font-size: 17px;
    }
}
