* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: #000000;
    min-height: 100vh;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: #0a0a0a;
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.header h1 {
    text-align: center;
    color: #d4af37;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    text-align: center;
    color: #ffffff;
    opacity: 0.85;
    font-size: 1.1rem;
}

/* Auth Forms */
.auth-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.auth-form {
    background: #0a0a0a;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    min-width: 300px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #d4af37;
}

.auth-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-btn {
    background: none;
    border: none;
    color: #d4af37;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.link-btn:hover {
    background-color: rgba(212, 175, 55, 0.15);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.5);
    background: #000000;
    color: #ffffff;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(255,255,255,0.6);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #d4af37;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: #d4af37;
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

.btn-secondary:hover {
    filter: brightness(0.9);
}

/* Dashboard */
.dashboard {
    display: none;
    background: #0a0a0a;
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(10px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info span:first-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.user-role {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    color: #000000;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.logout-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #000000;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Header actions (perfil + notificaciones) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #000000;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.header-btn:hover {
    transform: translateY(-1px);
}

.notifications-menu {
    position: relative;
}

.notifications-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    background: #0a0a0a;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 2147483647; /* por encima de todo */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notifications-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: #d4af37;
    font-weight: 700;
}

.notifications-dropdown-actions {
    display: flex;
    gap: 0.5rem;
}

.notifications-dropdown-list {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notifications-dropdown-list .notification-item {
    padding: 0.75rem;
}

.notifications-dropdown-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* Botones de acciones dentro del panel de notificaciones (más pequeños, oscuros y redondeados) */
.notifications-dropdown-actions .btn,
.notification-actions .btn {
    width: auto; /* evitar ancho completo */
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
    color: #f7f3e6;
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35);
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.notifications-dropdown-actions .btn:hover,
.notification-actions .btn:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 12px rgba(212,175,55,0.06);
}

/* Enfoque accesible para navegación por teclado */
.notifications-dropdown-actions .btn:focus,
.notification-actions .btn:focus {
    outline: 3px solid rgba(212,175,55,0.12);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(212,175,55,0.06);
}

/* Ajuste visual para botones secundarios que aún usan .btn-secondary dentro de notificaciones */
.notifications-dropdown-actions .btn.btn-secondary,
.notification-actions .btn.btn-secondary {
    background: #0b0b0b;
    color: #fffbe8;
    border: 1px solid rgba(212,175,55,0.15);
}

/* Scrollbar personalizado para los contenedores de notificaciones */
.notifications-dropdown,
.notifications-dropdown-list,
#notificationsList {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #d4af37 #0a0a0a;
}

/* WebKit browsers */
.notifications-dropdown::-webkit-scrollbar,
.notifications-dropdown-list::-webkit-scrollbar,
#notificationsList::-webkit-scrollbar {
    width: 8px;
}

.notifications-dropdown::-webkit-scrollbar-track,
.notifications-dropdown-list::-webkit-scrollbar-track,
#notificationsList::-webkit-scrollbar-track {
    background: #070707;
    border-radius: 8px;
}

.notifications-dropdown::-webkit-scrollbar-thumb,
.notifications-dropdown-list::-webkit-scrollbar-thumb,
#notificationsList::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e1c56d 0%, #b0892b 100%);
    border-radius: 8px;
    border: 2px solid #0a0a0a; /* espacio para darle contraste */
}

.notifications-dropdown::-webkit-scrollbar-thumb:hover,
.notifications-dropdown-list::-webkit-scrollbar-thumb:hover,
#notificationsList::-webkit-scrollbar-thumb:hover {
    filter: brightness(0.95);
}

