:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --grad-c1: #4361ee;
    --grad-c2: #3f37c9;
    --grad-c3: #4cc9f0;
    --custom-gradient: linear-gradient(135deg, var(--grad-c1), var(--grad-c2), var(--grad-c3));
    --bg-color: #f0f2f5;
    --sidebar-width: 260px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Mencegah zoom cubitan layar dan efek membal saat mentok */
html,
body {
    touch-action: pan-y;
    overscroll-behavior-y: none;
}

/* Mencegah zoom otomatis saat mengklik kolom input / form */
input,
button,
select,
textarea {
    touch-action: manipulation;
    font-size: 16px !important;
}


body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-attachment: fixed;
    color: #333;
    overflow-x: clip;
}

#landing-app > .navbar {
    position: sticky;
    top: 0;
    z-index: 1030 !important;
}

#landing-app {
    overflow-x: clip;
}

#login-app {
    background: url('') no-repeat center center/cover;
    transition: background 0.5s ease-in-out;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.floating-logo-container {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

.floating-logo {
    width: 70px;
    height: auto;
}

@keyframes float {
    0% {
        transform: translate3d(-50%, 0, 0);
    }

    50% {
        transform: translate3d(-50%, -10px, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.hover-scale {
    transition: transform 0.2s;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1050;
    background: white;
    border-right: 1px solid #e0e0e0;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin 0.3s;
    padding: 20px;
}

.nav-link {
    color: #555;
    margin: 5px 15px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

/* ====  Style khusus untuk Tab di halaman Pengaturan  ==== */
#settingTabs .nav-link,
#settingTabsOnline .nav-link {
    display: inline-flex;
    margin: 0;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    color: #666;
    background: transparent;
    box-shadow: none;
    border: 2px solid transparent;
    transition: all 0.2s;
}

#settingTabs .nav-link:hover,
#settingTabsOnline .nav-link:hover {
    background: #f0f4ff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

#settingTabs .nav-link.active,
#settingTabsOnline .nav-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(67, 97, 238, 0.25);
}

.glass-card {
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

/* Mencegah kolom tombol dan tanggal terlipat/turun ke bawah */
.nowrap-cell {
    white-space: nowrap !important;
    width: 1%;
    /* Biar lebar kolomnya menyesuaikan isinya aja */
}

/* Memotong teks panjang maksimal 2 baris dengan titik-titik (...) */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    /* Lebar kira-kira 20 digit huruf */
    white-space: normal;
}

@media (max-width: 768px) {
    .sidebar {
        left: -260px;
    }

    .sidebar.show {
        left: 0;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .overlay.show {
        display: block;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    .login-card {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.95);
    }
}

.w-md-25 {
    width: 25%;
}

@media (max-width: 768px) {
    .w-md-25 {
        width: 100%;
    }
}

/* Naikkan tombol scroll to top di layar HP */
#btn-back-to-top {
    position: fixed;
    bottom: 85px;
    right: 20px;
    display: none;
    /* Tersembunyi default */
    z-index: 1050;
    /* Di atas elemen lain */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#btn-back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* =========================================
   TAMPILAN KHUSUS HP (MOBILE APP STYLE)
========================================= */
@media (max-width: 768px) {

    /* Sembunyikan Sidebar & Navbar lama di HP */
    .sidebar,
    .navbar.bg-white.shadow-sm {
        display: none !important;
    }

    /* Beri ruang di atas dan bawah agar konten tidak tertutup menu */
    .content {
        margin-left: 0;
        width: 100%;
        padding: 75px 10px 85px 10px !important;
    }

    /* HEADER ATAS */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        z-index: 1050;
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-header-left img {
        height: 35px;
        width: 35px;
        object-fit: contain;
    }

    .mobile-header-left span {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 15px;
    }

    .mobile-header-right {
        display: flex;
        gap: 18px;
        align-items: center;
    }

    .top-icon-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #666;
        cursor: pointer;
    }

    .top-icon-btn i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .top-icon-btn span {
        font-size: 9px;
        font-weight: 400;
        letter-spacing: 0.5px;
    }

    /* Tulisan tipis & kecil */

    /* MENU BAWAH (BOTTOM NAV) */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: white;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1050;
        border-radius: 20px 20px 0 0;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #a0a0a0;
        text-decoration: none;
        width: 20%;
        cursor: pointer;
        transition: 0.3s;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
    }

    .bottom-nav-item.active i {
        transform: translateY(-2px);
    }

    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }

    .bottom-nav-item span {
        font-size: 10px;
        font-weight: 600;
    }

    /* TOMBOL HOME DI TENGAH (BERBEDA/MENGAMBANG) */
    .bottom-nav-item.home-btn {
        position: relative;
        top: -15px;
    }

    .bottom-nav-item.home-btn .fab-inner {
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        width: 55px;
        height: 55px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
        border: 4px solid var(--bg-color);
        color: white;
    }

    .bottom-nav-item.home-btn .fab-inner i {
        font-size: 22px;
        margin: 0;
        color: white !important;
    }

    .bottom-nav-item.home-btn span {
        position: absolute;
        bottom: -18px;
        color: var(--primary-color);
    }
}

/* --- ANIMASI RUNNING TEXT MODERN --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee-anim 15s linear infinite;
    /* Angka 15s adalah kecepatan, ubah jika ingin lebih cepat/lambat */
}

