/* === Tabs === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--color-text);
}

.tabActive {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* === Platzhalter === */
.placeholder {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  padding: 2rem 0;
  text-align: center;
}

.section {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.sectionTitle {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* === Profil-Layout (Avatar links, Formular rechts) === */
.profileLayout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.avatarColumn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 140px;
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.formColumn {
  flex: 1;
  min-width: 0;
}

/* === Formular === */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.field input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.field input:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.field small {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.fieldRow {
  display: flex;
  gap: 1rem;
}

.fieldRow .field {
  flex: 1;
}

.fieldSmall {
  flex: 0 0 120px !important;
}

/* === Fieldset-Gruppen === */
.fieldGroup {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fieldGroupLegend {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0;
  margin-bottom: 0.125rem;
}

/* === Buttons === */
.button {
  padding: 0.625rem 1.25rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}

.button:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.buttonSecondary {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.buttonSecondary:hover {
  background: var(--color-bg);
}

.buttonDanger {
  padding: 0.5rem 1rem;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}

.buttonDanger:hover:not(:disabled) {
  background: #b91c1c;
}

.buttonDanger:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.buttonRow {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* === Meldungen === */
.success {
  background: #f0fdf4;
  color: var(--color-success);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid #bbf7d0;
}

.error {
  background: #fef2f2;
  color: var(--color-error);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid #fecaca;
}

/* === 2FA === */
.tfaStatus {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.tfaSetup {
  margin-top: 1rem;
}

.tfaInstructions {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.qrContainer {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.qrContainer img {
  width: 200px;
  height: 200px;
}

.manualSecret {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.manualSecret label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.manualSecret code {
  background: var(--color-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  letter-spacing: 2px;
  word-break: break-all;
  border: 1px solid var(--color-border);
}

/* === 2FA Warn-Badge === */
.tfaWarning {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tfaWarning::before {
  content: '\26A0';
  font-size: 0.875rem;
}

.tfaWarning:hover {
  background: #ffedd5;
  border-color: #fdba74;
}

/* === Avatar === */
.avatarPreview {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
}

.avatarOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 50%;
}

.avatarPreview:hover .avatarOverlay {
  opacity: 1;
}

.avatarActions {
  display: flex;
  gap: 0.5rem;
}

.avatarHint {
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  text-align: center;
}

.hiddenInput {
  display: none;
}

/* === Responsive === */
@media (max-width: 640px) {
  .profileLayout {
    flex-direction: column;
    align-items: center;
  }

  .avatarColumn {
    min-width: unset;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
  }

  .fieldRow {
    flex-direction: column;
    gap: 1rem;
  }

  .fieldSmall {
    flex: 1 !important;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

/* ── O365-Profilanreicherung Banner ── */

.enrichBanner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  margin-bottom: 1rem;
}

.enrichInfo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.enrichIcon {
  color: var(--color-primary);
  flex-shrink: 0;
  display: flex;
}

.enrichLabel {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.enrichBtn {
  padding: 0.3125rem 0.875rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.enrichBtn:hover:not(:disabled) {
  opacity: 0.88;
}

.enrichBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.enrichFeedback {
  width: 100%;
  margin: 0;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}
