/* =============================================================
   SISTEMA DE BIBLIOTECA MUNICIPAL — MP MOYOBAMBA
   Hoja de estilos principal
   ============================================================= */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables de diseño ───────────────────────────────────── */
:root {
    /* Paleta principal */
    --primary:          #1B4F72;
    --primary-dark:     #0D2137;
    --primary-light:    #2E86C1;
    --secondary:        #1E8449;
    --secondary-light:  #28B463;
    --accent:           #F39C12;
    --accent-light:     #F8C471;
    --danger:           #C0392B;
    --warning:          #E67E22;
    --info:             #2980B9;
    --success:          #27AE60;

    /* Neutros */
    --white:            #FFFFFF;
    --light:            #F4F7FA;
    --gray-100:         #F8F9FA;
    --gray-200:         #E9ECEF;
    --gray-300:         #DEE2E6;
    --gray-400:         #CED4DA;
    --gray-500:         #ADB5BD;
    --gray-600:         #6C757D;
    --gray-700:         #495057;
    --gray-800:         #343A40;
    --gray-900:         #212529;
    --dark:             #0D1117;

    /* Sombras */
    --shadow-xs:        0 1px 4px rgba(13, 33, 55, 0.08);
    --shadow-sm:        0 2px 12px rgba(13, 33, 55, 0.10);
    --shadow-md:        0 8px 28px rgba(13, 33, 55, 0.14);
    --shadow-lg:        0 20px 60px rgba(13, 33, 55, 0.18);
    --shadow-xl:        0 32px 80px rgba(13, 33, 55, 0.22);
    --shadow-colored:   0 8px 28px rgba(27, 79, 114, 0.30);

    /* Radios */
    --radius-xs:        4px;
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        24px;
    --radius-pill:      999px;

    /* Transiciones */
    --transition-fast:  all 0.15s ease;
    --transition:       all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  all 0.45s cubic-bezier(0.4, 0, 0.2, 1);

    /* Tipografía */
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading:     'Playfair Display', Georgia, serif;
    --font-mono:        'Courier New', monospace;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--gray-800);
    background-color: var(--light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-dark);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition-fast);
}

a:hover { color: var(--primary-light); }

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

/* ── Utilidades globales ────────────────────────────────────── */
.text-primary   { color: var(--primary)         !important; }
.text-secondary { color: var(--secondary-light)  !important; }
.text-accent    { color: var(--accent)           !important; }
.bg-primary-dark{ background: var(--primary-dark)!important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary-light));
    border-radius: var(--radius-pill);
    margin: 0.75rem auto 1.5rem;
}

/* ── Botones personalizados ─────────────────────────────────── */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: var(--transition);
    box-shadow: var(--shadow-colored);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(27, 79, 114, 0.40);
    color: var(--white);
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(40, 180, 99, 0.35);
    color: var(--white);
}

