/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    /* Warna Utama */
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;
    --primary-300: #93C5FD;
    --primary-400: #60A5FA;
    --primary-500: #3B82F6;
    --primary-600: #2563EB;
    --primary-700: #1D4ED8;
    --primary-800: #1E40AF;
    --primary-900: #1E3A8A;
    
    /* Warna Netral */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Warna Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    --pink: #EC4899;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    
    /* Border Radius */
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    
    /* ==========================================
       FOTO DARI INTERNET - TANPA DOWNLOAD
       ========================================== */
    --bg-library: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?w=1600&q=80');
    --bg-bookshelf: url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?w=1600&q=80');
    --bg-student: url('https://images.unsplash.com/photo-1529400971008-f566de0e6dfc?w=1600&q=80');
    --bg-bookstack: url('https://images.unsplash.com/photo-1495446815901-a7297e633e8d?w=1600&q=80');
    --bg-library-interior: url('https://images.unsplash.com/photo-1568667256549-094345857637?w=1600&q=80');
}

/* ============================================
   GLOBAL RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    padding-top: 0; /* default 0; marketing page sets via .has-marketing-nav */
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
    position: relative;
}
body.has-marketing-nav {
    padding-top: 70px;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border: 2px solid var(--primary-600);
}
.btn-outline:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    transition: transform 0.25s ease;
}
.btn:hover .btn-icon {
    transform: translateX(4px);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}
.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}
.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}
.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}
.badge-new {
    background: linear-gradient(135deg, var(--primary-600), var(--purple));
    color: white;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ============================================
   NAVBAR - VERSI SUPER PRESISI
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: visible; /* allow mobile dropdown below */
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    padding: 0 16px;
    min-width: 0;
    overflow: hidden; /* cegah menu desktop "gantung" ke luar layar */
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    height: 100%;
}
.nav-logo .logo-icon {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.nav-logo .logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    display: flex;
    align-items: center;
}
.nav-logo .logo-highlight {
    color: var(--primary-600);
}

/* Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 36px;
    height: 100%;
    margin: 0 24px;
}
.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px 0;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
}
.nav-link:hover {
    color: var(--primary-600);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: var(--primary-600);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}
.nav-link.active {
    color: var(--primary-600);
}
.nav-link.active::after {
    width: 100%;
}

/* Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    height: 100%;
}
.nav-actions .btn {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.nav-actions .btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid transparent;
}
.nav-actions .btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

/* Tombol hamburger menu mobile - default disembunyikan di desktop */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}
.nav-toggle:hover {
    background: var(--gray-200);
}

/* Dropdown menu mobile - disembunyikan sampai di-toggle */
.nav-menu-mobile {
    display: none;
    position: fixed;
    top: 64px; /* default mobile navbar height */
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    z-index: 1100;
    padding: 8px 16px 12px;
    flex-direction: column;
    gap: 0;
    margin: 0;
    box-sizing: border-box;
}
.nav-menu-mobile.show {
    display: flex !important;
}
.nav-menu-mobile .nav-link {
    display: flex !important;
    align-items: center;
    padding: 14px 12px !important;
    width: 100%;
    border-bottom: 1px solid var(--gray-100);
    height: auto !important;
    min-height: 48px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}
.nav-menu-mobile .nav-link:last-child {
    border-bottom: none;
}
.nav-menu-mobile .nav-link:hover,
.nav-menu-mobile .nav-link:active {
    color: var(--primary-600);
    background: var(--primary-50);
    border-radius: 8px;
}
.nav-menu-mobile .nav-link::after {
    display: none !important;
}

