/* ============================================================
   Team Section
   ============================================================ */
.team-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.team-search-bar input { flex: 1; min-width: 200px; }
.team-search-bar select { min-width: 160px; }

/* ============================================================
   Profile Section
   ============================================================ */
.profile-container { max-width: 800px; }
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-header-info h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #1a1a2e;
}
.profile-email-display {
    color: #6b7280;
    margin: 0 0 8px;
    font-size: 14px;
}
.profile-sub-line {
    display: block;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}
.profile-role-badge, .profile-type-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}
.profile-role-badge { background: #e0e7ff; color: #4338ca; }
.profile-type-badge { background: #fef3c7; color: #92400e; }
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.profile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}
.profile-card-title {
    margin: 0 0 16px;
    font-size: 15px;
    color: #1a1a2e;
}
.profile-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}
.profile-field label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.profile-field span {
    font-size: 14px;
    color: #1a1a2e;
}
.profile-activity-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}
.profile-activity-item {
    display: flex;
    flex-direction: column;
}
.profile-activity-value {
    font-size: 28px;
    font-weight: 700;
    color: #3b82f6;
}
.profile-activity-label {
    font-size: 12px;
    color: #6b7280;
}
.profile-session-actions {
    margin-top: 12px;
}
/* Profile Me data sections */
.pm-section { margin-bottom: 20px; }
.pm-section:last-child { margin-bottom: 0; }
.pm-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.pm-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    font-size: 0.88rem;
}
.pm-label {
    min-width: 160px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.pm-value {
    color: var(--text-primary);
    word-break: break-word;
}
.pm-value a { color: var(--primary); text-decoration: none; }
.pm-value a:hover { text-decoration: underline; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pm-chip {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--primary-light, #dbeafe);
    color: var(--primary, #3b82f6);
    font-weight: 500;
}
@media (max-width: 600px) {
    .pm-row { flex-direction: column; gap: 2px; }
    .pm-label { min-width: auto; }
}

#changePasswordForm .profile-field {
    margin-bottom: 12px;
}
#changePasswordForm .profile-field input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}
#changePasswordForm .profile-field input:focus {
    outline: none;
    border-color: var(--primary);
}
.cp-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.83rem;
    margin-bottom: 12px;
    text-align: center;
}
.cp-message-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.cp-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Super Admin: self-edit card in "Mi Perfil" */
.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .profile-edit-grid { grid-template-columns: 1fr; }
}
#profileAdminEditCard .profile-field {
    margin-bottom: 0;
}
#profileAdminEditCard .profile-field input,
#profileAdminEditCard .profile-field select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}
#profileAdminEditCard .profile-field input:focus,
#profileAdminEditCard .profile-field select:focus {
    outline: none;
    border-color: var(--primary);
}
#profileAdminEditCard .profile-field input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* un correo largo se parte en vez de salirse de la tarjeta */
#profileFieldSession, #profileEmailDisplay { overflow-wrap: anywhere; }