/* Pequeño refinamiento para que el panel mantenga apariencia elegante */
.notifications-dropdown {
    padding: 0.25rem;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.nav-tab {
    padding: 1rem 2rem;
    background: #000000;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffffff;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-tab:hover::before {
    left: 100%;
}

.nav-tab:hover {
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

.nav-tab.active {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    color: #000000;
    border-color: #d4af37;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Catalog Controls */
.catalog-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.catalog-controls .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Search Container */
.search-container {
    margin-bottom: 2rem;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    grid-column: 1 / -1;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    font-size: 1rem;
    background: #000000;
    color: #ffffff;
}

.search-filters .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Book Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.book-card {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 16px;
    padding: 0;
    border: 1px solid rgba(212, 175, 55, 0.35);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover::before {
    opacity: 1;
}

.book-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: #d4af37;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.2);
}

/* Book Cover */
.book-cover {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    position: relative;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    border-radius: 16px 16px 0 0;
}

.book-card:hover .book-cover-image {
    transform: scale(1.05);
}

/* Book Info */
.book-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #d4af37;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.book-author {
    color: #ffffff;
    opacity: 0.9;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-style: italic;
}

.book-details {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.85;
    line-height: 1.6;
}

.book-details div {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.book-details strong {
    color: #d4af37;
    font-weight: 700;
}

.book-stock {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.stock-badge {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    border: 2px solid;
    background: transparent;
    transition: all 0.3s ease;
}

.stock-available {
    color: #d4af37;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.stock-available:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.stock-low {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.stock-low:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.stock-out {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.stock-out:hover {
    background: rgba(255, 107, 107, 0.15);
    transform: translateY(-1px);
}

/* Admin Panel */
.admin-panel {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
    position: relative;
    overflow: hidden;
}

.admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

.admin-panel h3 {
    margin-bottom: 1.5rem;
    color: #d4af37;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* Separación visual entre subsecciones de usuarios */
#usersSection .admin-panel + .admin-panel {
    margin-top: 3rem;
    border-top: 2px solid rgba(212, 175, 55, 0.2);
    padding-top: 2.5rem;
}

#usersSection .admin-panel p {
    color: #cccccc;
    margin-bottom: 1rem;
    font-style: italic;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.admin-form textarea {
    grid-column: 1 / -1;
    min-height: 80px;
    resize: vertical;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    background: #000000;
    color: #ffffff;
    font-family: inherit;
    transition: all 0.3s ease;
}

.admin-form textarea:focus {
    border-color: #d4af37;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
    outline: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.35);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.stat-card h3 {
    color: #d4af37;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #ffffff;
    opacity: 0.9;
    font-size: 1rem;
    font-weight: 600;
}

/* Stats Charts */
.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: #0a0a0a;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.chart-container h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #0a0a0a;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.close {
    color: #ffffff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #d4af37;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #d4af37;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
}

th, td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

th {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    font-weight: 800;
    color: #d4af37;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

tr:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.01);
}

tr:hover td {
    color: #ffffff;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 700;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.alert-warning {
    background: rgba(212, 175, 55, 0.12);
    color: #ffffff;
}

.alert-success {
    background: rgba(212, 175, 55, 0.2);
    color: #000000;
}

/* Alerta de stock bajo organizada */
.low-stock-list {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.35rem;
}
.low-stock-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.low-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4af37;
    flex: 0 0 8px;
}
.low-stock-text {
    color: #ffffff;
}

/* --- CATÁLOGO, BUSCAR, ADMINISTRACIÓN, PRÉSTAMOS, USUARIOS, ESTADÍSTICAS --- */

/* Títulos de sección */
.content-section h2 {
    color: #d4af37;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 0.5rem;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Paneles y tarjetas */
.admin-panel, .loansList, .usersTable, .stats-grid, .chart-container {
    background: #0a0a0a;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 2px 8px rgba(212,175,55,0.05);
}

.admin-panel h3,
.chart-container h3,
.stats-grid h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Botones principales */
.btn, .btn-secondary {
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, background 0.2s, color 0.2s;
    margin: 0.25rem 0.5rem 0.25rem 0;
}

.btn {
    background: #d4af37;
    color: #000;
}

.btn:hover {
    filter: brightness(1.1);
    background: #ffe082;
    color: #000;
}

.btn-secondary {
    background: #fff;
    color: #000;
}

.btn-secondary:hover {
    background: #d4af37;
    color: #000;
}

/* Filtros y formularios */
.search-filters,
.admin-form,
#loanForm,
#userForm {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-input,
.filter-select,
.admin-form input,
.admin-form select,
#loanForm input,
#loanForm select,
#userForm input,
#userForm select {
    background: #000;
    color: #fff;
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    min-width: 140px;
    transition: all 0.3s ease;
}

.admin-form input:focus,
.admin-form select:focus,
#loanForm input:focus,
#loanForm select:focus,
#userForm input:focus,
#userForm select:focus {
    border-color: #d4af37;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
    outline: none;
}