.btn-accent-custom {
    background: linear-gradient(135deg, var(--accent), #E67E22);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-accent-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(243, 156, 18, 0.40);
    color: var(--white);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* ── Botón Extra Pequeño (.btn-xs) ─────────────────────────── */
.btn-xs {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.25;
    border-radius: var(--radius-xs, 0.25rem);
}

/* ════════════════════════════════════════════════════════════
   PORTAL PÚBLICO — NAVBAR
   ════════════════════════════════════════════════════════════ */
.pub-topbar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    padding: 0.4rem 0;
}

.pub-topbar a { color: rgba(255,255,255,0.75); }
.pub-topbar a:hover { color: var(--accent-light); }

.pub-navbar {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1040;
    transition: var(--transition);
}

.pub-navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.pub-navbar .navbar-brand img {
    height: 46px;
}

.pub-navbar .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pub-navbar .brand-text .brand-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.pub-navbar .brand-text .brand-sub {
    font-size: 0.68rem;
    color: var(--gray-600);
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pub-navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700) !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.pub-navbar .nav-link:hover,
.pub-navbar .nav-link.active {
    color: var(--primary) !important;
    background: rgba(27, 79, 114, 0.07);
}

.pub-navbar .nav-link.active {
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   HERO SECTION
   ════════════════════════════════════════════════════════════ */
.hero-section {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 45%, #1a5276 100%);
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.hero-shape-1 {
    width: 500px;
    height: 500px;
    background: var(--secondary-light);
    top: -100px;
    right: -100px;
}

.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -80px;
    left: 10%;
}

.hero-shape-3 {
    width: 200px;
    height: 200px;
    background: var(--white);
    top: 50%;
    left: 60%;
    transform: translate(-50%,-50%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
    background-size: 30px 30px;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 680px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-content h1 span {
    color: var(--accent-light);
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 520px;
}

/* Search Hero */
.search-hero {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    max-width: 580px;
}

.search-hero input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--gray-800);
    background: transparent;
}

.search-hero input::placeholder {
    color: var(--gray-500);
}

.search-hero button {
    background: linear-gradient(135deg, var(--accent), #E67E22);
    color: var(--white);
    border: none;
    padding: 0 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.search-hero button:hover {
    background: linear-gradient(135deg, #E67E22, var(--accent));
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

.hero-stat strong {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-light);
    font-family: var(--font-heading);
}

.hero-stat span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Hero image side */
.hero-image-side {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-books-illustration {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    transform: perspective(800px) rotateY(-8deg) rotateX(3deg);
    max-width: 340px;
}

.hero-book-spine {
    height: 180px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.3);
}

.hero-book-spine:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 8px 12px 28px rgba(0,0,0,0.4);
}

.hero-book-spine::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

/* ════════════════════════════════════════════════════════════
   STATS BAR
   ════════════════════════════════════════════════════════════ */
.stats-bar {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-right: 1px solid var(--gray-200);
}

.stat-item:last-child { border-right: none; }

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

.stat-icon-box.primary   { background: rgba(27, 79, 114, 0.12); color: var(--primary); }
.stat-icon-box.secondary { background: rgba(40, 180, 99, 0.12);  color: var(--secondary-light); }
.stat-icon-box.accent    { background: rgba(243, 156, 18, 0.12); color: var(--accent); }
.stat-icon-box.info      { background: rgba(41, 128, 185, 0.12); color: var(--info); }

.stat-text strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    line-height: 1;
}

.stat-text span {
    font-size: 0.78rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════════════════
   CATEGORÍAS
   ════════════════════════════════════════════════════════════ */
.categories-section {
    padding: 5rem 0;
    background: var(--gray-100);
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    text-decoration: none;
}

.category-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-card h5 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.category-card small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ════════════════════════════════════════════════════════════
   TARJETAS DE LIBROS
   ════════════════════════════════════════════════════════════ */
.books-section {
    padding: 5rem 0;
    background: var(--white);
}

.book-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--gray-200);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.book-cover {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.85);
}

.book-cover-placeholder i {
    font-size: 2.5rem;
    opacity: 0.7;
}

.book-cover-placeholder span {
    font-size: 0.7rem;
    text-align: center;
    padding: 0 0.5rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.book-availability {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.availability-available {
    background: var(--success);
    color: var(--white);
}

.availability-unavailable {
    background: var(--danger);
    color: var(--white);
}

.availability-limited {
    background: var(--warning);
    color: var(--white);
}

.book-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-category-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.book-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.book-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
}

.book-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
}

.book-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════
   CATÁLOGO — FILTROS
   ════════════════════════════════════════════════════════════ */
.catalog-page {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.filter-sidebar {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 90px;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label.group-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.6rem;
    display: block;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-700);
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.filter-check:hover { color: var(--primary); }

.filter-check input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
}

.filter-check .count {
    margin-left: auto;
    font-size: 0.7rem;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
}

.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.catalog-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.catalog-search input {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    outline: none;
}

.catalog-search input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.12);
}

