/* =========================================
   ESTILOS GENERALES 
   ========================================= */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background: #f4f7f6; 
    color: #333; 
}

/* =========================================
   NAVEGACIÓN (NAVBAR)
   ========================================= */
.nav { 
    background: #2c3e50; 
    color: white; 
    padding: 12px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-left h2 { margin: 0; font-size: 20px; }

.nav-center { 
    flex-grow: 1; 
    display: flex; 
    justify-content: center; 
    align-items: center;
}

/* BUSCADOR */
.search-form { 
    display: flex; 
    align-items: center; 
    width: 100%; 
    max-width: 450px; 
}

.search-container {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    flex-grow: 1;
}

.search-form input { 
    border: none; 
    padding: 10px; 
    flex-grow: 1; 
    outline: none; 
    min-width: 0; 
}

.search-form button { 
    border: none; 
    background: #d1d8e0; 
    padding: 10px 15px; 
    cursor: pointer; 
    transition: 0.3s;
}

.search-form button:hover { background: #b0b8c0; }

.clear-btn { 
    background: #e74c3c; 
    color: white !important; 
    text-decoration: none; 
    padding: 8px 12px; 
    border-radius: 4px; 
    font-size: 12px; 
    margin-left: 10px; 
    font-weight: bold;
}

/* =========================================
   BOTONES DE ACCIÓN
   ========================================= */
.nav-right { display: flex; gap: 10px; }

.btn { 
    padding: 9px 16px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 600; 
    color: white; 
    text-align: center; 
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn-users { background: #576574; }
.btn-add { background: #27ae60; }
.btn-out { background: #e74c3c; }
.btn-save { background: #1a73e8; width: 100%; font-size: 16px; padding: 12px; margin-top: 10px; }

.btn:hover { opacity: 0.85; }

/* =========================================
   CONTENEDOR DE TABLA (DASHBOARD)
   ========================================= */
.container { padding: 20px; }

.card { 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    padding: 10px; 
    overflow-x: auto; 
}

table { width: 100%; border-collapse: collapse; min-width: 800px; }

th { 
    background: #34495e; 
    color: #ffffff !important; 
    text-align: left; 
    padding: 15px; 
    font-size: 14px; 
    text-transform: uppercase; 
}

td { 
    padding: 15px; 
    border-bottom: 1px solid #f1f1f1; 
    font-size: 14px; 
    color: #2c3e50; 
}

tr:hover { background: #f9f9f9; }

/* =========================================
   FORMULARIOS (NUEVO / EDITAR)
   ========================================= */
.form-container { 
    width: 95%; 
    max-width: 600px; 
    background: white; 
    padding: 30px; 
    margin: 40px auto; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    box-sizing: border-box; 
}

.form-container h2 { 
    color: #1a73e8; 
    text-align: center; 
    margin-bottom: 25px; 
}

.form-container label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    color: #555; 
}




.form-container input, 
.form-container textarea { 
    width: 100%; 
    padding: 11px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    box-sizing: border-box; 
    font-size: 14px;
}

.grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.back { 
    display: block; 
    text-align: center; 
    margin-top: 15px;
    
    
    
/* Contenedor del scroll en el Dashboard */
.table-container {
    width: 100%;
    overflow-x: auto; /* Permite el movimiento lateral */
    -webkit-overflow-scrolling: touch; /* Suavidad en dispositivos móviles */
}

/* La tabla debe mantener un ancho mínimo para no amontonarse */
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px; /* Al ser muchas columnas, forzamos este ancho mínimo en móvil */
}

/* Evitar que el texto de las celdas se parta en mil pedazos */
th, td {
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap; /* Mantiene la información en una sola línea */
    border-bottom: 1px solid #eee;
}

/* Estilo visual para la barra de scroll (opcional, para que se vea más limpia) */
.table-container::-webkit-scrollbar {
    height: 6px;
}
.table-container::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}


    
/* RESPONSIVIDAD REAL PARA MÓVILES */
@media (max-width: 768px) {
    /* 1. Navbar: Apilar elementos para que no se encimen */
    .nav { 
        flex-direction: column; 
        padding: 15px;
        height: auto;
    }
    
    .nav-center, .nav-right { 
        width: 100%; 
        justify-content: center; 
    }

    .search-form { max-width: 100%; }

    /* 2. Botones: Hacerlos más grandes y fáciles de tocar */
    .nav-right {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Dos columnas de botones */
        gap: 10px;
    }
    
    .btn-out { grid-column: span 2; } /* Cerrar sesión ocupa todo el ancho */

    /* 3. Tabla: EL TRUCO MAESTRO */
    /* En lugar de ver una tabla diminuta, permitimos scroll lateral */
    .card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        border-radius: 0;
    }

    table {
        min-width: 900px; /* Obligamos a la tabla a mantener un tamaño legible */
    }

    /* 4. Formularios */
    .grid { grid-template-columns: 1fr; } /* Inputs uno debajo del otro */
}    