/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #00A651 0%, #005B2F 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Estilos del login */
.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
}

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

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 150px;
    height: auto;
}

.logo h1 {
    color: #00A651;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 1.1em;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background-color: #fee;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.alert-success {
    background-color: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

/* Tabs */
.form-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #f1f1f1;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #00A651;
    border-bottom-color: #00A651;
}

.tab-btn:hover {
    color: #00A651;
}

/* Formularios */
.form-tab {
    display: none;
}

.form-tab.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00A651;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #00A651 0%, #005B2F 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 166, 81, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

/* Dashboard */
.dashboard {
    width: 90%;
    max-width: none;
    margin: 0 auto;
    padding: 20px;
    min-width: 1000px; /* Ancho mínimo para evitar que se comprima demasiado */
}

.header {
    background: white;
    padding: 18px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 2em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Tabla */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 25px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9em;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Estados */
.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-disponible {
    background: #c6f6d5;
    color: #22543d;
}

.status-prestado {
    background: #fed7d7;
    color: #c53030;
}

.status-activo {
    background: #bee3f8;
    color: #2a69ac;
}

.status-devuelto {
    background: #c6f6d5;
    color: #22543d;
}

.status-vencido {
    background: #fed7d7;
    color: #c53030;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard {
        width: 95%;
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-container {
        padding: 30px 20px;
    }
    
    .dashboard {
        width: 98%;
        min-width: auto;
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 20px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-container {
        padding: 15px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
}
/* 
Estilos adicionales para optimizar el espacio */
.table-container h2 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* Hacer botones más compactos en las tablas */
.table .btn {
    padding: 6px 12px;
    font-size: 0.85em;
    margin: 2px;
}

/* Optimizar el espacio en los formularios de filtro */
.table-container input[type="text"] {
    padding: 8px 12px;
    font-size: 0.9em;
    max-width: 300px;
}

/* Mejorar la visualización de estados */
.status {
    padding: 3px 10px;
    font-size: 0.8em;
    white-space: nowrap;
}

/* Optimizar el espacio en la información de préstamos */
.table td div {
    line-height: 1.3;
}

.table td input[type="date"] {
    font-size: 0.8em;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 130px;
}

/* Hacer que las columnas de acciones sean más estrechas */
.table th:last-child,
.table td:last-child {
    width: 120px;
    text-align: center;
}

/* Optimizar el espacio en los modales */
.modal-content {
    width: 85%;
    max-width: 600px;
}

/* Mejorar la visualización en pantallas grandes */
@media (min-width: 1400px) {
    .dashboard {
        width: 90%;
        max-width: 2200px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Estilos para hacer las tablas más densas */
.table-dense .table th,
.table-dense .table td {
    padding: 8px 10px;
    font-size: 0.85em;
}

.table-dense .table {
    font-size: 0.9em;
}

/* Mejorar la legibilidad de texto pequeño */
.table small {
    font-size: 0.75em;
    color: #666;
    display: block;
    margin-top: 2px;
}