.catalog-search .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* ════════════════════════════════════════════════════════════
   PÁGINA DE DETALLE DE LIBRO
   ════════════════════════════════════════════════════════════ */
.book-detail-page {
    padding: 3rem 0;
}

.book-detail-cover {
    width: 100%;
    max-width: 280px;
    height: 380px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-detail-info h1 {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
}

.book-detail-author {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.book-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.book-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    color: var(--gray-700);
}

.book-detail-meta-item i {
    color: var(--primary);
}

.availability-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ════════════════════════════════════════════════════════════
   FOOTER PÚBLICO
   ════════════════════════════════════════════════════════════ */
.pub-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 1.5rem;
}

.pub-footer .footer-brand h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.pub-footer .footer-brand p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1rem;
}

.pub-footer .footer-desc {
    font-size: 0.85rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
    max-width: 280px;
}

.pub-footer .footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-light);
    margin-bottom: 1.25rem;
}

.pub-footer .footer-links {
    list-style: none;
    padding: 0;
}

.pub-footer .footer-links li {
    margin-bottom: 0.6rem;
}

.pub-footer .footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.pub-footer .footer-links a:hover {
    color: var(--accent-light);
    padding-left: 4px;
}

.pub-footer .footer-contact {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.pub-footer .footer-contact i {
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.pub-footer .footer-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 2rem 0 1rem;
}

.pub-footer .footer-bottom {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

/* ════════════════════════════════════════════════════════════
   LOGIN / AUTH
   ════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-panel-left {
    flex: 1;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, #1a7a50 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 28px 28px;
}

.auth-panel-left .auth-logo {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 3rem;
}

.auth-panel-left .auth-logo h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.auth-panel-left .auth-logo p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    max-width: 260px;
}

.auth-features {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 320px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}

.auth-feature-item:hover {
    background: rgba(255,255,255,0.12);
}

.auth-feature-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

.auth-feature-text strong {
    display: block;
    font-size: 0.88rem;
    color: var(--white);
    font-weight: 600;
}

.auth-feature-text span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
}

.auth-panel-right {
    flex: 0 0 480px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 360px;
}

.auth-form-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.auth-form-subtitle {
    font-size: 0.88rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.form-floating-custom {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-floating-custom label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    display: block;
    margin-bottom: 0.4rem;
}

.form-floating-custom .input-icon {
    position: relative;
}

.form-floating-custom .input-icon input {
    width: 100%;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    outline: none;
    color: var(--gray-800);
    background: var(--gray-100);
}

.form-floating-custom .input-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.12);
    background: var(--white);
}

.form-floating-custom .input-icon i.icon-left {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 0.9rem;
    pointer-events: none;
}

.form-floating-custom .input-icon .btn-eye {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.form-floating-custom .input-icon .btn-eye:hover {
    color: var(--primary);
}

/* ════════════════════════════════════════════════════════════
   ADMIN / INTRANET — LAYOUT SIDEBAR
   ════════════════════════════════════════════════════════════ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--light);
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0f2d47 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transition: var(--transition);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.sidebar-nav-section {
    margin-bottom: 1.5rem;
}

.sidebar-nav-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    margin-bottom: 0.15rem;
}

.sidebar-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
    text-decoration: none;
}

.sidebar-nav-item.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
    color: var(--white);
    font-weight: 600;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 65%;
    background: var(--secondary-light);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav-item .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0.75rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.1); }

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #E67E22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--white);
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.82rem;
    color: var(--white);
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-user-info span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
}

/* Admin Content */
.admin-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* Admin Topbar */
.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-xs);
}

.admin-topbar .page-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.admin-topbar .breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    font-size: 0.78rem;
}

.admin-topbar .breadcrumb-item a { color: var(--primary-light); }
.admin-topbar .breadcrumb-item.active { color: var(--gray-500); }

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    position: relative;
    text-decoration: none;
}

.topbar-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
    border-color: var(--gray-300);
}

.topbar-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* Admin Main */
.admin-main {
    padding: 1.75rem;
    flex: 1;
}

