/* ==========================================================================
   GESTIÓN DE USUARIOS (Estilo UI Image 4)
   ========================================================================== */

#view-config {
    background-color: #f8fafc;
    min-height: 100%;
    padding: var(--sp-4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.users-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, .8fr));
    gap: 10px;
    margin-bottom: 12px;
}

.users-filters .param-input,
.users-filters .param-select {
    width: 100%;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
    gap: 10px;
}

.user-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e1e2f;
}

.btn-new-user {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-new-user:hover { background: #2563eb; }

/* Tabla Premium */
.users-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: left;
    min-width: 760px;
}

.users-table th {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid #c7d2fe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
    font-weight: 600;
}

.users-table tr:hover {
    background: #f8fafc;
}

/* Badges de Roles y Estados */
.u-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.u-type-sala { color: #0ea5e9; }
.u-type-sub { color: #3b82f6; font-size: 0.6rem; display: block; margin-top: 2px; }

.u-rol-operador { color: #6366f1; background: #e0e7ff; }
.u-rol-admin { color: #8b5cf6; background: #ede9fe; }
.u-rol-viewer { color: #64748b; background: #f1f5f9; }
.u-rol-master { color: #b91c1c; background: #fee2e2; }
.u-rol-coordinador { color: #0f766e; background: #ccfbf1; }
.u-rol-jefe-zonal { color: #1d4ed8; background: #dbeafe; }
.u-rol-operador-zonal { color: #4338ca; background: #e0e7ff; }
.u-rol-consulta { color: #475569; background: #e2e8f0; }
.u-rol-ejecutivo { color: #7c3aed; background: #ede9fe; }

.u-estado-activo { color: #10b981; background: #d1fae5; }
.u-estado-inactivo { color: #ef4444; background: #fee2e2; }
.u-estado-bloqueado { color: #b45309; background: #fef3c7; }

.u-access { color: #0284c7; font-size: 0.65rem; font-weight: 700; margin-right: 4px; }
.u-access-highlight { color: #8b5cf6; }

/* Botones de Acción */
.u-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: #f1f5f9;
    color: #64748b;
}

.btn-icon:hover { background: #e2e8f0; }
.btn-icon.edit { color: #f97316; background: #ffedd5; }
.btn-icon.delete { color: #ef4444; background: #fee2e2; }

.user-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name-line {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.user-sub-line {
    font-size: 0.68rem;
    color: #64748b;
}

.user-role-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 900px) {
    .users-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .users-filters {
        grid-template-columns: 1fr;
    }

    .user-header {
        flex-direction: column;
        align-items: stretch;
    }
}
