:root {
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --border: #e5e7eb;
  /* KI-Dashboard-Branding (Manfreds "Dein zweites Gehirn"-Farben) statt des Akquise-Dashboard-
     Türkis — bewusst andere Palette, damit auf einen Blick klar ist, in welchem der beiden
     Dashboards man sich befindet. --accent-dark/--accent-light sind abgeleitete Schattierungen
     von Branding Blue (#023e72), --danger ist direkt Branding Red. */
  --accent: #023e72;
  --accent-dark: #01233f;
  --accent-light: #e3eaf1;
  --danger: #a70632;
  --success: #1a8754;
  --warning: #b45309;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}

.topbar h1 { font-size: 20px; margin: 0; }

.pipeline-switch { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 4px; }
.pipeline-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.pipeline-btn.active { background: var(--accent); color: #fff; }

.tabs { display: flex; gap: 4px; }

.tab-btn {
  padding: 7px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.tab-btn.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.topbar select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

#scopeSelect { max-width: 190px; font-size: 12px; }

main { padding: 24px 32px; max-width: none; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-toolbar select, .dash-toolbar input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.custom-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.stat-tile .value { font-size: 28px; font-weight: 700; }
.stat-tile .label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.map-caption { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
#mapContainerH {
  height: 600px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.map-popup h3 { margin: 0 0 4px 0; font-size: 14px; }
.map-popup p { margin: 2px 0; font-size: 13px; color: var(--muted); }
.map-popup button { margin-top: 8px; }

.map-optin-card { max-width: 480px; margin: 0 auto; }
.map-teaser-text { font-size: 13px; color: var(--accent-dark); font-weight: 600; margin: 0 0 16px; }
#mapOptInForm label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
#mapOptInForm input, #mapOptInForm select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}
.consent-label {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.4;
}
.consent-label input { width: auto; margin-top: 2px; flex-shrink: 0; }
.error-text { color: var(--danger); font-size: 13px; margin: 0 0 12px; min-height: 1em; }
.success-text { color: var(--success); font-size: 13px; margin: 0 0 12px; min-height: 1em; }

#mapEditCard { margin-bottom: 20px; }
#mapEditForm label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
#mapEditForm input, #mapEditForm select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-zone-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px 0; }

#mapEmbedWrap { height: 75vh; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
#mapEmbedFrame { width: 100%; height: 100%; border: none; }

.map-subtabs { margin-bottom: 16px; }

/* Bewusst kein display:none für den inaktiven Reiter (siehe #tab-map unten) — das würde die
   iframe-Box auf Größe 0 kollabieren, und Leaflet innerhalb des iframes (Community Map) erholt
   sich davon nicht zuverlässig von selbst, sobald der Reiter wieder aktiv wird: gecachte
   Container-Größe bleibt falsch (braucht explizites invalidateSize()), UND laufende CSS-Fade-in-
   Übergänge einzelner Tiles werden mittendrin abgebrochen und bleiben für immer bei Teil-Opazität
   hängen (per Frame-für-Frame-Analyse eines Screen-Recordings gefunden). visibility:hidden +
   position:absolute hält die Box stattdessen durchgehend auf echter Größe — dem iframe (und damit
   Leaflet) ändert sich nie etwas, es gibt also gar nichts zu reparieren. */
#tab-map { position: relative; }
.map-subpanel { visibility: hidden; position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; }
.map-subpanel.active { visibility: visible; position: relative; pointer-events: auto; }

.map-nudge-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent-light); color: var(--accent-dark);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px; font-size: 14px;
}
.map-nudge-banner .spacer, .map-nudge-banner span { flex: 1; }
.map-nudge-banner #mapNudgeDismissBtn { width: 28px; height: 28px; font-size: 14px; flex: none; }

#teamCard { margin-bottom: 20px; }
#teamTbody tr[data-scope] { cursor: pointer; }
#teamTbody tr[data-scope]:hover { background: var(--accent-light); }
.role-select {
  padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: inherit; cursor: pointer;
}
.team-delete-btn { padding: 4px 10px; font-size: 12px; }
.team-impersonate-btn, .sponsor-impersonate-btn { padding: 4px 10px; font-size: 12px; margin-right: 6px; }

.impersonation-banner {
  display: flex; align-items: center; gap: 12px;
  background: #fef3c7; color: #92400e;
  border-bottom: 1px solid #fcd34d;
  padding: 10px 32px; font-size: 14px;
}
.impersonation-banner span { flex: 1; }
.team-count { font-size: 14px; font-weight: 400; color: var(--muted); }

/* Org-Scope-Umschalter (Aug. 2026, Admin-only) — gleiches Muster wie im Partner-Onboarding
   Dashboard (siehe dessen public/style.css, ".org-scope-bar"). */
.org-scope-bar {
  display: flex; align-items: center; gap: 8px; background: var(--accent-light); color: var(--accent-dark);
  padding: 8px 32px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.org-scope-bar label { font-weight: 600; }
.org-scope-bar select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

.tree-row { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tree-toggle {
  background: none; border: none; cursor: pointer; padding: 0; font-size: 11px; color: var(--muted);
  width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.tree-toggle:hover { color: var(--text); }
.tree-toggle-spacer { display: inline-block; width: 16px; flex-shrink: 0; }
.team-empty-row { text-align: center; color: var(--muted); padding: 16px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.card h2 { font-size: 15px; margin: 0 0 16px 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  background: var(--border); color: var(--muted);
  font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: 0;
  text-transform: none; vertical-align: middle; cursor: help;
}

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-label { width: 190px; flex-shrink: 0; color: var(--text); }
.bar-track { flex: 1; background: #eef1f5; border-radius: 4px; height: 20px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 4px; transition: width 0.3s; }
.bar-value { width: auto; min-width: 36px; text-align: right; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.bar-percent { color: var(--muted); font-size: 12px; }

.followup-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 0 6px 0;
}
.followup-group-title:first-child { margin-top: 0; }

.followup-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
}
.followup-item:hover { background: var(--accent-light); }
.followup-item:last-child { border-bottom: none; }
.followup-item.overdue .fdate { color: var(--danger); font-weight: 600; }
.followup-item.today { background: var(--accent-light); }
.followup-item.today .fdate { color: var(--accent-dark); font-weight: 700; }
.followup-empty { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.toolbar input { flex: 1; min-width: 200px; }

.hint { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.sponsor-select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit;
}
.team-empty-row { text-align: center; color: var(--muted); padding: 16px; }

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.primary-btn:hover { background: var(--accent-dark); }
.secondary-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.danger-btn {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: normal; word-break: break-word; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-light); }
td.notes-cell { max-width: 220px; color: var(--muted); }

.status-badge { padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Kanban-Board-Ansicht der Kontaktliste (Alternative zur Tabelle, gleiche Daten/Endpunkte) */
.view-toggle { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 4px; }
.view-toggle .tab-btn { padding: 7px 10px; }

.board-wrap { overflow-x: auto; padding-bottom: 4px; }
.kanban-board { display: flex; gap: 12px; align-items: flex-start; min-height: 200px; }

.kanban-column {
  flex: 0 0 260px;
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.kanban-column-title { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kanban-column-title span.label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-count { color: var(--muted); font-weight: 400; font-size: 12px; flex-shrink: 0; }

.kanban-cards { min-height: 40px; }
.kanban-empty-col { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 4px; }

.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.kanban-card-meta { font-size: 12px; color: var(--muted); }
.kanban-card-followup { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 8px; border-radius: 100px; background: var(--accent-light); color: var(--accent); }
.kanban-card-followup.overdue { background: #fee2e2; color: var(--danger); }

.kanban-card.sortable-ghost { opacity: 0.35; }
.kanban-card.sortable-drag { cursor: grabbing; }
.kanban-cards.kanban-dragover { background: var(--accent-light); border-radius: 6px; }

.status-history-section { margin: 4px 0 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.status-history-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 8px; }
.status-history-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.status-history-chain:empty { display: none; }
.status-history-pill { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-history-pill .status-history-date { font-size: 10px; font-weight: 500; opacity: 0.8; }
.status-history-arrow { color: var(--muted); font-size: 12px; }
.status-history-legacy { opacity: 0.65; }
.status-history-legacy .status-history-pill { border: 1px dashed currentColor; background: transparent !important; }
.status-history-legacy-caption { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.overlay.hidden { display: none; }

.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 480px; max-width: 90vw; max-height: 85vh; overflow-y: auto;
}
.modal h2 { margin-top: 0; }
.modal p { font-size: 13px; color: var(--muted); }

.modal-wide { width: 720px; }
#tutorialVideo { width: 100%; border-radius: 8px; margin-top: 8px; background: #000; }
.video-embed { position: relative; height: 0; padding-bottom: 56.25%; margin-top: 8px; border-radius: 8px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.invite-link-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.invite-link-row input {
  flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit;
}

#contactForm label, #contactFormH label {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
#contactForm input[type=text], #contactForm input[type=date], #contactForm input[type=email], #contactForm select, #contactForm textarea,
#contactFormH input[type=text], #contactFormH input[type=date], #contactFormH input[type=email], #contactFormH select, #contactFormH textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}

#importOverlay label, #importOverlayH label {
  display: block; font-size: 13px; color: var(--muted); margin: 16px 0 12px 0;
}
#importOverlay input[type=file], #importOverlayH input[type=file] {
  width: 100%; margin-top: 4px; font-size: 13px;
}
#importResult, #importResultH { font-size: 13px; }
#importResult .import-summary, #importResultH .import-summary { color: var(--success); margin-bottom: 8px; }
#importResult ul, #importResultH ul { margin: 0; padding-left: 18px; color: var(--muted); max-height: 150px; overflow-y: auto; }

#importPreview, #importPreviewH { font-size: 13px; margin-top: 8px; }
.import-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--bg-subtle, #f8f8f8); }
.import-preview ul { list-style: none; margin: 8px 0 0; padding: 0; }
.import-preview li { padding: 2px 0; }
.import-preview li.import-col-missing { color: var(--danger); font-weight: 600; }
.import-preview li.import-col-optional { color: var(--muted); }
.import-preview-ok { color: var(--success); font-weight: 600; margin: 8px 0 0; }
.import-preview-error { color: var(--danger); font-weight: 600; margin: 8px 0 0; }
.import-preview-warning { color: var(--warning); font-weight: 600; margin: 8px 0 0; }
.import-row-issues { margin: 4px 0 0; color: var(--warning); font-size: 0.9em; max-height: 160px; overflow-y: auto; }

th.checkbox-col, td.checkbox-col-cell { width: 32px; white-space: nowrap; }

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.bulk-count { font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.bulk-status-action { display: flex; align-items: center; gap: 6px; }
.bulk-status-action select {
  padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}

.bulk-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bulk-field-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); width: 220px; flex-shrink: 0;
}
.bulk-field-toggle input { width: auto; }
.bulk-field-row input, .bulk-field-row select, .bulk-field-row textarea {
  flex: 1; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit;
}
.bulk-field-row input:disabled, .bulk-field-row select:disabled, .bulk-field-row textarea:disabled {
  background: var(--bg); color: var(--muted);
}

.date-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 16px 0;
}
.date-filter-bar select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.date-filter-clear {
  display: inline;
  width: auto;
  padding: 0;
  font-size: 13px;
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1a1d23;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 50;
}
.undo-toast.hidden { display: none; }
.undo-toast-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.announcements-wrap { position: relative; }
.icon-btn {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.announcements-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.announcements-badge.hidden { display: none; }

.announcements-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  max-height: 420px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
}
.announcements-panel.hidden { display: none; }
.announcements-panel-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.announcements-empty { padding: 20px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.announcement-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.announcement-item:last-child { border-bottom: none; }
.announcement-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.announcement-date { font-size: 11px; color: var(--muted); }
.announcement-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.announcement-body { font-size: 13px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }
.announcement-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.announcement-delete-btn:hover { color: var(--danger); }

.announcement-cat-feature { background: #e6f4ea; color: var(--success); }
.announcement-cat-bugfix { background: #fdeceb; color: var(--danger); }
.announcement-cat-sonstiges { background: #f1f2f4; color: var(--muted); }

#announcementForm label {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
#announcementForm input[type=text], #announcementForm select, #announcementForm textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}

.role-badge {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--accent-light);
  color: var(--accent-dark);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.user-menu-wrap { position: relative; }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  padding: 6px;
}
.user-menu-panel.hidden { display: none; }
.user-menu-info { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-name { font-weight: 600; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.user-menu-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.user-menu-item:hover { background: var(--accent-light); }

.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin: 16px 0; }
.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent-dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

#profileForm label, #profilePasswordForm label {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
#profileForm input, #profilePasswordForm input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}
#profileForm input:disabled { background: var(--bg); color: var(--muted); }
#profilePasswordForm h3 { font-size: 14px; margin: 0 0 12px; }

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
}
.auth-card h1 { font-size: 20px; margin: 0 0 20px 0; text-align: center; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.auth-tab-btn.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }
.auth-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.auth-form input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-top: 4px; font-family: inherit;
}
.password-field { position: relative; }
.password-field input { padding-right: 34px; }
.password-toggle-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1;
  padding: 4px 6px; color: var(--muted);
}
.auth-form .primary-btn { width: 100%; padding: 10px; margin-top: 4px; }
.auth-form .consent-label {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.4;
}
.auth-form .consent-label input { width: auto; margin-top: 2px; flex-shrink: 0; }
.auth-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 1em; }
.auth-success { color: var(--success); font-size: 13px; margin-bottom: 12px; }
.incomplete-hint {
  background: #fff8e1; color: #92610a; border: 1px solid #f0d78c;
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 0 0 16px 0;
}

.link-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  padding: 10px 0 0 0;
}
.link-btn:hover { text-decoration: underline; }