@media (max-width: 480px) {
    .nav-menu-mobile {
        top: 58px;
    }
}
@media (min-width: 993px) {
    .nav-menu-mobile {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE NAVBAR
   ============================================ */
/* Sembunyikan menu desktop lebih awal agar tidak overflow / "gantung" */
@media (max-width: 992px) {
    .nav-menu {
        display: none !important;
    }
    .nav-toggle {
        display: flex;
    }
    .navbar {
        padding: 0 16px;
        height: 64px;
    }
    .nav-logo .logo-text {
        font-size: 17px;
    }
    .nav-logo .logo-icon {
        font-size: 22px;
    }
    .nav-actions .btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    body.has-marketing-nav {
        padding-top: 64px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 12px;
        height: 58px;
    }
    .nav-logo .logo-text {
        font-size: 15px;
    }
    .nav-logo .logo-icon {
        font-size: 20px;
    }
    .nav-logo {
        gap: 6px;
    }
    .nav-actions .btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    body.has-marketing-nav {
        padding-top: 58px;
    }
}

/* ============================================
   HERO - DENGAN FOTO DARI INTERNET
   ============================================ */
/* ============================================
   HERO - DENGAN FOTO DARI INTERNET
   ============================================ */
.hero {
    position: relative;
    overflow: hidden;
    padding: 90px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* INI YANG BIKIN FOTO MUNCUL */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?w=1600&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.35);
    z-index: 0;
}

/* OVERLAY BIAR TEKS KELIHATAN */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.8) 0%, 
        rgba(30, 58, 138, 0.5) 50%, 
        rgba(37, 99, 235, 0.2) 100%
    );
    z-index: 0;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    color: white;
}

/* HERO ILLUSTRATION - PAKE FOTO JUGA */
.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.illustration-box {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 4/3;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    background-image: url('https://images.unsplash.com/photo-1529400971008-f566de0e6dfc?w=600&q=80');
    background-size: cover;
    background-position: center;
}

.illustration-box .overlay-text {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    color: white;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
}
.illustration-box .overlay-text h4 {
    font-size: 14px;
    font-weight: 700;
}
.illustration-box .overlay-text p {
    font-size: 12px;
    opacity: 0.8;
}

.floating-badge {
    position: absolute;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: float-badge 5s ease-in-out infinite;
}
.floating-badge.b1 {
    top: 10%;
    right: -20px;
    animation-delay: 0.2s;
}
.floating-badge.b2 {
    bottom: 15%;
    left: -20px;
    animation-delay: 1.5s;
}
.floating-badge .badge-icon {
    font-size: 24px;
}

@keyframes float-badge {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
    padding: 40px 0;
    background: white;
    border-bottom: 1px solid var(--gray-100);
}
.search-wrapper {
    max-width: 720px;
    margin: 0 auto;
}
.search-box {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 4px 4px 4px 20px;
    transition: all 0.3s ease;
}
.search-box:focus-within {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
    background: white;
}
.search-icon {
    font-size: 20px;
    margin-right: 12px;
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    color: var(--gray-900);
}
.search-input::placeholder {
    color: var(--gray-400);
}
.search-btn {
    border-radius: var(--radius-lg);
    padding: 10px 28px;
    font-size: 14px;
}

.search-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}
.tag {
    padding: 4px 14px;
    background: var(--gray-100);
    border-radius: 9999px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}
.tag:hover {
    background: var(--primary-100);
    color: var(--primary-700);
}

/* ============================================
   STATISTICS
   ============================================ */
.stats {
    padding: 60px 0;
    background: white;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.stat-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
    background: white;
}
.stat-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}
.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 15px;
    color: var(--gray-500);
    font-weight: 500;
}
.stat-change {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ============================================
   BUKU SECTIONS - DENGAN FOTO
   ============================================ */
.buku-populer {
    padding: 60px 0;
    position: relative;
    background: var(--gray-50);
}
.buku-populer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-bookshelf);
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
}

.buku-terbaru {
    padding: 60px 0;
    background: white;
}

.features {
    padding: 60px 0;
    position: relative;
    background: white;
}
.features::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-bookstack);
    background-size: cover;
    background-position: center;
    opacity: 0.04;
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}
.section-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 16px;
    color: var(--gray-500);
}

.buku-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
    z-index: 1;
}

