:root {
    --library-red: #be1526;
    --library-blue: #0d4997;
    --ink: #1b2330;
    --soft: #f4f7fb;
}

body {
    background: var(--soft);
    color: var(--ink);
    font-family: 'Poppins', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bg-library {
    background: linear-gradient(90deg, var(--library-red), var(--library-blue));
}

.intro-panel,
.form-panel,
.result-panel,
.admin-card {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(22, 40, 72, .08);
}

.intro-panel {
    padding: 2rem;
    position: sticky;
    top: 1rem;
}

.intro-panel h1 {
    font-weight: 800;
    letter-spacing: 0;
}

.form-panel {
    padding: 1.5rem;
}

.result-panel {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-preview-wrap {
    display: flex;
    justify-content: center;
}

.card-preview {
    width: min(320px, 100%);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 30, 60, .18);
}

.table-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e3e8f0;
    overflow: hidden;
}

.stat {
    padding: 1.25rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e3e8f0;
}

.stat strong {
    display: block;
    font-size: 2rem;
    color: var(--library-blue);
}

@media (max-width: 768px) {
    .result-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .intro-panel {
        position: static;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    #printable-card,
    #printable-card * {
        visibility: visible;
    }
    #printable-card {
        position: fixed;
        inset: 0;
        width: 53.98mm;
        height: 85.60mm;
        margin: auto;
        box-shadow: none;
    }
}

/* Header & Navbar Custom Premium Styling */
.nnl-header {
    background-color: #264F8B;
    padding: 1.25rem 0;
    border-bottom: 2px solid #1c3d6c;
    position: relative;
    overflow: hidden;
}

.nnl-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../img/header-bg.png');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: auto 100%;
    filter: brightness(0) invert(1) opacity(0.18);
    pointer-events: none;
    z-index: 1;
}

.nnl-header .container {
    position: relative;
    z-index: 2;
}

.government-logo {
    transition: transform 0.3s ease;
}

.government-logo:hover {
    transform: scale(1.05);
}

.gov-sub-title {
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-bottom: 0;
    color: #ffccd5 !important; /* Soft light red/pink */
}

.gov-dept-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #f8f9fa !important; /* Off-white */
}

.library-main-title {
    font-size: 1.75rem;
    color: #ffffff !important; /* Pure white */
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

.app-sub-title {
    font-size: 0.95rem;
    color: #ffe066 !important; /* Elegant golden yellow */
    font-weight: 700;
}

.nepal-flag {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.nepal-flag:hover {
    transform: scale(1.08) rotate(3deg);
}

/* Custom Navigation Links */
.custom-nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}

.custom-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}

.custom-nav-link.active {
    color: #ffffff !important;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.custom-nav-link.admin-login-link {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.custom-nav-link.admin-login-link:hover {
    background: #ffffff !important;
    color: var(--library-blue) !important;
    border-color: #ffffff;
}

@media (max-width: 991.98px) {
    .navbar-nav {
        width: 100%;
        padding-top: 0.5rem;
    }
    .custom-nav-link {
        width: 100%;
        text-align: center;
        margin-bottom: 0.25rem;
    }
    .custom-nav-link.admin-login-link {
        margin-top: 0.5rem;
    }
}


