/* ===== SILPJ Custom Styles ===== */

/* Sidebar */
.silpj-sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Brand */
.silpj-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0.5rem;
}

.silpj-brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: -0.5px;
}

/* Nav */
.silpj-nav {
    list-style: none;
    padding: 0.5rem 0.75rem;
    margin: 0;
}

.silpj-nav li {
    margin-bottom: 2px;
}

/* Section label */
.silpj-nav-section {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Nav link */
.silpj-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.silpj-nav-link i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.silpj-nav-link:hover {
    background: #f3f4f6;
    color: #10b981;
}

.silpj-nav-link.active {
    background: #10b981;
    color: #ffffff;
}

.silpj-nav-link.active:hover {
    background: #059669;
    color: #ffffff;
}

.silpj-nav-link .badge {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Topbar */
.silpj-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Main content background */
.silpj-main {
    background: #f9fafb;
}

/* Hamburger button (hidden by default, shown on mobile) */
.silpj-hamburger {
    display: none;
    background: transparent;
    border: none;
    padding: 0.4rem 0.6rem;
    margin-right: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: #4b5563;
}

.silpj-hamburger:hover {
    background: #f3f4f6;
}

.silpj-hamburger i {
    font-size: 1.4rem;
    display: block;
}

/* Backdrop overlay saat sidebar terbuka di mobile */
.silpj-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.silpj-backdrop.show {
    display: block;
    opacity: 1;
}

/* ============ PWA Install Banner ============ */
.pwa-install-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUpBanner 0.4s ease-out;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.pwa-install-content {
    flex-grow: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.pwa-install-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.pwa-install-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install-actions .btn {
    font-size: 12px;
    padding: 5px 10px;
    white-space: nowrap;
}

.pwa-install-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    color: #9ca3af;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.pwa-install-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ============ Responsive ============ */
@media (max-width: 991px) {
    .silpj-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .silpj-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .silpj-sidebar.show {
        left: 0;
    }
}

/* Kalau layar sempit, install banner actions pindah ke bawah */
@media (max-width: 420px) {
    .pwa-install-banner {
        flex-wrap: wrap;
        padding: 12px 14px;
    }
    .pwa-install-content {
        flex: 1 1 calc(100% - 56px);
    }
    .pwa-install-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* Kalau di desktop, install banner tidak tampil */
@media (min-width: 992px) {
    .pwa-install-banner {
        display: none !important;
    }
}