.buku-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
    position: relative;
}
.buku-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}
.buku-cover {
    font-size: 80px;
    display: block;
    margin: 0 auto 12px;
    line-height: 1;
}
.buku-judul {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--gray-900);
}
.buku-penulis {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.buku-rating {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.rating-number {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 4px;
}
.buku-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 12px;
}
.buku-kategori {
    font-size: 13px;
    color: var(--gray-500);
}
.buku-status {
    margin: 12px 0;
}

/* ============================================
   FEATURES
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
    z-index: 1;
}
.feature-card {
    background: white;
    padding: 32px 24px;
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}
.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}
.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}
.feature-card p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ============================================
   CTA SECTION - DENGAN FOTO
   ============================================ */
.cta-section {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-library-interior);
    background-size: cover;
    background-position: center;
    filter: brightness(0.3);
    z-index: 0;
}
.cta-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.8) 0%, 
        rgba(37, 99, 235, 0.6) 100%
    );
    z-index: 0;
}
.cta-content {
    text-align: center;
    color: white;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.cta-content h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}
.cta-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 24px;
}
.cta-content .btn {
    background: white;
    color: var(--primary-600);
    padding: 16px 40px;
    font-size: 18px;
    border-radius: var(--radius-xl);
}
.cta-content .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 60px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand p {
    color: var(--gray-400);
    line-height: 1.7;
    margin: 12px 0 16px;
    max-width: 320px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
}
.footer-logo span:last-child span {
    color: var(--primary-400);
}
.footer-social {
    display: flex;
    gap: 12px;
}
.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 20px;
    transition: background 0.2s;
}
.social-link:hover {
    background: var(--primary-600);
}
.footer-links h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}
.footer-links a {
    display: block;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: white;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}

/* ============================================
   LOGIN PAGE - DENGAN FOTO
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    background-image: var(--bg-library);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.85) 0%, 
        rgba(30, 58, 138, 0.7) 50%, 
        rgba(37, 99, 235, 0.5) 100%
    );
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}
.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.2);
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}
.login-logo span:last-child span {
    color: var(--primary-600);
}
.login-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
}
.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 18px;
}
.login-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--gray-700);
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--gray-50);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
    background: white;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}
.login-footer a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
}
.login-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   APP LAYOUT (Admin & Siswa)
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 18px;
    font-weight: 800;
    padding: 0 12px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
}
.sidebar-brand span:last-child span {
    color: var(--primary-400);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    color: var(--gray-400);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}
.sidebar-link.active {
    background: rgba(37,99,235,0.15);
    color: var(--primary-400);
}
.sidebar-link.logout-link {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 16px;
    color: var(--danger);
}
.sidebar-link.logout-link:hover {
    background: rgba(239,68,68,0.1);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-50);
    min-width: 0;
    /* JANGAN pakai width:100% bareng margin-left — itu yang bikin overflow horizontal */
    max-width: calc(100vw - 260px);
    overflow-x: hidden;
    box-sizing: border-box;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.top-navbar {
    height: 72px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar-left h2 {
    font-size: 20px;
    font-weight: 700;
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.search-box-small {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 6px 14px;
    border: 1px solid var(--gray-200);
}
.search-box-small {
    min-width: 0;
    flex-shrink: 1;
    max-width: 160px;
}
.search-box-small input {
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
    width: 100%;
    min-width: 0;
    max-width: 140px;
    font-family: inherit;
}
.notification-btn {
    width: 40px;
    height: 40px;
    background: var(--gray-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}
.notification-btn:hover {
    background: var(--gray-200);
}
.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
    min-width: 0;
    flex-shrink: 1;
}
.user-avatar .avatar-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.user-avatar .avatar-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.content-area {
    padding: 32px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    min-width: 0;
}

/* ============================================
   DASHBOARD - SLIDE SHOW
   ============================================ */
.slideshow-container {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
    background: var(--gray-900);
    height: 320px;
}

.slide-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-item.active {
    opacity: 1;
}

.slide-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.6) 0%, 
        rgba(30, 58, 138, 0.3) 50%, 
        rgba(37, 99, 235, 0.1) 100%
    );
}