@keyframes marquee-anim {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* Sembunyikan menu mobile saat di Desktop/Laptop */
@media (min-width: 769px) {

    .mobile-header,
    .mobile-bottom-nav {
        display: none !important;
    }
}


/* --- EFEK GLASSMORPHISM & ANIMASI MELAYANG --- */
.glass-morphism-card {
    background: rgba(255, 255, 255, 0.15) !important;
    /* Dibuat lebih transparan biar efek kacanya terasa */
    backdrop-filter: blur(15px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

#login-instansi-name, #login-school-name, #login-alamat-text, 
#loginForm label, #loginForm h4, #loginForm p {
    text-shadow: 0px 1px 3px rgba(255,255,255, 0.9), 0px 0px 5px rgba(255,255,255, 0.7);
}

/* Bola Cahaya Warna-warni di Belakang Kaca */
.color-blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    border-radius: 50%;
    animation: blob-bounce 10s infinite alternate ease-in-out;
}

.blob-biru {
    width: 350px;
    height: 350px;
    background: #4361ee;
    top: -50px;
    left: -50px;
    opacity: 0.6;
}

.blob-pink {
    width: 300px;
    height: 300px;
    background: #f72585;
    bottom: -50px;
    right: -50px;
    opacity: 0.5;
    animation-delay: -4s;
}

@keyframes blob-bounce {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.2);
    }
}

/* Rumus Melayang Lurus Naik-Turun (Tanpa geser kiri) */
@keyframes float-inline {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Animasi Logo Melayang (Diperbaiki agar tidak oleng) */
.anim-float-1 {
    animation: float-inline 3s ease-in-out infinite;
}

.anim-float-2 {
    animation: float-inline 4s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Animasi Tombol HP Melayang & Berdenyut */
@keyframes pulse-float {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
        box-shadow: 0 15px 25px rgba(67, 97, 238, 0.6);
    }

    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    }
}

.btn-float-mobile {
    animation: pulse-float 2.5s infinite ease-in-out;
}

