body {
    background: #f4f6f9;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.app-wrapper {
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    min-height: 100vh;
    background: #1E2761;
    color: #CADCFC;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.2rem 1.2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand i {
    margin-right: 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
    color: #CADCFC;
    padding: 0.6rem 1.2rem;
    font-size: 0.92rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    margin-right: 10px;
    width: 18px;
    display: inline-block;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.1);
    border-left-color: #CADCFC;
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .nav-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nav-section-label {
    padding: 0.8rem 1.2rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(202,220,252,0.55);
}

.main-content {
    min-width: 0;
}

.page-body {
    min-height: calc(100vh - 130px);
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.badge-stock-ok { background: #d1f4e0; color: #14633d; }
.badge-stock-low { background: #fde2e1; color: #8a1f1a; }

/* Member photo thumbnails */
.member-photo-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e4ee;
}

.member-photo-preview {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e4ee;
}

.member-photo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f6fb;
    color: #9aa3c9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.member-photo-placeholder-lg {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

/* Printable Library Card */
.library-card {
    width: 340px;
    border: 1px solid #e2e4ee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(30, 39, 97, 0.1);
    font-family: 'Segoe UI', Arial, sans-serif;
}

.library-card-header {
    background: #1E2761;
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
}

.library-card-university {
    font-size: 0.85rem;
    font-weight: 700;
}

.library-card-title {
    font-size: 0.7rem;
    color: #CADCFC;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.library-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.library-card-photo {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: #f4f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa3c9;
    font-size: 1.8rem;
    overflow: hidden;
    flex-shrink: 0;
}

.library-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1E2761;
}

.library-card-meta {
    font-size: 0.78rem;
    color: #666;
}

.library-card-barcode {
    text-align: center;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px dashed #e2e4ee;
}

.library-card-code {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1E2761;
    margin-top: 4px;
    letter-spacing: 0.05em;
}

@media print {
    .no-print, .sidebar, .topbar, .page-footer {
        display: none !important;
    }
    .main-content, .page-body {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Form card widths (category/book add-edit forms) */
.form-card-sm {
    max-width: 500px;
}

.form-card-md {
    max-width: 650px;
}

/* Back link above page titles */
.back-link {
    text-decoration: none;
    color: #6c757d;
}

.back-link:hover {
    color: #1E2761;
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background: #dee2e6;
}

/* Login / Setup pages */
.auth-page {
    background: #1E2761;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

.auth-card {
    border-radius: 10px;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1E2761;
    margin-bottom: 0.25rem;
}

.auth-brand i {
    font-size: 1.5rem;
}
