/* ================= Runde 2g EINRICHTUNG (.bn-): Team in den Einstellungen =================
   Spalte Microsoft, Hinweis zur Anmeldung mit Microsoft, «Mehrere anlegen» mit Vorschau. Ruhig, ohne Rot bei MediPersonal. */

/* Spalte Microsoft: angemeldet am, noch nie angemeldet, Outlook erneuern (ruhig, kein Rot) */
td.bn-ms { white-space: nowrap; font-size: 12.5px; }
.bn-ms-ok { color: var(--text); }
.bn-ms-ok svg.i { width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; color: var(--ok-tx); }
.bn-ms-nie { color: var(--muted); }
.bn-ms-erneuern { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-tx); border: 1px solid var(--warn-ln); }
body[data-mandant="med"] .bn-ms-erneuern { background: rgba(10, 155, 217, .12); color: var(--ink); border-color: rgba(10, 155, 217, .35); }

/* Hinweis über dem Formular «Neuen Personalberater anlegen» */
.bn-anlegen-hinweis { margin: 0 0 10px; }
#new-user [hidden], .bn-anlegen-hinweis[hidden] { display: none !important; }

/* Zeile «Mehrere auf einmal anlegen» */
.bn-mehrere { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.bn-mehrere-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bn-mehrere .btn { flex: none; }

/* Pop-up: Liste, Vorschau */
.bn-modal .bn-feld { display: flex; flex-direction: column; gap: 6px; }
.bn-modal textarea { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; box-sizing: border-box; }
.bn-vorschau:empty { display: none; }
.bn-vorschau { margin-top: 12px; }
.bn-zahlen { margin: 0 0 8px; }
.bn-fehlerzahl { color: var(--warn-tx); font-weight: 700; }
body[data-mandant="med"] .bn-fehlerzahl { color: var(--ink); }
.bn-tabelle { max-height: 300px; }
.bn-tabelle td { vertical-align: top; }
.bn-tabelle .bn-mail { overflow-wrap: anywhere; min-width: 160px; }
.bn-art { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 12px; background: var(--neu-bg); color: var(--neu-tx); border: 1px solid var(--neu-ln); white-space: nowrap; }
tr.bn-neu .bn-art { background: var(--ok-bg); color: var(--ok-tx); border-color: var(--ok-ln); }
tr.bn-anpassen .bn-art { background: var(--ak-bg); color: var(--text); border-color: var(--ak-ln); }
tr.bn-fehler .bn-art { background: var(--warn-bg); color: var(--warn-tx); border-color: var(--warn-ln); }
body[data-mandant="med"] tr.bn-fehler .bn-art { background: rgba(10, 155, 217, .12); color: var(--ink); border-color: rgba(10, 155, 217, .35); }
.bn-grund { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .bn-mehrere .btn { width: 100%; justify-content: center; }
  /* Schmal: nur E-Mail und Ergebnis (Nebenstelle, Abteilung und Rolle stehen in der eigenen Liste) */
  .bn-tabelle th:nth-child(1), .bn-tabelle td:nth-child(1), .bn-tabelle th:nth-child(3), .bn-tabelle td:nth-child(3),
  .bn-tabelle th:nth-child(4), .bn-tabelle td:nth-child(4), .bn-tabelle th:nth-child(5), .bn-tabelle td:nth-child(5) { display: none; }
  .bn-tabelle .bn-mail { min-width: 0; }
  .bn-tabelle td { white-space: normal; } /* Grund der Fehlerzeile umbrechen statt abschneiden */
}

/* ---------- Korrektur Runde 2g: Team ohne waagrechtes Scrollen bei 1440 ----------
   Name und E-Mail in einer Zelle, Spalte Microsoft gleich daneben, Abteilungen untereinander, Ziele und Telefon in der Zeile «Mehr». */
.bn-team td.bn-wer { white-space: normal; min-width: 150px; max-width: 240px; }
/* Korrektur 2g (N2g-5): kein Umbruch mitten im Wort. Die Adresse bricht nur beim @ (wbr), nur notfalls innerhalb eines Wortes. */
.bn-team .bn-wer b { display: block; overflow-wrap: break-word; }
.bn-team .bn-mail { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); overflow-wrap: break-word; }
.bn-team .bn-wer .small { display: block; }
.bn-team td.bn-abt .check-line { display: flex; margin: 3px 0; }
.bn-team .bn-nst { width: 72px; }
.bn-team td.bn-knoepfe { white-space: normal; min-width: 200px; }
.bn-team td.bn-knoepfe .btn { margin: 2px 0 2px 2px; vertical-align: middle; }
.bn-mehr-knopf.active { border-color: var(--ak-ln); background: var(--ak-bg); }
.bn-mehr-zeile[hidden] { display: none; }
.bn-team tr.bn-zeile:has(+ tr.bn-mehr-zeile:not([hidden])) td { border-bottom-color: transparent; background: var(--flaeche-2); }
.bn-mehr-zeile td { white-space: normal; background: var(--flaeche-2); }
.bn-mehr-felder { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; padding: 2px 4px 4px; }
.bn-mehr-felder input[type="number"] { width: 120px; }
.bn-mehr-felder .bn-tel input { width: 200px; }
.bn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Korrektur 2g (N2g-4): Team-Rangliste, Konten ohne Anmeldung ----------
   Kürzel vor dem @ statt der vollen Adresse, darunter klein «noch nicht angemeldet». Kein Umbruch mitten im Wort, auch nicht im Podest bei 390. */