/* ==========================================================
   MODERN LANDING PAGE & CUSTOM GRADIENT SYSTEM
========================================================== */
.gradient-text {
    background: linear-gradient(135deg, var(--grad-c1, #4361ee), var(--grad-c2, #3a0ca3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-custom-gradient {
    background: var(--custom-gradient) !important;
    color: #ffffff !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-custom-gradient:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4) !important;
    color: #ffffff !important;
}

.hover-translate {
    transition: all 0.3s ease;
}

.hover-translate:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.feature-icon-box {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.feature-icon-box:hover {
    transform: rotate(6deg) scale(1.1);
}

.footer-social-btn {
    transition: all 0.3s ease;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

.footer-social-btn:hover {
    background: var(--custom-gradient) !important;
    border-color: transparent !important;
    transform: translateY(-3px) scale(1.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
}

.blob-dyn-1 {
    position: absolute;
    filter: blur(90px);
    z-index: 0;
    border-radius: 50%;
    width: 450px;
    height: 450px;
    background: var(--grad-c1, #4361ee);
    top: -80px;
    left: -100px;
    opacity: 0.25;
    animation: blob-bounce 12s infinite alternate ease-in-out;
}

.blob-dyn-2 {
    position: absolute;
    filter: blur(90px);
    z-index: 0;
    border-radius: 50%;
    width: 480px;
    height: 480px;
    background: var(--grad-c2, #764ba2);
    bottom: 50px;
    right: -100px;
    opacity: 0.22;
    animation: blob-bounce 14s infinite alternate-reverse ease-in-out;
    animation-delay: -3s;
}

.blob-dyn-3 {
    position: absolute;
    filter: blur(100px);
    z-index: 0;
    border-radius: 50%;
    width: 380px;
    height: 380px;
    background: var(--grad-c3, #4cc9f0);
    top: 35%;
    right: 30%;
    opacity: 0.18;
    animation: blob-bounce 16s infinite alternate ease-in-out;
    animation-delay: -6s;
}

/* Scanner Camera Styling */
#reader-loan,
#reader-return {
    min-height: 250px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#reader-loan video,
#reader-return video {
    border-radius: 10px;
    object-fit: cover !important;
    max-width: 100% !important;
}

#reader-loan button,
#reader-return button {
    border-radius: 20px !important;
    font-size: 12px !important;
    padding: 6px 14px !important;
    margin: 4px !important;
    border: none !important;
    background: var(--custom-gradient) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

#reader-loan select,
#reader-return select {
    border-radius: 8px !important;
    font-size: 13px !important;
    padding: 5px 10px !important;
    border: 1px solid #cbd5e1 !important;
}

@media (max-width: 767.98px) {
    .responsive-hero-logo {
        width: 60px !important;
        height: 60px !important;
    }
}
@media (min-width: 768px) {
    .responsive-hero-logo {
        width: 85px !important;
        height: 85px !important;
    }
}

/* ==============================================
   LANDING PAGE - BOTTOM NAV MOBILE (NATIVE STYLE)
   ============================================== */

/* Sembunyikan navbar atas landing di HP */
@media (max-width: 991.98px) {
    #landing-app .navbar {
        display: none !important;
    }

    /* Beri padding bawah agar konten tidak tertutup bottom nav */
    #landing-app {
        padding-bottom: 75px;
    }
}

/* Bottom Nav Landing */
.landing-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(67, 97, 238, 0.13), 0 -1px 0 rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    border-radius: 22px 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.7);
}

/* Sembunyikan di desktop */
@media (min-width: 992px) {
    .landing-bottom-nav {
        display: none !important;
    }
}

.lbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    cursor: pointer;
    flex: 1;
    gap: 3px;
    transition: color 0.25s ease;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.lbn-item:hover,
.lbn-item:active {
    color: var(--primary-color);
}

.lbn-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.lbn-item:active i {
    transform: scale(0.88);
}

.lbn-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Tengah: Beranda dengan FAB melayang */
.lbn-item.lbn-home {
    position: relative;
    top: -14px;
    gap: 0;
    color: var(--primary-color);
}

.lbn-item.lbn-home span {
    position: absolute;
    bottom: -18px;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-color);
}

.lbn-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--custom-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.45);
    border: 4px solid #f8fafc;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-bottom: 2px;
}

.lbn-fab i {
    font-size: 22px !important;
    color: #ffffff !important;
    margin: 0 !important;
}

.lbn-item.lbn-home:active .lbn-fab {
    transform: scale(0.92);
    box-shadow: 0 4px 14px rgba(67, 97, 238, 0.35);
}

/* Kanan: Login dengan warna aksen */
.lbn-item.lbn-login:hover,
.lbn-item.lbn-login:active {
    color: #f72585;
}

.inventory-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inventory-toolbar .custom-search,
.inventory-toolbar .inventory-filter,
.inventory-toolbar .inventory-print,
.inventory-toolbar .inventory-export {
    min-width: 0;
    width: 100%;
}

.inventory-toolbar .custom-search input {
    height: 100%;
}

.inventory-filter label {
    white-space: nowrap;
}

.inventory-filter .input-group,
.inventory-filter select {
    flex: 1;
    min-width: 0;
}