.slide-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    color: white;
    z-index: 2;
    max-width: 60%;
}

.slide-content h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.slide-content p {
    font-size: 15px;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.slide-dots {
    position: absolute;
    bottom: 16px;
    right: 40px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.slide-dot.active {
    background: white;
    transform: scale(1.2);
}

.slide-dot:hover {
    background: rgba(255,255,255,0.7);
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-nav:hover {
    background: rgba(255,255,255,0.3);
}

.slide-nav.prev {
    left: 16px;
}

.slide-nav.next {
    right: 16px;
}

/* ============================================
   DASHBOARD - STATISTICS CARDS
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stat-card-dashboard {
    background: white;
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.stat-card-dashboard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-600);
}

.stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon-box.blue { background: var(--primary-100); }
.stat-icon-box.green { background: #D1FAE5; }
.stat-icon-box.orange { background: #FEF3C7; }
.stat-icon-box.purple { background: #EDE9FE; }

.stat-info {
    flex: 1;
}

.stat-info .number {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--gray-900);
}

.stat-info .label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-info .change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.stat-info .change.up { color: var(--success); }
.stat-info .change.down { color: var(--danger); }

/* ============================================
   DASHBOARD - ROW GRID
   ============================================ */
.row-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ============================================
   DASHBOARD - CARD MODERN
   ============================================ */
.card-modern {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-header .link {
    font-size: 13px;
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
}

.card-header .link:hover {
    text-decoration: underline;
}

.card-body {
    padding: 24px;
}

/* ============================================
   DASHBOARD - CHART
   ============================================ */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    padding-top: 10px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
    border-radius: 6px 6px 0 0;
    min-height: 16px;
    position: relative;
    transition: height 0.8s ease;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar .label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   DASHBOARD - QUICK ACTIONS
   ============================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action-item {
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.quick-action-item:hover {
    background: var(--primary-100);
    color: var(--primary-700);
    transform: translateX(4px);
    border-color: var(--primary-300);
}

.quick-action-item .icon {
    font-size: 20px;
}

/* ============================================
   DASHBOARD - ACTIVITY LIST
   ============================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--gray-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
}

.activity-text p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.activity-text .time {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================
   KATALOG
   ============================================ */
.catalog-toolbar {
    margin-bottom: 32px;
}
.catalog-search {
    margin-bottom: 16px;
}
.search-box-large {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 4px 4px 4px 20px;
    transition: all 0.3s ease;
}
.search-box-large:focus-within {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}
.search-box-large input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}
.search-box-large .btn {
    border-radius: var(--radius-lg);
}

.catalog-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-select {
    padding: 8px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-select:focus {
    outline: none;
    border-color: var(--primary-600);
}
.catalog-result {
    font-size: 14px;
    color: var(--gray-500);
}

.buku-card-catalog {
    padding: 20px;
}
.buku-card-catalog .buku-cover-large {
    font-size: 72px;
}
.buku-card-catalog .buku-judul {
    font-size: 14px;
}
.buku-card-catalog .btn-full {
    margin-top: 4px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}
.empty-state span {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}
.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--gray-500);
}

/* ============================================
   DETAIL BUKU
   ============================================ */
.back-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--primary-600);
}

.detail-buku-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}
.detail-buku-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 24px;
}
.cover-big {
    font-size: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 320px;
}
.detail-info h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}
.detail-penulis {
    font-size: 16px;
    color: var(--gray-500);
    margin-bottom: 16px;
}
.detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin: 16px 0;
}
.detail-meta-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}
.detail-meta-item span:first-child {
    font-size: 16px;
}
.detail-rating {
    font-size: 18px;
    margin: 12px 0;
}
.detail-rating span {
    font-size: 14px;
    color: var(--gray-500);
    margin-left: 8px;
}
.detail-status {
    margin: 16px 0 24px;
}
.detail-status .badge {
    font-size: 14px;
    padding: 8px 20px;
}
.detail-actions .btn {
    font-size: 16px;
    padding: 14px 40px;
}