.bn-rang-name { white-space: nowrap; }
.bn-rang-neu { display: block; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
table.rang td .bn-rang-neu { display: inline; margin-left: 6px; }
.podest .bn-rang-name, .podest .bn-rang-neu { overflow-wrap: normal; word-break: normal; }
.podest .bn-rang-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .podest .bn-rang-neu { white-space: normal; text-align: center; }
  table.rang td .bn-rang-neu { display: block; margin-left: 0; }
}

/* ================= Runde 2j TEAM (.bf-, .bn-schalter): Foto und Handynummer mit Schalter =================
   Mein Profil und Team. Ruhig, Schalter an in Grün (beide Abteilungen ohne Rot), Fotos rund wie in der Seitenleiste. */
.bf-profil { margin-top: 6px; }
.bf-profil .subsec { margin-top: 14px; }
.bf-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bf-block > .avatar { width: 72px; height: 72px; border-radius: 50%; font-size: 24px; flex: none; }
.bf-block.klein > .avatar { width: 48px; height: 48px; font-size: 16px; }
.bf-block-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bf-block-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bf-handy { margin-top: 14px; max-width: 320px; }
.bf-hinweis { margin: 4px 0 0; max-width: 60ch; }

/* Schalter: Checkbox mit role="switch" als Schiebeschalter, Fokus sichtbar, Text daneben klickbar */
.bn-schalter { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; margin: 10px 0 0; cursor: pointer; color: var(--text) !important; max-width: 100%; }
.bn-schalter > span { min-width: 0; overflow-wrap: anywhere; }
.bn-schalter input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; position: relative; cursor: pointer;
  background: var(--flaeche-3); border: 1px solid var(--line-3); transition: background .15s ease, border-color .15s ease; }
.bn-schalter input[type="checkbox"]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.bn-schalter input[type="checkbox"]:checked { background: var(--ok-bg); border-color: var(--ok-tx); }
.bn-schalter input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--ok-tx); }
.bn-schalter input[type="checkbox"]:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .bn-schalter input[type="checkbox"], .bn-schalter input[type="checkbox"]::after { transition: none; } }

/* Team: Foto neben dem Namen, Schalter und Foto in der Zeile «Mehr» */
.bn-team td.bn-wer:has(.bn-wer-zeile) { min-width: 190px; max-width: 280px; }
.bn-team .bn-wer-zeile { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.bn-team .bn-wer-zeile > .avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11.5px; margin-top: 1px; }
.bn-team .bn-wer-text { min-width: 0; }
.bn-mehr-felder .bn-schalter { margin: 0 0 8px; }
.bn-mehr-felder .bf-block { margin: 0 0 2px; }
.bn-handy-hinweis { margin: 2px 4px 4px; }

/* Pop-up «Foto» */
.bf-dialog { display: grid; gap: 12px; }
.bf-kopf { display: flex; align-items: center; gap: 10px; }
.bf-kopf h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.bf-kopf .spacer { flex: 1; }
.bf-name { margin: -4px 0 0; }
.bf-buehne { display: grid; place-items: center; padding: 18px; border-radius: 16px; background: var(--flaeche-3); box-shadow: inset 0 0 0 1px var(--line); }
.bf-buehne .avatar.bf-gross { width: 168px; height: 168px; border-radius: 50%; font-size: 52px; object-fit: cover; }
.bf-quelle, .bf-regel { margin: 0; }
.bf-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-datei { position: relative; overflow: hidden; }
.bf-datei input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bf-fehler:empty { display: none; }

@media (max-width: 760px) {
  .bf-block { align-items: flex-start; }
  .bf-block-knoepfe .btn { flex: 1 1 auto; justify-content: center; }
  .bf-buehne .avatar.bf-gross { width: 140px; height: 140px; font-size: 44px; }
  .bn-mehr-felder .bn-schalter { width: 100%; }
  /* Zeile «Mehr» bleibt im sichtbaren Teil der waagrecht scrollenden Tabelle */
  .bn-mehr-zeile td > .bn-mehr-felder, .bn-mehr-zeile td > .bn-handy-hinweis { position: sticky; left: 0; max-width: calc(100vw - 80px); box-sizing: border-box; }
}