.search-input {
    flex: 2 1 220px;
}

.filter-select {
    flex: 1 1 120px;
    font-weight: 700;
    background: #d4af37;
    color: #000;
    border: none;
}

.admin-form textarea {
    min-height: 60px;
    resize: vertical;
    width: 100%;
}

.admin-form button,
#loanForm button,
#userForm button {
    flex: 1 1 180px;
    margin-top: 0.5rem;
}

/* Catálogo y resultados de búsqueda */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.book-card {
    background: #18120a;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #d4af37;
    color: #fff;
    transition: transform 0.2s;
}

.book-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: #ffe082;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #d4af37;
    margin-bottom: 0.5rem;
}

.book-author {
    color: #fff;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.book-details {
    font-size: 0.95rem;
    color: #fff;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.book-stock {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.stock-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    background: #d4af37;
    color: #000;
}

/* Tablas de usuarios y préstamos */
.usersTable, .loansList {
    background: #0a0a0a;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #d4af37;
    margin-top: 1.5rem;
    overflow-x: auto;
    max-width: 100%;
}

/* Estilos específicos para la tabla de usuarios */
.usersTable table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
    table-layout: fixed;
    max-width: 100%;
}

/* Asegurar que el contenedor de la tabla no se desborde */
.usersTable {
    max-width: 100%;
    box-sizing: border-box;
}

.usersTable th,
.usersTable td {
    padding: 0.4rem 0.3rem;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    word-wrap: break-word;
    overflow: hidden;
    font-size: 0.85rem;
}

/* Columnas específicas con anchos fijos - OPTIMIZADO */
.usersTable th:nth-child(1), /* ID */
.usersTable td:nth-child(1) {
    width: 3%;
    text-align: center;
}

.usersTable th:nth-child(2), /* NOMBRE */
.usersTable td:nth-child(2) {
    width: 7%;
}

.usersTable th:nth-child(3), /* EMAIL */
.usersTable td:nth-child(3) {
    width: 9%;
}

.usersTable th:nth-child(4), /* DNI */
.usersTable td:nth-child(4) {
    width: 3%;
}

.usersTable th:nth-child(5), /* TELÉFONO */
.usersTable td:nth-child(5) {
    width: 16%;
}

.usersTable th:nth-child(6), /* ROL */
.usersTable td:nth-child(6) {
    width: 14%;
}

.usersTable th:nth-child(7), /* ESTADO */
.usersTable td:nth-child(7) {
    width: 8%;
    text-align: center;
}

.usersTable th:nth-child(8), /* CONFIABILIDAD */
.usersTable td:nth-child(8) {
    width: 10%;
    text-align: center;
}

.usersTable th:nth-child(9), /* ACCIONES */
.usersTable td:nth-child(9) {
    width: 12%;
    text-align: center;
    white-space: nowrap;
    padding: 0.3rem 0.2rem;
    overflow: visible;
}

/* Contenedor para botones de acción */
.usersTable td:nth-child(9) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.3rem 0.1rem;
    min-width: 80px;
    text-align: center;
}

/* Estilos para los botones de acción - EXTREMO COMPACTO */
.usersTable .btn {
    padding: 0.15rem 0.25rem;
    font-size: 0.6rem;
    margin: 0;
    min-width: 35px;
    max-width: 50px;
    width: 100%;
    text-align: center;
    border-radius: 2px;
    white-space: nowrap;
}

.usersTable .btn-secondary {
    padding: 0.15rem 0.25rem;
    font-size: 0.6rem;
    margin: 0;
    min-width: 35px;
    max-width: 50px;
    width: 100%;
    text-align: center;
    border-radius: 2px;
    white-space: nowrap;
}

