/* ── Contenedor General ── */
.seccion-admin {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Cabecera (Header) ── */
.header-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.header-textos h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1c2c;
    margin: 0 0 5px 0;
}

.header-textos .subtitulo {
    font-size: 0.9rem;
    color: #595959;
    margin: 0;
}

/* ── Botón Añadir (Verde Derecha) ── */
.btn-añadir {
    background: #2e7d32; /* Verde bosque de la imagen */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-añadir:hover {
    background: #1b5e20;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.divisor-admin {
    border: 0;
    border-top: 1px solid #eee;
    margin: 0 0 20px 0;
}

/* ── Lista de Usuarios ── */
.usuarios {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Fila de Usuario ── */
.usuario {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.usuario:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: #dcdcdc;
    transform: translateX(4px);
}

/* Icono redondo a la izquierda */
.usuario-avatar {
    width: 48px;
    height: 48px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1a3a5c;
    flex-shrink: 0;
}

.usuario-cuerpo {
    flex: 1;
}

.usuario-nombre {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.usuario-nombre p {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1c2c;
    margin: 0;
}

/* Badge para el ROL */
.badge-rol {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.usuario-info p {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

/* ── Botones de Acción ── */
.botones {
    display: flex;
    gap: 10px;
}

.botones button {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: #fff;
}

/* Botón Cambiar Rol (Azul de la imagen) */
.btn-rol {
    background: #1a3a5c;
}

.btn-rol:hover {
    background: #254e7a;
}

/* Botón Eliminar (Rojo de la imagen) */
.btn-eliminar {
    background: #e31b23;
}

.btn-eliminar:hover {
    background: #b3141a;
}

/* ── Estado Vacío ── */
.vacio-contenedor {
    text-align: center;
    padding: 60px;
    background: #f9f9f9;
    border-radius: 14px;
    color: #767676;
}

.vacio-contenedor i { font-size: 3rem; margin-bottom: 10px; display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-admin { flex-direction: column; align-items: flex-start; gap: 15px; }
    .usuario { flex-direction: column; align-items: flex-start; }
    .botones { width: 100%; justify-content: flex-end; }
}
/* Contenedor oscuro que cubre toda la pantalla */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(4px);    /* Desenfoque de fondo */
    display: none;                 /* Se cambia a flex desde JS */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* La tarjeta blanca central */
.modal {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: aparecer 0.3s ease-out;
}

@keyframes aparecer {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botón de cerrar (X) */
.modal-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f2f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    cursor: pointer;
    color: #666;
    transition: 0.2s;
}

.modal-cerrar:hover {
    background: #e31b23;
    color: #fff;
}

/* Títulos */
#titulo_modificar {
    font-size: 1.3rem;
    color: #1a1c2c;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.modal-subtitulo {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 24px;
}

/* Formulario */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.modal select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f9f9f9;
    outline: none;
}

.modal select:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

/* Botones de acción */
.modal-botones {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn-cancelar {
    flex: 1;
    padding: 12px;
    background: #f0f2f5;
    color: #555;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-guardar {
    flex: 2;
    padding: 12px;
    background: #1a3a5c; /* Azul como el de modificar */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-guardar:hover {
    background: #254e7a;
}
/* ── Overlay: Fondo oscurecido y desenfocado ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 28, 44, 0.6); /* Azul muy oscuro con transparencia */
    backdrop-filter: blur(5px);       /* Efecto de desenfoque moderno */
    display: none;                    /* Cambiar a flex por JS */
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

/* ── Tarjeta del Modal ── */
.modal {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    padding: 35px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Botón cerrar (X) ── */
.modal-cerrar {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f3f5;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    color: #595959;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.modal-cerrar:hover {
    background: #c4121c;
    color: #fff;
    transform: rotate(90deg);
}

/* ── Textos ── */
#titulo_modificar {
    font-size: 1.5rem;
    color: #1a1c2c;
    margin: 0 0 8px;
    font-weight: 700;
}

.modal-subtitulo {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 25px;
}

/* ── Formulario y Grupos ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: -10px; /* Acercar la etiqueta al input */
}

/* Inputs y Selects */
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f8f9fa;
    transition: all 0.2s;
    outline: none;
    color: #1a1c2c;
}

.modal input:focus,
.modal select:focus {
    border-color: #2e7d32; /* Verde al enfocar */
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
}

/* ── Botones de Acción ── */
.modal-botones {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

/* Botón Crear (Verde como el botón de añadir del header) */
.btn-guardar {
    flex: 2;
    background: #2e7d32;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-guardar:hover {
    background: #1b5e20;
    transform: translateY(-2px);
}

.btn-guardar:active {
    transform: translateY(0);
}

/* Botón Cancelar */
.btn-cancelar {
    flex: 1;
    background: #f8f9fa;
    color: #495057;
    border: 1.5px solid #e9ecef;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancelar:hover {
    background: #e9ecef;
    color: #212529;
}

/* Estilo para mensajes de error de JS */
.error {
    color: #e31b23;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: -10px;
    margin-bottom: 5px;
}
.alerta-no-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999; /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.alerta-contenido {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 500px;
    border: 2px solid #e31b23; /* Color rojo de advertencia */
}

.alerta-contenido i {
    font-size: 50px;
    color: #e31b23;
    display: block;
    margin-bottom: 20px;
}

.alerta-contenido strong {
    display: block;
    font-size: 1.2rem;
    color: #1a1c2c;
    margin-bottom: 10px;
}

.alerta-contenido p {
    color: #6c757d;
    line-height: 1.5;
}