/* --- Fuentes e Importaciones --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* --- 1. CONFIGURACIÓN BASE (Fondo y Reset) --- */
html {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;

    /* Imagen de fondo para TODO el sitio */
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('../img/fondo_paijan.png');
    background-size: cover;        
    background-position: center;   
    background-repeat: no-repeat;  
    background-attachment: fixed;  
    
    /* Permite que la página crezca */
    min-height: 100vh;
    
    /* IMPORTANTE: 'block' para evitar que el dashboard se corte arriba */
    display: block; 
}

/* --- 2. ESTILOS ESPECÍFICOS PARA LOGIN (Centrado) --- */
body.login-page {
    display: flex; 
    justify-content: center;
    align-items: center;
    height: 100vh; 
    box-sizing: border-box;
}

.login-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    box-sizing: border-box; 
    margin: 20px; 
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

/* --- ESTILO DEL ESCUDO --- */
.logo-escudo {
    width: 100px; /* Ajusta este tamaño si lo quieres más grande */
    height: auto;
    margin-bottom: 1rem;
}
/* ------------------------ */

.logo-container h2 {
    margin: 0;
    color: #0056b3; 
    font-weight: 700;
}

.logo-container p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* --- 3. INPUTS Y FORMULARIOS --- */
.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    z-index: 2; 
    pointer-events: none; 
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 14px 15px; 
    text-indent: 30px;  /* Espacio para el icono */
    
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; 
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    outline: none;
}

.input-group input:focus + i {
    color: #0056b3;
}

/* --- 4. BOTONES Y ENLACES --- */
button {
    width: 100%;
    padding: 14px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #004a9a;
}

.register-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.register-link a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* --- 5. NOTIFICACIONES --- */
.error, .success {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

/* --- 6. DASHBOARD (Contenedor Principal Grande) --- */
.dashboard-container {
    width: 95%;
    max-width: 1600px;
    min-height: 85vh;
    margin: 50px auto;
    
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    box-sizing: border-box; 
    
    display: flex;
    flex-direction: column;
}

/* --- 7. ENCABEZADO FLEXIBLE --- */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 15px;
    
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-flex h2 {
    border-bottom: none;
    margin: 0;
    padding: 0;
    color: #0056b3;
    flex: 1 1 auto; 
}

.header-flex p {
    margin: 0;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.logout-btn {
    color: #dc3545 !important;
    font-weight: bold;
    margin-left: 10px;
    text-decoration: none;
    border: 1px solid #dc3545;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background-color: #dc3545;
    color: white !important;
}

/* --- 8. FORMULARIOS DEL DASHBOARD --- */
.upload-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
}

.upload-form label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

input[type="file"] {
    padding: 8px; 
}

.upload-form button {
    grid-column: 1 / -1; 
    margin-top: 10px;
}

/* --- 9. TABLAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

th, td {
    border: 1px solid #ddd;
    padding: 14px; 
    text-align: left;
}

th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #444;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f1f1f1;
}

td a {
    color: #0056b3;
    text-decoration: none;
    margin-right: 5px;
}
td a:hover {
    text-decoration: underline;
}

td a[style*="color: red;"] {
    font-weight: 500;
}

/* --- 10. RESPONSIVIDAD --- */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; 
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .dashboard-container {
        width: 100%;
        margin: 0;
        padding: 1.5rem;
        border-radius: 0; 
        min-height: 100vh;
    }
    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    .logout-btn {
        margin-left: 0;
        margin-top: 10px;
        display: inline-block;
    }
}