@media (min-width: 992px) {
    .inventory-toolbar {
        display: grid;
        grid-template-columns: 10fr 4fr 3fr 3fr;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ==============================================
   OPTIMASI RESPONSIVITAS MOBILE (HP & TABLET)
   ============================================== */

/* 1. Live Clock & Date Badge di HP */
#landing-live-clock-badge {
    transition: all 0.3s ease;
    max-width: 100%;
}

@media (max-width: 576px) {
    #landing-live-clock-badge {
        font-size: 0.76rem !important;
        padding: 6px 14px !important;
        border-radius: 20px !important;
        gap: 6px !important;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        margin: 0 auto;
    }
    
    #landing-live-clock-badge .small {
        font-size: 0.76rem !important;
    }
    
    #landing-live-clock-badge i {
        font-size: 0.8rem !important;
    }
}

/* 2. Modal Daftar Kunjungan & Modal Form Input di HP */
@media (max-width: 576px) {
    #modalDaftarBukuTamu .modal-dialog,
    #modalBukuTamu .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    #modalDaftarBukuTamu .modal-content,
    #modalBukuTamu .modal-content {
        border-radius: 18px !important;
    }
    
    #modalDaftarBukuTamu .modal-header,
    #modalBukuTamu .modal-header {
        padding: 12px 16px !important;
    }
    
    #modalDaftarBukuTamu .modal-body,
    #modalBukuTamu .modal-body {
        padding: 14px 12px !important;
    }
    
    /* 3 Tab Navigasi di HP */
    #pubVisitorTabs .nav-link {
        font-size: 0.78rem !important;
        padding: 8px 4px !important;
        gap: 4px !important;
        white-space: nowrap;
    }
    
    #pubVisitorTabs .nav-link i {
        font-size: 0.85rem !important;
    }
    
    #pubVisitorTabs .nav-link .badge {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }
    
    /* Segmented Kategori di Modal Input HP */
    #formBukuTamu label.btn {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
    }
    
    #formBukuTamu label.btn i {
        font-size: 1rem !important;
    }
    
    /* Tabel Kunjungan di HP */
    #modalDaftarBukuTamu table {
        font-size: 0.8rem !important;
    }
    
    #modalDaftarBukuTamu th,
    #modalDaftarBukuTamu td {
        white-space: nowrap;
        padding: 8px 10px !important;
    }
}

/* ===================================================
   TAB NAVIGASI SEGMENTED (SIRKULASI, REFERENSI, RIWAYAT, DAFTAR PENGUNJUNG)
   =================================================== */
#sirkulasiTabs,
#referensiTabs,
#riwayatTabs,
#pubVisitorTabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 3px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50rem !important;
    overflow: hidden !important;
}

/* Proporsi Item Sirkulasi & Riwayat 50% - 50% */
#sirkulasiTabs .nav-item,
#riwayatTabs .nav-item {
    flex: 1 1 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    min-width: 0 !important;
    display: flex !important;
}

/* Proporsi Item Referensi & Pengunjung 33.333% Sebaris */
#referensiTabs .nav-item,
#pubVisitorTabs .nav-item {
    flex: 1 1 33.333% !important;
    width: 33.333% !important;
    max-width: 33.333% !important;
    min-width: 0 !important;
    display: flex !important;
}

/* Nav Link Button Base Styling */
#sirkulasiTabs .nav-link,
#referensiTabs .nav-link,
#riwayatTabs .nav-link,
#pubVisitorTabs .nav-link {
    width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border: none !important;
    border-radius: 50rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 10px !important;
    color: #64748b;
    transition: all 0.25s ease-in-out;
}

/* --- TAB SIRKULASI --- */
/* Tab Peminjaman - Biru */
#sirkulasiTabs .nav-link.tab-sirkulasi-loan:hover {
    color: #4361ee;
    background: rgba(67, 97, 238, 0.08);
}
#sirkulasiTabs .nav-link.tab-sirkulasi-loan.active {
    background: linear-gradient(135deg, #4361ee, #4895ef) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.35);
}

/* Tab Pengembalian - Hijau Emerald */
#sirkulasiTabs .nav-link.tab-sirkulasi-return:hover {
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
}
#sirkulasiTabs .nav-link.tab-sirkulasi-return.active {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* --- TAB REFERENSI DATA --- */
#referensiTabs .nav-link.tab-ref-buku:hover {
    color: #4361ee;
    background: rgba(67, 97, 238, 0.08);
}
#referensiTabs .nav-link.tab-ref-buku.active {
    background: linear-gradient(135deg, #4361ee, #4895ef) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

#referensiTabs .nav-link.tab-ref-siswa:hover {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
}
#referensiTabs .nav-link.tab-ref-siswa.active {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