/* Estilos para badges de estado y confiabilidad */
.usersTable .status-badge,
.usersTable .reliability-score {
    display: inline-block;
    padding: 0.15rem 0.3rem;
    font-size: 0.6rem;
    font-weight: bold;
    border-radius: 2px;
    text-align: center;
    white-space: nowrap;
    min-width: 35px;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Asegurar que los badges no se desborden */
.usersTable td:nth-child(7),
.usersTable td:nth-child(8) {
    overflow: visible;
    word-wrap: normal;
    padding: 0.4rem 0.2rem;
}

/* Grid para tarjetas de préstamos (2 columnas en desktop, 1 en móvil) */
.loans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .loans-grid {
        grid-template-columns: 1fr;
    }
}

/* Contenedor más angosto para listas de préstamos */
.loans-narrow {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Información dentro de cada préstamo en formato vertical */
.loan-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #18120a;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #d4af37;
}

th {
    background: #0a0a0a;
    color: #d4af37;
    font-weight: 700;
}

tr:hover {
    background: rgba(212, 175, 55, 0.08);
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #18120a;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2.2rem;
    color: #ffe082;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #fff;
    opacity: 0.8;
    font-size: 1rem;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: #18120a;
    border-radius: 12px;
    border: 1px solid #d4af37;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #0a0a0a;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.close {
    color: #ffffff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #d4af37;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #d4af37;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1);
}

th, td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

th {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    font-weight: 800;
    color: #d4af37;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

tr:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.01);
}

tr:hover td {
    color: #ffffff;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 700;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.alert-warning {
    background: rgba(212, 175, 55, 0.12);
    color: #ffffff;
}

.alert-success {
    background: rgba(212, 175, 55, 0.2);
    color: #000000;
}