.detail-sinopsis {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 24px;
}
.detail-sinopsis h3 {
    font-size: 18px;
    margin-bottom: 12px;
}
.detail-sinopsis p {
    line-height: 1.8;
    color: var(--gray-600);
}

.detail-rekomendasi {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}
.detail-rekomendasi h3 {
    font-size: 18px;
    margin-bottom: 16px;
}
.rekomendasi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.rekomendasi-card {
    text-align: center;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}
.rekomendasi-card:hover {
    transform: translateY(-4px);
    background: var(--primary-50);
}
.rek-cover {
    font-size: 48px;
    display: block;
    margin-bottom: 4px;
}
.rekomendasi-card h4 {
    font-size: 13px;
    font-weight: 600;
}
.rekomendasi-card p {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

/* ============================================
   TOOLBAR & TABLES
   ============================================ */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}
.toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead {
    background: var(--gray-50);
}
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background: var(--gray-50);
}
.data-table .btn-danger {
    background: #FEE2E2;
    color: #DC2626;
    border: none;
}
.data-table .btn-danger:hover {
    background: #FECACA;
}

/* ============================================
   FORMS
   ============================================ */
.form-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-modern .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-modern .form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}
.form-modern .form-row {
    display: flex;
    gap: 16px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ============================================
   KATEGORI & LAPORAN GRID
   ============================================ */
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.kategori-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
}
.kategori-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}
.kategori-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}
.kategori-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}
.kategori-card p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.kategori-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.laporan-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.laporan-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
}
.laporan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.laporan-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}
.laporan-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.laporan-card p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

/* ============================================
   PROFIL
   ============================================ */
.profil-wrapper {
    max-width: 800px;
    margin: 0 auto;
}
.profil-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
}
.profil-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}
.profil-name h1 {
    font-size: 24px;
    font-weight: 800;
}
.profil-name p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   PINJAM CONFIRM
   ============================================ */
.pinjam-confirm, .pinjam-success {
    padding: 20px 0;
}
.confirm-icon, .success-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}
.pinjam-confirm h2, .pinjam-success h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}
.pinjam-info-box {
    background: var(--gray-50);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin: 16px 0 24px;
    text-align: left;
}
.pinjam-info-box p {
    padding: 4px 0;
    font-size: 14px;
}
.success-message {
    background: #D1FAE5;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin: 16px 0;
    text-align: left;
    color: #065F46;
    line-height: 1.8;
}

/* ============================================
   SISWA DASHBOARD - BUKU DIPINJAM
   ============================================ */
.buku-dipinjam-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.buku-dipinjam-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}
.dipinjam-cover {
    font-size: 48px;
    display: flex;
    align-items: center;
}
.dipinjam-info {
    flex: 1;
}
.dipinjam-info h4 {
    font-size: 15px;
    font-weight: 700;
}
.dipinjam-info p {
    font-size: 13px;
    color: var(--gray-500);
}
.dipinjam-dates {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
    margin: 4px 0 8px;
}
.progress-bar {
    background: var(--gray-200);
    border-radius: 9999px;
    height: 6px;
    position: relative;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    border-radius: 9999px;
    transition: width 0.6s ease;
}
.progress-text {
    position: absolute;
    right: 0;
    top: -14px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
}

.mini-buku-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.mini-buku-card {
    text-align: center;
    padding: 16px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}
.mini-buku-card:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
}
.mini-cover {
    font-size: 40px;
    display: block;
    margin-bottom: 4px;
}
.mini-info h4 {
    font-size: 13px;
    font-weight: 600;
}
.mini-info p {
    font-size: 12px;
    color: var(--gray-500);
}