#referensiTabs .nav-link.tab-ref-guru:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
}
#referensiTabs .nav-link.tab-ref-guru.active {
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* --- TAB RIWAYAT & REKAP KETERLAMBATAN --- */
#riwayatTabs .nav-link.tab-riwayat-transaksi:hover {
    color: #4361ee;
    background: rgba(67, 97, 238, 0.08);
}
#riwayatTabs .nav-link.tab-riwayat-transaksi.active {
    background: linear-gradient(135deg, #4361ee, #4895ef) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.35);
}

#riwayatTabs .nav-link.tab-riwayat-terlambat:hover {
    color: #e11d48;
    background: rgba(225, 29, 72, 0.08);
}
#riwayatTabs .nav-link.tab-riwayat-terlambat.active {
    background: linear-gradient(135deg, #e11d48, #f43f5e) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
}

/* --- TAB DAFTAR PENGUNJUNG --- */
#pubVisitorTabs .nav-link:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}
#pubVisitorTabs .nav-link#tab-pub-siswa.active {
    background: linear-gradient(135deg, #4361ee, #4895ef) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}
#pubVisitorTabs .nav-link#tab-pub-siswa.active .badge {
    background-color: #ffffff !important;
    color: #4361ee !important;
}
#pubVisitorTabs .nav-link#tab-pub-guru.active {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}
#pubVisitorTabs .nav-link#tab-pub-guru.active .badge {
    background-color: #ffffff !important;
    color: #0284c7 !important;
}
#pubVisitorTabs .nav-link#tab-pub-tamu.active {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}
#pubVisitorTabs .nav-link#tab-pub-tamu.active .badge {
    background-color: #ffffff !important;
    color: #d97706 !important;
}

/* ===================================================
   RESPONSIVE UNTUK HP / MOBILE (< 576px)
   =================================================== */
@media (max-width: 576px) {
    #sirkulasiTabs,
    #referensiTabs,
    #riwayatTabs,
    #pubVisitorTabs {
        padding: 2px !important;
    }

    /* Tab Sirkulasi & Riwayat di HP: Sebaris 50% 50% */
    #sirkulasiTabs .nav-link,
    #riwayatTabs .nav-link {
        font-size: 0.78rem !important;
        padding: 7px 4px !important;
        gap: 4px !important;
    }
    #sirkulasiTabs .nav-link i,
    #riwayatTabs .nav-link i {
        font-size: 0.8rem !important;
    }

    /* Tab Referensi di HP: Sebaris 33.333% Kecil & Pas */
    #referensiTabs .nav-link {
        font-size: 0.72rem !important;
        padding: 6px 2px !important;
        gap: 3px !important;
    }
    #referensiTabs .nav-link i {
        font-size: 0.75rem !important;
    }

    /* Tab Daftar Pengunjung di HP: Sebaris 33.333% Tidak Boleh Turun Baris */
    #pubVisitorTabs .nav-link {
        font-size: 0.70rem !important;
        padding: 6px 2px !important;
        gap: 3px !important;
    }
    #pubVisitorTabs .nav-link i {
        font-size: 0.72rem !important;
    }
    #pubVisitorTabs .nav-link .badge {
        font-size: 0.62rem !important;
        padding: 2px 4px !important;
        margin-left: 2px !important;
    }
}

/* Layar Ultra Kecil (< 380px) */
@media (max-width: 380px) {
    #sirkulasiTabs .nav-link,
    #riwayatTabs .nav-link {
        font-size: 0.72rem !important;
        padding: 6px 2px !important;
        gap: 3px !important;
    }
    #referensiTabs .nav-link {
        font-size: 0.68rem !important;
        padding: 5px 1px !important;
        gap: 2px !important;
    }
    #pubVisitorTabs .nav-link {
        font-size: 0.66rem !important;
        padding: 5px 1px !important;
        gap: 2px !important;
    }
    #pubVisitorTabs .nav-link i,
    #referensiTabs .nav-link i {
        display: none !important;
    }
}


