body {
    font-family: 'Segoe UI', sans-serif;
    background: #f2f4f8;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #002244;
    color: white;
    padding: 1rem 1rem;    
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5px;
}

.izquierda {
    display: flex;
    align-items: center;
    gap: 10px; /* espacio entre botón atrás y el usuario */
}

.btn.atras {
    background: none; 
    margin: auto;
    padding: 0;
}

.btn.cerrar {
    background: #d9534f;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn.cerrar:hover {
    background: #c9302c;
}

.subtitulo {
    font-size: 0.8rem;  
    color: rgb(38, 103, 201); 
    font-weight: bold;
    margin-bottom: 1rem;
}

.main-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 2rem;
}

/* Formulario y tabla en bloque */
.form-section,
.tabla-section {
    width: 95%;
}

.mensaje {
    padding: 0.75rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

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

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

/* Estilo para los tres botones en una línea */
.form-buttons.full-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.form-buttons.full-line .left-buttons {
    display: flex;
    gap: 1rem;
}

/* Estilos compartidos de botones */
.form-buttons.full-line button {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Botones azules: Guardar y Limpiar */
.form-buttons.full-line button:not(.reset-all) {
    background: #007bff;
    color: white;
    transition: background 0.3s;
}

.form-buttons.full-line button:not(.reset-all):hover {
    background: #0056b3;
}

/* Botón rojo: Reset Usuarios */
.reset-all {
    background: #d9534f !important;
    color: white;
    transition: background 0.3s;
}

.reset-all:hover {
    background: #a7140e !important;
}





#formUsuario input,
#formUsuario select {
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Ajuste para campos de contraseña con ícono */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 2.5rem; /* Espacio para el ícono */
    box-sizing: border-box;
}

.password-container .toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    user-select: none;
}





@media (min-width: 900px) {
    .main-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .form-section {
        flex: 1;
        max-width: 25%;
    }
    
    .tabla-section {
        flex: 2;
        max-width: 75%;
    }
}


.form-section, .tabla-section {
    flex: 1;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 0;
    color: #002244;
}

#formUsuario {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#formUsuario input,
#formUsuario select {
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Botonera clásica (sin uso en nueva estructura) */
.form-buttons {
    display: flex;
    gap: 1rem;
}

.form-buttons button {
    padding: 0.6rem 1rem;
    background: #007bff;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.form-buttons button:hover {
    background: #0056b3;
}

.busqueda {
    margin-bottom: 1rem;
}

.busqueda form {
    display: flex;
    gap: 0.5rem;
}

.busqueda input {
    flex: 1;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.busqueda button {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.busqueda button:hover {
    background: #218838;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table th, table td {
    padding: 0.75rem;
    border: 1px solid #ccc;
    text-align: center;
}

table th {
    background-color: #002244;
    color: white;
}

/* Botones de acciones en tabla */
button {
    padding: 0.4rem 0.7rem;
    margin: 0 0.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-size: 0.85rem;
}

button:hover {
    opacity: 0.9;
}

button[onclick*='editarUsuario'] {
    background: #17a2b8;
}

button[onclick*='eliminarUsuario'] {
    background: #dc3545;
}

button[onclick*='enviarWhatsApp'] {
    background: #17b43e;
}


@media (max-width: 550px) {
        
    .usuario {
        font-size: 0.8rem;
    }

    .btn.cerrar {
        font-size: 0;
        padding: 6px;
        min-width: 36px;
    }
      
    .btn.cerrar::after {
        content: '✕';
        font-size: 1rem;
    }
}