/* User Loans Section */
.user-loans-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.user-loan-card {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-loan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

.user-loan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

.loan-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.status-pendiente {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.status-aprobado {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.status-rechazado {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.status-devuelto {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.loan-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.loan-info-item {
    color: #ffffff;
    opacity: 0.9;
}

.loan-info-item strong {
    color: #d4af37;
    font-weight: 700;
}

.loan-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Notifications */
.notifications-container {
    margin-top: 2rem;
}

.notification {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37 0%, #ffe082 50%, #d4af37 100%);
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-danger {
    border-left: 4px solid #dc3545;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-title {
    color: #d4af37;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.notification-message {
    color: #ffffff;
    opacity: 0.9;
    line-height: 1.5;
}
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .auth-container {
        flex-direction: column;
        align-items: center;
    }

    .auth-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 2rem 1.5rem;
    }

    .brand-logo {
        width: 200px;
    }

    .dashboard {
        padding: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .user-info {
        justify-content: center;
        text-align: center;
    }

    .nav-tabs {
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .search-container {
        padding: 1.5rem;
    }

    .search-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .book-card {
        padding: 0;
    }

    .book-cover {
        height: 220px;
    }

    .book-info {
        padding: 1.25rem;
    }

    .admin-panel {
        padding: 1.5rem;
    }

    .admin-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stats-charts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-container {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1.5rem;
        max-height: 95vh;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .dashboard {
        padding: 1rem;
    }

    .nav-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .search-container {
        padding: 1rem;
    }

    .book-card {
        padding: 0;
    }

    .book-cover {
        height: 200px;
    }

    .book-info {
        padding: 1rem;
    }

    .admin-panel {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .auth-right {
        padding: 1.5rem 1rem;
    }

    .brand-logo {
        width: 160px;
    }
}

/* Hero Auth Layout */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    width: 100%;
    min-height: 75vh;
    background: #0a0a0a;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
}

.auth-left {
    background-image: url('https://images.unsplash.com/photo-1535905496755-26ae35d0ae54?q=80&w=1600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    filter: saturate(0.9) brightness(0.8);
    position: relative;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.auth-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    gap: 1.5rem;
    position: relative;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Logo imagen */
.brand-logo {
    width: 280px;
    max-width: 85%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.3));
}

/* Título de marca oculto si usamos imagen */
.brand-title {
    display: none;
}

.brand-sep {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #d4af37 50%, transparent 100%);
    margin-top: 8px;
    border-radius: 2px;
}

.auth-form-hero {
    width: 100%;
    max-width: 450px;
    border: none;
    background: transparent;
    padding: 0;
}

.auth-heading {
    text-align: center;
    color: #d4af37;
    margin: 1rem 0 1.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.label-hero {
    color: #d4af37;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: block;
}

.input-hero {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 999px;
    border: 2px solid transparent;
    outline: none;
    background: #ffffff;
    color: #000000;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-hero:focus {
    border-color: #d4af37;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

.select-hero {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-hero {
    margin-top: 1rem;
    border-radius: 999px;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.auth-links-hero {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.auth-links-hero .link-btn {
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.auth-links-hero .link-btn:hover {
    background-color: rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

/* Responsive hero */
@media (max-width: 900px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-left { display: none; }
}

/* ==================== ESTILOS PARA GESTIÓN DE DEVOLUCIONES ==================== */

/* Formularios de devolución */
.return-form, .not-returned-form {
    background: rgba(13, 13, 13, 0.95);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 2rem;
}

.return-form h3, .not-returned-form h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Controles de stock */
.stock-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stock-controls .btn {
    flex: 1;
    min-width: 200px;
}

/* Estado del stock */
.stock-status {
    background: rgba(13, 13, 13, 0.95);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 2rem;
}

.stock-summary, .condition-summary {
    margin-bottom: 2rem;
}

.stock-summary h4, .condition-summary h4 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stock-cards, .condition-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stock-card, .condition-card {
    background: rgba(20, 20, 20, 0.8);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-number, .condition-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stock-label, .condition-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Colores para diferentes estados */
.stock-card.available .stock-number {
    color: #28a745;
}

.stock-card.unavailable .stock-number {
    color: #ffc107;
}

.stock-card.out-of-stock .stock-number {
    color: #dc3545;
}

.stock-card.lost .stock-number {
    color: #6c757d;
}

.condition-card.good .condition-number {
    color: #28a745;
}

.condition-card.regular .condition-number {
    color: #ffc107;
}

.condition-card.bad .condition-number {
    color: #dc3545;
}

/* Grids de devoluciones y libros no devueltos */
.returns-grid, .not-returned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.return-card, .not-returned-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.return-card:hover, .not-returned-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.return-header, .not-returned-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.return-header h4, .not-returned-header h4 {
    color: #d4af37;
    font-size: 1.1rem;
    margin: 0;
}

.return-date, .not-returned-date {
    color: #ffffff;
    opacity: 0.7;
    font-size: 0.9rem;
}

.return-details, .not-returned-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.return-detail, .not-returned-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.return-detail strong, .not-returned-detail strong {
    color: #d4af37;
    font-weight: 600;
}

/* Badges para condiciones y motivos */
.condition-badge, .reason-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.condition-badge.condition-buen_estado {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.condition-badge.condition-estado_regular {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.condition-badge.condition-mal_estado {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.reason-badge.reason-no_devuelto {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.reason-badge.reason-devuelto_tarde {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.reason-badge.reason-perdido {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.reason-badge.reason-dañado_irreparable {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Botón de advertencia */
.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #000;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-2px);
}

/* Alertas de información */
.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid #17a2b8;
    color: #17a2b8;
}

/* ==================== ESTILOS PARA PERFILES DE USUARIOS ==================== */

/* Búsqueda de perfil */
.search-profile {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-profile select {
    flex: 1;
    min-width: 300px;
}

/* Contenedor del perfil */
.user-profile-container {
    background: rgba(13, 13, 13, 0.95);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 2rem;
    overflow: hidden;
}

.profile-header {
    background: rgba(212, 175, 55, 0.1);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.profile-header h3 {
    color: #d4af37;
    margin: 0;
    font-size: 1.5rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

.profile-content {
    padding: 2rem;
}

.profile-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.profile-section h4 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Información básica */
.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item strong {
    color: #d4af37;
    font-size: 0.9rem;
}

.info-item span {
    color: #ffffff;
    font-size: 1rem;
}

/* Confiabilidad */
.reliability-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.reliability-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.score-circle span {
    font-size: 2rem;
    font-weight: bold;
    color: #000;
}

.score-label {
    font-size: 0.8rem;
    color: #000;
    font-weight: 600;
}

.reliability-level {
    text-align: center;
}

.reliability-level span {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 0.5rem;
}

.level-description {
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.8;
}

.reliability-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.8);
}

.breakdown-item.good {
    border-left: 4px solid #28a745;
}

.breakdown-item.regular {
    border-left: 4px solid #ffc107;
}

.breakdown-item.bad {
    border-left: 4px solid #dc3545;
}

.breakdown-item.not-returned {
    border-left: 4px solid #6c757d;
}

.breakdown-label {
    color: #ffffff;
    font-weight: 500;
}

.breakdown-value {
    color: #d4af37;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Estadísticas de préstamos */
.loan-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.8;
}

/* Actividad reciente */
.recent-activity {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.8);
    border-left: 4px solid transparent;
}

.activity-item.activity-loan {
    border-left-color: #17a2b8;
}

.activity-item.activity-return {
    border-left-color: #28a745;
}

.activity-item.activity-not-returned {
    border-left-color: #dc3545;
}

.activity-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-text {
    color: #ffffff;
    font-weight: 500;
}

.activity-date {
    color: #d4af37;
    font-size: 0.9rem;
}

/* Lista de usuarios por confiabilidad */
.users-reliability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.user-reliability-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.user-reliability-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card-header h4 {
    color: #d4af37;
    margin: 0;
    font-size: 1.2rem;
}

.dni-badge {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-card-info {
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #d4af37;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-row .value {
    color: #ffffff;
    font-size: 0.9rem;
}

.user-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-card-stats .stat-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(13, 13, 13, 0.8);
    border-radius: 6px;
}

.user-card-stats .stat-number {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.user-card-stats .stat-label {
    font-size: 0.8rem;
}

.user-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Badges de estado y confiabilidad */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.status-inactive {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.status-suspended {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.status-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.reliability-score, .reliability-level {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.reliability-excellent {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.reliability-intermediate {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.reliability-low {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Responsive para devoluciones */
@media (max-width: 768px) {
    .returns-grid, .not-returned-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-cards, .condition-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stock-controls {
        flex-direction: column;
    }
    
    .stock-controls .btn {
        min-width: auto;
    }
    
    .return-detail, .not-returned-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    /* Responsive para perfiles */
    .reliability-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .users-reliability-grid {
        grid-template-columns: 1fr;
    }
    
    .user-card-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .profile-actions {
        width: 100%;
        justify-content: center;
    }
    
    .search-profile {
        flex-direction: column;
    }
    
    .search-profile select {
        min-width: auto;
        width: 100%;
    }
}

/* ===== DIFERENCIACIÓN VISUAL DE ROLES ===== */

/* Header con título dinámico centrado */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
    position: relative;
    overflow: visible;
    z-index: 1000;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37, #ffe082, #d4af37);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.welcome-title-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
    to { text-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

.welcome-subtitle {
    font-size: 1rem;
    color: #cccccc;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Títulos específicos por rol - TODOS EN DORADO */
.welcome-title.user-welcome {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.welcome-title.librarian-welcome {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.welcome-title.admin-welcome {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Header con información de usuario */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.user-role {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.role-badge.librarian-role {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.role-badge.admin-role {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

/* Iconos de navegación */
.nav-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.nav-text {
    font-weight: 600;
}

/* Indicadores de rol en pestañas - ELIMINADO */

/* Clases de indicadores de rol eliminadas */

/* Pestañas con estilo uniforme - CONSISTENCIA VISUAL */
.user-role-tab,
.librarian-role-tab,
.admin-role-tab {
    position: relative;
    background: #000000;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffffff;
    border-radius: 12px;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.user-role-tab:hover,
.librarian-role-tab:hover,
.admin-role-tab:hover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

/* Pestañas activas con estilo uniforme - CONSISTENCIA VISUAL */
.user-role-tab.active,
.librarian-role-tab.active,
.admin-role-tab.active {
    background: linear-gradient(135deg, #d4af37 0%, #ffe082 100%);
    color: #000000;
    border-color: #d4af37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-3px);
}

/* Separadores visuales en navegación */
.nav-tabs::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(212, 175, 55, 0.3) 20%, 
        rgba(212, 175, 55, 0.3) 80%, 
        transparent 100%);
}

/* Diferenciación extrema del contenedor de navegación */
.nav-tabs {
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 15px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.nav-tabs::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #d4af37 0%, 
        #ffe082 25%, 
        #d4af37 50%, 
        #ffe082 75%, 
        #d4af37 100%);
    animation: colorShift 4s ease-in-out infinite;
}

@keyframes colorShift {
    0%, 100% { 
        background: linear-gradient(90deg, 
            #d4af37 0%, 
            #ffe082 25%, 
            #d4af37 50%, 
            #ffe082 75%, 
            #d4af37 100%);
    }
    50% { 
        background: linear-gradient(90deg, 
            #ffe082 0%, 
            #d4af37 25%, 
            #ffe082 50%, 
            #d4af37 75%, 
            #ffe082 100%);
    }
}

/* Responsive para roles */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .role-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .nav-icon {
        font-size: 1rem;
        margin-right: 0.25rem;
    }
    
    /* Tabla de usuarios responsiva */
    .usersTable {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .usersTable table {
        min-width: 700px;
    }
    
    .usersTable th,
    .usersTable td {
        padding: 0.3rem 0.2rem;
        font-size: 0.8rem;
    }
    
    .usersTable th:nth-child(7),
    .usersTable td:nth-child(7) {
        width: 14%;
    }
    
    .usersTable th:nth-child(8),
    .usersTable td:nth-child(8) {
        width: 16%;
    }
    
    .usersTable th:nth-child(5),
    .usersTable td:nth-child(5) {
        width: 18%;
    }
    
    .usersTable th:nth-child(6),
    .usersTable td:nth-child(6) {
        width: 15%;
    }
    
    .usersTable th:nth-child(9),
    .usersTable td:nth-child(9) {
        width: 18%;
        padding: 0.2rem 0.05rem;
    }
    
    .usersTable td:nth-child(9) {
        flex-direction: column;
        gap: 0.1rem;
        padding: 0.2rem 0.05rem;
        min-width: 70px;
        text-align: center;
    }
    
    /* Badges responsivos */
    .usersTable .status-badge,
    .usersTable .reliability-score {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
        min-width: 40px;
    }
    
    .usersTable td:nth-child(7),
    .usersTable td:nth-child(8) {
        padding: 0.3rem 0.15rem;
    }
    
    .usersTable .btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.65rem;
        min-width: 40px;
        max-width: 55px;
    }
    
    .usersTable .btn-secondary {
        padding: 0.2rem 0.3rem;
        font-size: 0.65rem;
        min-width: 40px;
        max-width: 55px;
    }
    
    .role-indicator {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
}

/* ===== ESTILOS DE NOTIFICACIONES ===== */

/* Badge de notificaciones en la navegación */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Header de notificaciones */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.notifications-header h2 {
    color: #d4af37;
    font-size: 2rem;
    margin: 0;
}

.notification-actions {
    display: flex;
    gap: 1rem;
}

/* Filtros de notificaciones */
.notification-filters {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.notification-filters .filter-select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem 1rem;
    background: #000000;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Lista de notificaciones */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Notificación individual */
.notification-item {
    background: #000000;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.notification-item:hover {
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

.notification-item.unread {
    border-left: 4px solid #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.notification-item.read {
    opacity: 0.7;
}

/* Header de la notificación */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

/* Reservar espacio a la derecha para el indicador de no leída y evitar solapamiento con la hora */
.notification-header {
    position: relative;
    padding-right: 2rem; /* espacio para el punto */
}

.notification-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
}

.notification-time {
    font-size: 0.85rem;
    color: #d4af37;
    white-space: nowrap;
}

/* Asegurar que la hora se muestre por encima si hay alguna superposición mínima */
.notification-time {
    position: relative;
    z-index: 2;
}

/* Contenido de la notificación */
.notification-content {
    color: #cccccc;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Tipo de notificación */
.notification-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-type.loan_approved {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.notification-type.loan_rejected {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.notification-type.return_reminder {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.notification-type.overdue {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.notification-type.rating_update {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.notification-type.system {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

/* Acciones de la notificación */
.notification-actions-item {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.notification-actions-item .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Indicador de no leída */
.notification-unread-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: #d4af37;
    border-radius: 50%;
}

/* Ajustes del indicador: tamaño ligeramente mayor y borde de contraste para mejor visibilidad sin cubrir la hora */
.notification-unread-indicator {
    width: 9px;
    height: 9px;
    right: 0.9rem;
    top: 1rem;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.06);
    z-index: 1; /* detrás de la hora si hay solapamiento mínimo */
}

/* Mensaje cuando no hay notificaciones */
.no-notifications {
    text-align: center;
    padding: 4rem 2rem;
    color: #888888;
}

.no-notifications-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-notifications h3 {
    color: #d4af37;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-notifications p {
    font-size: 1rem;
    line-height: 1.5;
}

/* Contenedor de notificaciones en Mis Préstamos */
.notifications-container {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.notifications-container h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Responsive para notificaciones */
@media (max-width: 768px) {
    .notifications-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .notification-actions {
        width: 100%;
        justify-content: center;
    }
    
    .notification-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .notification-actions-item {
        flex-direction: column;
    }
    
    .notification-actions-item .btn {
        width: 100%;
    }
}

/* Estilos para el Perfil de Usuario */
.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-card {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.2);
}

.profile-card h3 {
    color: #d4af37;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 0.5rem;
}

/* Información Personal */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    border-left: 4px solid #d4af37;
}

.info-label {
    color: #d4af37;
    font-weight: bold;
    font-size: 0.9rem;
}

.info-value {
    color: #ffffff;
    font-weight: 500;
}

/* Estadísticas de Préstamos */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.stat-icon {
    font-size: 2rem;
    min-width: 60px;
    text-align: center;
}

.stat-content {
    flex: 1;
}

.stat-number {
    color: #d4af37;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    color: #ffffff;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Sistema de Puntos */
.points-container {
    text-align: center;
}

.points-display {
    margin-bottom: 2rem;
}

.points-number {
    color: #d4af37;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    margin-bottom: 0.5rem;
}

.points-label {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
}

.points-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.points-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    border-left: 4px solid #d4af37;
}

.points-source {
    color: #ffffff;
    font-size: 0.9rem;
}

.points-value {
    color: #d4af37;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Nivel de Confiabilidad */
.reliability-container {
    text-align: center;
}

.reliability-score {
    color: #d4af37;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    margin-bottom: 1rem;
}

.reliability-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.reliability-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f4d03f);
    border-radius: 8px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.reliability-status {
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Responsive Design para Perfil */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        min-width: 50px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .points-number {
        font-size: 2.5rem;
    }
    
    .reliability-score {
        font-size: 2.5rem;
    }
}

/* ===== ESTILOS PARA CAMPOS DE BÚSQUEDA DE LIBROS ===== */

.book-search-container {
    position: relative;
    width: 100%;
}

.book-search-container input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.book-search-container input[type="text"]:focus {
    outline: none;
    border-color: #f4d03f;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.book-search-container input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.book-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 2px solid #d4af37;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.book-suggestions.show {
    display: block;
}

.book-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-suggestion-item:hover,
.book-suggestion-item.selected {
    background: rgba(212, 175, 55, 0.1);
}

.book-suggestion-item:last-child {
    border-bottom: none;
}

.book-suggestion-title {
    font-weight: bold;
    color: #d4af37;
    font-size: 14px;
}

.book-suggestion-author {
    color: #ffffff;
    font-size: 12px;
    opacity: 0.8;
}

.book-suggestion-isbn {
    color: #ffffff;
    font-size: 11px;
    opacity: 0.6;
}

.book-suggestion-stock {
    color: #4CAF50;
    font-size: 11px;
    font-weight: bold;
}

.book-suggestion-no-stock {
    color: #f44336;
    font-size: 11px;
    font-weight: bold;
}

/* Responsive para campos de búsqueda */
@media (max-width: 768px) {
    .book-search-container input[type="text"] {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .book-suggestion-item {
        padding: 10px 12px;
    }
    
    .book-suggestion-title {
        font-size: 13px;
    }
    
    .book-suggestion-author,
    .book-suggestion-isbn,
    .book-suggestion-stock,
    .book-suggestion-no-stock {
        font-size: 10px;
    }
}