/* General */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 10px; /* Reducido para móviles */
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: auto;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Encabezado */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 300px;
}

.global-search {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 25px;
    box-sizing: border-box;
}

/* GRID PRINCIPAL - CORREGIDO */
.grid-alumnos {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px;
    padding: 10px 0;
    width: 100%;
}

/* TARJETAS - CORREGIDO */
.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    width: 100% !important; /* Deja que el grid mande */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* FOTOS - AÑADIDO (Esto faltaba para que se vieran bien) */
.foto-mini {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    display: block;
    margin: 0 auto 10px;
    background-color: #eee; /* Fondo si no carga la imagen */
}

/* Colores por género */
.card.M { border-top: 5px solid #2196F3; }
.card.F { border-top: 5px solid #E91E63; }
.card.fallecido { background: #f9f9f9; opacity: 0.8; border-top: 5px solid #666; }

/* Botones de acción */
.acciones {
    display: none !important; /* Oculto por defecto */
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.admin-mode .acciones {
    display: flex !important;
    justify-content: center;
    gap: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .grid-alumnos {
        grid-template-columns: 1fr !important;
    }
    .container {
        padding: 15px;
    }
}