.pinjam-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.pinjam-item:last-child {
    border-bottom: none;
}
.pinjam-cover {
    font-size: 40px;
    width: 56px;
    text-align: center;
}
.pinjam-info {
    flex: 1;
}
.pinjam-info h4 {
    font-size: 15px;
    font-weight: 700;
}
.pinjam-dates {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
    margin: 2px 0 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-wrapper { grid-template-columns: 1fr; text-align: center; }
    .hero-subtitle { margin: 0 auto 32px; }
    .hero-actions { justify-content: center; }
    .hero-title { font-size: 40px; }
    .floating-badge { display: none; }
    
    .buku-grid { grid-template-columns: repeat(3, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .row-grid { grid-template-columns: 1fr; }
    .detail-buku-main { grid-template-columns: 1fr; }
    .cover-big { min-height: 200px; font-size: 100px; }
    .rekomendasi-grid { grid-template-columns: repeat(2, 1fr); }
    .buku-dipinjam-grid { grid-template-columns: 1fr; }
    .mini-buku-grid { grid-template-columns: 1fr 1fr; }
    .kategori-grid { grid-template-columns: repeat(2, 1fr); }
    .laporan-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-menu { display: none !important; }
    .nav-actions .btn { font-size: 13px; padding: 8px 16px; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .buku-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    
    .hero-title { font-size: 32px; }
    .section-title { font-size: 28px; }
    .search-box { flex-wrap: wrap; padding: 4px; }
    .search-input { padding: 12px 16px; width: 100%; }
    .search-btn { width: 100%; justify-content: center; margin-top: 4px; }
    
    .top-navbar {
        padding: 0 12px 0 72px;
        gap: 8px;
        overflow: hidden;
    }
    .navbar-left {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    .navbar-left h2 {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar-right {
        gap: 8px;
        flex-shrink: 0;
        min-width: 0;
    }
    .search-box-small input { width: 90px; }
    .content-area { padding: 16px; }
    .user-avatar .avatar-name { max-width: 80px; }
    
    .slideshow-container { height: 200px; }
    .slide-content { bottom: 20px; left: 20px; max-width: 80%; }
    .slide-content h2 { font-size: 18px; }
    .slide-content p { font-size: 13px; }
    .slide-dots { right: 20px; bottom: 10px; }
    .slide-nav { width: 32px; height: 32px; font-size: 14px; }
    .slide-nav.prev { left: 8px; }
    .slide-nav.next { right: 8px; }
    
    .dashboard-stats { gap: 12px; }
    .stat-card-dashboard { padding: 16px; }
    .stat-info .number { font-size: 20px; }
    .stat-icon-box { width: 44px; height: 44px; font-size: 20px; }
    .quick-actions-grid { grid-template-columns: 1fr; }
    .chart-container { height: 150px; gap: 6px; }
    
    .detail-buku-main { padding: 20px; }
    .detail-meta-grid { grid-template-columns: 1fr; }
    .rekomendasi-grid { grid-template-columns: 1fr 1fr; }
    .kategori-grid { grid-template-columns: repeat(2, 1fr); }
    .laporan-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { flex-direction: column; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .profil-header { flex-direction: column; text-align: center; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .buku-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .buku-card { padding: 16px; }
    .buku-cover { font-size: 48px; }
    .buku-judul { font-size: 13px; }
    
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-number { font-size: 20px; }
    .stat-icon { font-size: 28px; }
    
    .hero { padding: 100px 0 60px; min-height: auto; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 15px; }
    
    .login-card { padding: 24px 20px; }
    .card-body { padding: 16px; }
    .detail-actions .btn { width: 100%; justify-content: center; }
    
    .slideshow-container { height: 160px; }
    .slide-content h2 { font-size: 15px; }
    .slide-content p { font-size: 11px; }
    .slide-nav { width: 28px; height: 28px; font-size: 12px; }
    
    .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card-dashboard { padding: 12px 14px; flex-direction: column; text-align: center; gap: 8px; }
    .stat-icon-box { width: 36px; height: 36px; font-size: 16px; }
    .stat-info .number { font-size: 18px; }
    .stat-info .label { font-size: 11px; }
    .stat-info .change { font-size: 10px; }
    
    .kategori-grid { grid-template-columns: 1fr; }
    .laporan-grid { grid-template-columns: 1fr; }
    .mini-buku-grid { grid-template-columns: 1fr 1fr; }
    .rekomendasi-grid { grid-template-columns: 1fr; }
    
    .cta-content h2 { font-size: 28px; }
    .cover-big-modern { font-size: 80px; min-height: 200px; }
}

/* ============================================
   SIDEBAR TOGGLE - BUKA/TUTUP
   ============================================ */

/* Tombol Toggle (☰) */
.sidebar-toggle-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--gray-900);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
}
.sidebar-toggle-btn:hover {
    background: var(--gray-800);
    transform: scale(1.05);
}

/* Tombol Close (✕) di dalam sidebar */
.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    display: none;
}
.sidebar-close-btn:hover {
    color: white;
}

/* Overlay gelap saat sidebar terbuka di mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}
.sidebar-overlay.active {
    display: block;
}

/* ============================================
   RESPONSIVE - MOBILE (≤ 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Tampilkan tombol toggle di mobile */
    .sidebar-toggle-btn {
        display: flex !important;
    }
    
    /* Sidebar di mobile: default tertutup */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Sidebar terbuka */
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Tampilkan tombol close di mobile */
    .sidebar-close-btn {
        display: block !important;
    }
    
    /* Main content full lebar di mobile */
    .main-content {
        margin-left: 0 !important;
    }
    
    /* Top navbar kasih padding biar gak ketutupan tombol toggle */
    .top-navbar {
        padding-left: 72px !important;
        padding-right: 16px;
        max-width: 100vw;
        overflow: hidden;
    }
}


/* ============================================
   DESKTOP (≥ 1025px) - SIDEBAR SELALU TERBUKA
   ============================================ */
@media (min-width: 1025px) {
    /* Sembunyikan tombol toggle di desktop (kecuali kalo sidebar ditutup manual) */
    .sidebar-toggle-btn {
        display: none !important;
    }
    
    /* Sembunyikan tombol close di desktop */
    .sidebar-close-btn {
        display: none !important;
    }
    
    /* Sembunyikan overlay di desktop */
    .sidebar-overlay {
        display: none !important;
    }
    
    /* Sidebar selalu terbuka di desktop */
    .sidebar {
        transform: translateX(0) !important;
    }
    
    /* Main content dengan margin sidebar */
    .main-content {
        margin-left: 260px !important;
        max-width: calc(100vw - 260px) !important;
        width: auto !important;
    }
    
    /* MODE SIDEBAR TERTUTUP DI DESKTOP (opsional) */
    .sidebar.desktop-collapsed {
        transform: translateX(-100%) !important;
    }
    .main-content.desktop-expanded {
        margin-left: 0 !important;
    }
    /* Tampilkan tombol toggle kalo sidebar collapsed di desktop */
    .sidebar.desktop-collapsed ~ .sidebar-toggle-btn {
        display: flex !important;
    }
}


/* ============================================
   FIX MOBILE OVERFLOW & SIDEBAR TAP (2026)
   ============================================ */

/* Sembunyikan search box di layar sangat sempit */
@media (max-width: 420px) {
    .search-box-small {
        display: none !important;
    }
    .user-avatar .avatar-name {
        display: none;
    }
    .user-avatar {
        max-width: 40px;
    }
    .top-navbar {
        padding-left: 64px !important;
        padding-right: 12px !important;
    }
}

/* Sidebar header layout */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
    flex-shrink: 0;
}
.sidebar-header .sidebar-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0 8px 0 12px;
}

/* Sidebar link - pastikan bisa di-tap di mobile */
.sidebar-link {
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.1);
    cursor: pointer;
    pointer-events: auto;
}