/* KPI Cards */
.kpi-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    transition: var(--transition);
    height: 100%;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-body {}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.kpi-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* Admin Panels / Cards */
.admin-panel {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.admin-panel-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-panel-title i { color: var(--primary-light); }

.admin-panel-body { padding: 1.5rem; }

.admin-panel-table {
    padding: 0;
}

/* Data Tables */
.data-table {
    width: 100%;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
    background: rgba(27, 79, 114, 0.03);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pending   { background: #FEF3CD; color: #856404; }
.status-active    { background: #D1FAE5; color: #065F46; }
.status-returned  { background: #E0E7FF; color: #3730A3; }
.status-overdue   { background: #FEE2E2; color: #991B1B; }
.status-rejected  { background: #F1F5F9; color: #475569; }

/* Action buttons in tables */
.btn-action {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-action:hover { border-color: currentColor; }
.btn-action.edit  { color: var(--info); }
.btn-action.edit:hover  { background: rgba(41, 128, 185, 0.1); }
.btn-action.delete{ color: var(--danger); }
.btn-action.delete:hover{ background: rgba(192, 57, 43, 0.1); }
.btn-action.view  { color: var(--primary); }
.btn-action.view:hover  { background: rgba(27, 79, 114, 0.1); }
.btn-action.approve{ color: var(--success); }
.btn-action.approve:hover{ background: rgba(39, 174, 96, 0.1); }

/* ════════════════════════════════════════════════════════════
   LECTOR — INTRANET
   ════════════════════════════════════════════════════════════ */
.lector-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--light);
}

.lector-sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.lector-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Welcome card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.welcome-card::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.welcome-card::after {
    content: '';
    position: absolute;
    right: 40px;
    bottom: -60px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.welcome-card h2 {
    color: var(--white);
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

.welcome-card p {
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
    position: relative;
    z-index: 1;
    margin-top: 0.25rem;
}

/* Loan card for lector */
.prestamo-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: var(--transition-fast);
    margin-bottom: 1rem;
}

.prestamo-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.prestamo-cover {
    width: 60px;
    height: 80px;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    overflow: hidden;
}

.prestamo-info h5 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.prestamo-info .author {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.prestamo-dates {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.prestamo-date {
    font-size: 0.75rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.prestamo-date i { color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   MODALES
   ════════════════════════════════════════════════════════════ */
.modal-custom .modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-custom .modal-header .modal-title {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.modal-custom .btn-close {
    filter: brightness(0) invert(1);
}

.modal-custom .modal-content {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

/* ════════════════════════════════════════════════════════════
   PAGINACIÓN
   ════════════════════════════════════════════════════════════ */
.pagination .page-link {
    border-color: var(--gray-300);
    color: var(--primary);
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-xs) !important;
}

.pagination .page-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ════════════════════════════════════════════════════════════
   ALERTAS FLASH
   ════════════════════════════════════════════════════════════ */
.alert-custom {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ════════════════════════════════════════════════════════════
   LOADING / SKELETON
   ════════════════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-xs);
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════════════
   ANIMACIONES
   ════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fade-up  { animation: fadeInUp 0.5s ease both; }
.animate-fade     { animation: fadeIn   0.4s ease both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Hover lift */
.hover-lift {
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-content {
        margin-left: 0;
    }
    .lector-sidebar {
        transform: translateX(-100%);
    }
    .lector-sidebar.open {
        transform: translateX(0);
    }
    .lector-content {
        margin-left: 0;
    }
    .hero-content h1 {
        font-size: 2.1rem;
    }
    .hero-image-side {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .auth-panel-left { display: none; }
    .auth-panel-right { flex: 1; }

    .hero-section {
        min-height: 460px;
    }

    .search-hero {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .search-hero button {
        justify-content: center;
        padding: 0.85rem;
        border-radius: 0;
    }

    .hero-stats {
        gap: 1rem;
    }

    .admin-topbar {
        padding: 0.75rem 1rem;
    }

    .admin-main {
        padding: 1rem;
    }
}

/* ════════════════════════════════════════════════════════════
   SCROLLBAR GLOBAL (browsers modernos)
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ════════════════════════════════════════════════════════════
   HERO — PORTAL PÚBLICO
   ════════════════════════════════════════════════════════════ */
.hero-books-illustration {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    justify-content: center;
    padding: 2rem 1rem;
}
.hero-book-spine {
    width: 48px;
    min-height: 160px;
    border-radius: 4px 8px 8px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease;
    cursor: default;
    animation: bookRise 0.6s ease both;
}
.hero-book-spine:hover { transform: translateY(-10px) scale(1.04); }
.hero-book-spine:nth-child(1)  { animation-delay: 0.05s; min-height: 200px; }
.hero-book-spine:nth-child(2)  { animation-delay: 0.10s; min-height: 230px; }
.hero-book-spine:nth-child(3)  { animation-delay: 0.15s; min-height: 180px; }
.hero-book-spine:nth-child(4)  { animation-delay: 0.20s; min-height: 260px; }
.hero-book-spine:nth-child(5)  { animation-delay: 0.25s; min-height: 200px; }
.hero-book-spine:nth-child(6)  { animation-delay: 0.30s; min-height: 240px; }
.hero-book-spine:nth-child(7)  { animation-delay: 0.35s; min-height: 190px; }
.hero-book-spine:nth-child(8)  { animation-delay: 0.40s; min-height: 220px; }
.hero-book-spine:nth-child(9)  { animation-delay: 0.45s; min-height: 170px; }
@keyframes bookRise {
    from { opacity:0; transform: translateY(30px); }
    to   { opacity:1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   HERO STATS
   ════════════════════════════════════════════════════════════ */
.hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.hero-stat strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-serif);
}
.hero-stat span {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ════════════════════════════════════════════════════════════
   STATS BAR
   ════════════════════════════════════════════════════════════ */
.stats-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-xs);
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1rem;
    border-right: 1px solid var(--gray-200);
}
.stat-item:last-child { border-right: none; }
.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-icon-box.primary   { background: rgba(27,79,114,0.10);  color: var(--primary); }
.stat-icon-box.secondary { background: rgba(40,180,99,0.10);  color: var(--secondary-light); }
.stat-icon-box.accent    { background: rgba(243,156,18,0.10); color: var(--accent); }
.stat-icon-box.info      { background: rgba(41,128,185,0.10); color: var(--info); }
.stat-text strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-serif);
    line-height: 1.2;
}
.stat-text span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ════════════════════════════════════════════════════════════
   SECCIONES DE CONTENIDO PÚBLICO
   ════════════════════════════════════════════════════════════ */
.categories-section {
    background: var(--light);
    padding: 5rem 0;
}
.books-section {
    background: var(--white);
    padding: 5rem 0;
}
.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary-light));
    border-radius: 999px;
    margin-bottom: 0.75rem;
}
.section-subtitle {
    font-size: 0.95rem;
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   CATEGORY CARDS
   ════════════════════════════════════════════════════════════ */
.category-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    display: block;
    color: inherit;
    height: 100%;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 0.75rem;
}
.category-card h5 {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}
.category-card small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* ════════════════════════════════════════════════════════════
   BOOK DETAIL PAGE
   ════════════════════════════════════════════════════════════ */
.book-detail-page {
    padding: 2.5rem 0;
    background: var(--light);
    min-height: 70vh;
}
.book-detail-cover {
    width: 200px;
    height: 280px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1rem;
}
.book-detail-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
}
.book-detail-info h1 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}
.book-detail-author {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.book-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.book-detail-meta-item {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.availability-badge-lg {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    gap: 0.4rem;
    align-items: center;
}

/* ════════════════════════════════════════════════════════════
   CATALOG PAGE
   ════════════════════════════════════════════════════════════ */
.catalog-page {
    padding: 2.5rem 0;
    background: var(--light);
}
.filter-sidebar {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 80px;
}
.filter-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.filter-group .group-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    display: block;
}
.filter-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.82rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: color 0.15s;
}
.filter-check:hover { color: var(--primary); }
.filter-check .count {
    margin-left: auto;
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
}
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 0;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* ════════════════════════════════════════════════════════════
   LECTOR — DASHBOARD
   ════════════════════════════════════════════════════════════ */
.lector-wrapper {
    display: flex;
    min-height: 100vh;
}
.lector-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0F3055 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.lector-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    background: var(--light);
    min-height: 100vh;
}
@media (max-width: 991.98px) {
    .lector-sidebar { transform: translateX(-100%); }
    .lector-sidebar.open { transform: translateX(0); }
    .lector-content { margin-left: 0; }
}
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.welcome-card::before {
    content:'';
    position:absolute;
    width:300px; height:300px;
    background: rgba(255,255,255,0.05);
    border-radius:50%;
    top:-100px; right:-80px;
    pointer-events:none;
}
.welcome-card h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}
.welcome-card p { color: rgba(255,255,255,0.75); font-size: 0.9rem; }

/* ════════════════════════════════════════════════════════════
   PRÉSTAMO CARD (Lector)
   ════════════════════════════════════════════════════════════ */
.prestamo-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}
.prestamo-card:hover { box-shadow: var(--shadow-md); }
.prestamo-cover {
    width: 52px;
    height: 70px;
    border-radius: 5px;
    flex-shrink: 0;
}
.prestamo-info { flex: 1; min-width: 0; }
.prestamo-info h5 {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prestamo-info .author {
    font-size: 0.78rem;
    color: var(--gray-500);
}
.prestamo-dates {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.prestamo-date {
    font-size: 0.77rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ════════════════════════════════════════════════════════════
   AUTH PAGE
   ════════════════════════════════════════════════════════════ */
.auth-page {
    display: flex;
    min-height: 100vh;
}
.auth-panel-left {
    flex: 0 0 400px;
    background: linear-gradient(160deg, var(--primary-dark) 0%, #1A5276 100%);
    display: flex;
    flex-direction: column;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.auth-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 2rem;
}
.auth-form-container {
    width: 100%;
    max-width: 380px;
}
.auth-form-title {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}
.auth-form-subtitle {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin-bottom: 1.75rem;
}
.auth-logo {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 2.5rem;
}
.auth-logo h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
}
.auth-features {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.auth-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.auth-feature-text strong {
    display: block;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
}
.auth-feature-text span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.form-floating-custom {
    margin-bottom: 1rem;
}
.form-floating-custom label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    display: block;
    margin-bottom: 0.3rem;
}
.input-icon {
    position: relative;
}
.input-icon .icon-left {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.85rem;
    pointer-events: none;
}
.input-icon input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: var(--transition-fast);
    outline: none;
    font-family: var(--font-body);
}
.input-icon input:focus {
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}
.btn-eye {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    transition: color 0.15s;
}
.btn-eye:hover { color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   KPI CARDS — Admin Dashboard
   ════════════════════════════════════════════════════════════ */
.kpi-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.kpi-body { flex: 1; min-width: 0; }
.kpi-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
    font-weight: 600;
}
.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-serif);
    line-height: 1.1;
}
.kpi-trend {
    font-size: 0.73rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.15rem;
}
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   MODAL CUSTOM
   ════════════════════════════════════════════════════════════ */
.modal-custom {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.modal-custom .modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}
.modal-custom .modal-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.modal-custom .btn-close { filter: invert(1) opacity(0.7); }

/* ════════════════════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════════════════════ */
.hover-lift { transition: var(--transition); }
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}
.fw-600 { font-weight: 600; }
.text-primary { color: var(--primary) !important; }
.btn-accent-custom {
    background: linear-gradient(135deg, var(--accent), var(--warning));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.btn-accent-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243,156,18,0.35);
    color: #fff;
}
