/*
 * Organisationsauswahl des Haupt-Admins – Gestaltung des gemeinsamen Bausteins (Auswahl, Hinweisfenster).
 * Nur Variablen der Werksnorm (design-norm.css), keine eigenen Farbwerte.
 */

.sfg-fenster {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: var(--ma-card-padding);
  border: 1px solid var(--line);
  border-radius: var(--ma-card-radius);
  background: var(--white);
  color: var(--navy);
}

.sfg-fenster::backdrop {
  background: var(--navy);
  opacity: .55;
}

.sfg-titel {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sfg-titel:focus { outline: none; }

.sfg-inhalt p { margin: 0 0 12px; }

.sfg-meldung {
  min-height: 1.4em;
  margin: 8px 0;
}

.sfg-knopfzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sfg-knopf {
  min-height: var(--ma-control-height);
  padding: 0 18px;
  border: 1px solid var(--navy);
  border-radius: var(--ma-field-radius);
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sfg-knopf--haupt {
  background: var(--navy);
  color: var(--white);
}

.sfg-knopf:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 2px;
}

.sfg-knopf:disabled { cursor: not-allowed; opacity: .6; }

@media (max-width: 480px) {
  .sfg-knopfzeile .sfg-knopf { flex: 1 1 100%; }
}

.sfg-auswahl {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--ma-field-radius);
  background: var(--white);
}

.sfg-auswahl--fremd { border-color: var(--amber); }

.sfg-feldname {
  font-weight: 700;
  color: var(--navy);
}

.sfg-feld {
  box-sizing: border-box;
  min-height: var(--ma-control-height);
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--ma-field-radius);
  background: var(--white);
  color: var(--navy);
  font: inherit;
}

select.sfg-feld {
  height: var(--ma-control-height);
  flex: 1 1 260px;
  max-width: 100%;
}

.sfg-auswahl .ma-combobox {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 100%;
}

.sfg-suche { flex: 0 1 200px; }

.sfg-feld:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 2px;
}

.sfg-auswahl-hinweis {
  flex: 1 1 100%;
  margin: 0;
  color: var(--amber);
  font-weight: 700;
}

.sfg-auswahl-hinweis:empty { display: none; }

/* Platz der Auswahl in Anwendungen, die ihren Inhalt selbst zeichnen (Element über der Anwendung). */
.ma-organisation {
  box-sizing: border-box;
  max-width: 100%;
  padding: 12px 16px 0;
}

.ma-organisation .sfg-auswahl { margin: 0; }

/* ---------- Kleine Fassung (Wunsch 12.11.2026): unauffällig, im blauen Kopfband ---------- */
/* Bewusste Abweichung von der Feldhöhe der Werksnorm: Die Auswahl sieht nur der Haupt-Admin,
   sie soll neben dem Inhalt der Anwendung zurücktreten. */

.sfg-auswahl--kompakt {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.sfg-auswahl--kompakt .sfg-feldname {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sfg-auswahl--kompakt .ma-combobox {
  --_h: 32px;
  --_radius: 8px;
  flex: 0 1 260px;
}

.sfg-auswahl--kompakt select.sfg-feld,
.sfg-auswahl--kompakt .sfg-suche {
  height: 32px;
  min-height: 32px;
  flex: 0 1 260px;
  font-size: 13px;
}

.sfg-auswahl--kompakt .ma-combobox__trigger {
  padding: 0 10px;
  font-size: 13px;
}

/* Der Hinweissatz bleibt für Vorleseprogramme erhalten, wird aber nicht angezeigt: In der kleinen
   Fassung zeigt das Feld selbst den Namen, und der gelbe Rand markiert eine fremde Organisation. */
.sfg-auswahl--kompakt .sfg-auswahl-hinweis {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sfg-auswahl--kompakt.sfg-auswahl--fremd .ma-combobox__trigger { border-color: var(--amber); }

/* Im Kopfband: helle Schrift auf Marineblau, Feld ohne eigene Fläche. */
.sfg-auswahl--band .sfg-feldname { color: color-mix(in srgb, var(--white) 72%, transparent); }

.sfg-auswahl--band .ma-combobox__trigger,
.sfg-auswahl--band .sfg-suche {
  border-color: color-mix(in srgb, var(--white) 32%, transparent);
  background: color-mix(in srgb, var(--white) 8%, transparent);
  color: var(--white);
}

.sfg-auswahl--band .ma-combobox__arrow { border-color: color-mix(in srgb, var(--white) 72%, transparent); }
.sfg-auswahl--band .ma-combobox__trigger:focus-visible { border-color: var(--aqua-light); }
.sfg-auswahl--band.sfg-auswahl--fremd .ma-combobox__trigger { border-color: var(--amber-flaeche); }

/* In einer schmalen Seitenleiste: Beschriftung über dem Feld, volle Breite. */
.sfg-auswahl--seitenleiste {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin: 10px 0 0;
}

.sfg-auswahl--seitenleiste .ma-combobox { flex: 0 0 auto; }