/* Overlay: hanya area di kanan sidebar, jangan tutupi sidebar */
@media (max-width: 1024px) {
    .sidebar {
        z-index: 1100;
    }
    .sidebar.open {
        z-index: 1100;
        box-shadow: 8px 0 32px rgba(0,0,0,0.25);
    }
    .sidebar-overlay {
        z-index: 1090;
        left: 0;
        right: 0;
    }
    .sidebar-overlay.active {
        /* Overlay full, tapi sidebar di atasnya (z-index lebih tinggi) */
        display: block;
    }
    /* Sembunyikan tombol hamburger mengambang saat sidebar terbuka */
    body.sidebar-open .sidebar-toggle-btn {
        display: none !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Pastikan top-navbar tidak overflow horizontal */
.top-navbar {
    max-width: 100%;
    box-sizing: border-box;
}
.navbar-right {
    min-width: 0;
    flex-shrink: 1;
}


/* ============================================
   MOBILE OVERFLOW KILL-SWITCH (FINAL)
   Pastikan TIDAK ADA scroll horizontal di HP
   ============================================ */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .app-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .content-area {
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .top-navbar {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 12px 0 64px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        gap: 6px !important;
        height: auto !important;
        min-height: 56px !important;
    }
    .navbar-left {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }
    .navbar-left h2 {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    .navbar-right {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        gap: 6px !important;
        overflow: hidden !important;
    }
    .search-box-small {
        max-width: 110px !important;
        padding: 4px 8px !important;
    }
    .search-box-small input {
        width: 70px !important;
        max-width: 70px !important;
        font-size: 13px !important;
    }
    .dashboard-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .stat-card-dashboard {
        padding: 14px !important;
        gap: 10px !important;
        min-width: 0 !important;
        flex-direction: column !important;
        text-align: center !important;
    }
    .stat-icon-box {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        margin: 0 auto !important;
    }
    .stat-info .number {
        font-size: 18px !important;
    }
    .stat-info .label {
        font-size: 11px !important;
    }
    .slideshow-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 160px !important;
        margin-bottom: 16px !important;
    }
    .slide-content {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        max-width: calc(100% - 24px) !important;
    }
    .slide-content h2 {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }
    .slide-content p {
        font-size: 11px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .row-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .card-modern, .card, .buku-card {
        max-width: 100% !important;
        overflow: hidden !important;
    }
    h1, h2, h3, p, .welcome-text, .section-title {
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    img, table, .data-table {
        max-width: 100% !important;
    }
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 420px) {
    .search-box-small {
        display: none !important;
    }
    .user-avatar .avatar-name {
        display: none !important;
    }
    .top-navbar {
        padding-left: 60px !important;
        padding-right: 10px !important;
    }
    .dashboard-stats {
        gap: 8px !important;
    }
    .stat-card-dashboard {
        padding: 12px 8px !important;
    }
    .content-area {
        padding: 10px !important;
    }
    .navbar-left h2 {
        font-size: 14px !important;
    }
}

/* Greeting section - prevent long names from overflowing */
.greeting-section {
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
}
.greeting-section h1 {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.greeting-section p {
    color: var(--gray-500);
    margin-top: 6px;
    word-break: break-word;
}

@media (max-width: 768px) {
    .greeting-section h1 {
        font-size: 18px !important;
    }
    .greeting-section p {
        font-size: 13px !important;
    }
}

/* Ensure all grids never force page wider than viewport */
.row-grid,
.dashboard-stats,
.buku-dipinjam-grid,
.mini-buku-grid,
.features-grid,
.buku-grid,
.kategori-grid,
.laporan-grid,
.quick-actions-grid {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Card modern full width safe */
.card-modern {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.card-header, .card-body {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Halaman admin/siswa: jangan pakai padding-top marketing navbar */
body:has(.app-layout) {
    padding-top: 0 !important;
}
/* Fallback untuk browser lama */
.app-layout {
    margin-top: 0;
}
