/* ==========================================================================
   Zugang & Benutzerverwaltung – Ergänzungen zu cms.css
   (Anmeldung, Einladung, Benutzerliste, Import, Konto)
   ========================================================================== */

/* Zustandsumschalter – nur in der Designvorlage */
.state-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 5px 5px 5px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-full); font-size: 12px; color: var(--ink-3); width: max-content; max-width: 100%; background: var(--surface-2); }
.state-switch__label { letter-spacing: .1em; text-transform: uppercase; font-weight: 700; font-size: 10.5px; }
.state-switch .segmented { padding: 2px; }
.state-switch .segmented button { height: 26px; padding: 0 10px; font-size: 12px; }
.auth__top { width: 100%; max-width: 420px; margin: 0 auto 32px; }
.auth__panel--start { justify-content: flex-start; padding-top: 40px; }
.auth .auth__mark img { width: 220px; }
body.has-demo .auth__panel { padding-bottom: 88px; }

/* Passwortfeld mit Sichtbarkeitsknopf */
.input-group .btn--icon.btn--sm { height: 34px; align-self: center; }

/* Fehlerzustand der Anmeldung (Vorlage) */
.auth:has([data-tabpanel="login:fehler"]:not([hidden])) #login-pw-group { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* Erfolg / Statussymbol */
.status-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.status-mark .i { width: 30px; height: 30px; stroke-width: 1.8; }
.status-mark--info { background: var(--accent-soft); color: var(--accent); }
.status-mark--warn { background: var(--warn-soft); color: var(--warn); }

/* Einladungskarte */
.invite { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.invite__from { display: flex; align-items: center; gap: 12px; }
.invite__from strong { display: block; }
.invite__from small { color: var(--ink-3); font-size: 13px; }
.invite__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.invite__list li { display: flex; gap: 10px; align-items: flex-start; }
.invite__list .i { color: var(--ok); margin-top: 2px; }

/* Kleine Eingabefelder (z. B. Korrektur in Tabellenzellen) */
.input--sm { min-height: 34px; padding: 5px 10px; font-size: 13.5px; border-radius: var(--r-sm); }

/* Kennzahlen mit Bedeutung */
.stat--ok .stat__value { color: var(--ok); }
.stat--danger .stat__value { color: var(--danger); }
.stat--warn .stat__value { color: var(--warn); }
.stat--muted .stat__value { color: var(--ink-3); }

/* Mehrfachauswahl-Leiste */
.bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 8px 8px 18px; margin-bottom: 12px; border-radius: var(--r-full); background: var(--navy); color: var(--on-navy); font-size: 14px; box-shadow: var(--sh-2); }
.bulkbar .btn { --btn-bg: transparent; --btn-fg: var(--on-navy); --btn-line: color-mix(in srgb, var(--on-navy) 30%, transparent); }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--on-navy) 12%, transparent); color: var(--on-navy); }
.bulkbar__end { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* Sprachauswahl als Etiketten */
.lang-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lang-tags .tag { height: 30px; padding: 0 8px 0 10px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent-line); }
.lang-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-picks .filter-chip .flag { width: 16px; height: 12px; }
.lang-panel { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }

/* Kleine E-Mail-Vorschau */
.mail--mini { box-shadow: var(--sh-1); border-radius: 12px; }
.mail--mini .mail__head { padding: 16px 20px 12px; }
.mail--mini .mail__head img { width: 124px; }
.mail--mini .mail__body { padding: 18px 20px 20px; font-size: 13px; line-height: 1.55; }
.mail--mini .mail__body h1 { font-size: 18px; margin-bottom: 8px; }
.mail--mini .mail__btn { padding: 9px 16px; margin: 10px 0 6px; font-size: 13px; }
.mail--mini .mail__foot { padding: 12px 20px; font-size: 11px; }
.mail__role { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #eeeaf8; color: #5b4a94; font-weight: 700; font-size: .9em; }
.mail__role img { width: 18px; height: 13px; border-radius: 2px; }
.mail__facts { margin: 16px 0; padding: 14px 16px; border-radius: 10px; background: #faf8f4; border: 1px solid #efebe3; font-size: .93em; display: grid; gap: 4px; }
.mail__facts b { color: #102a3b; }
.mail__sign { margin-top: 20px; }

/* Profilkopf */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-head__text { flex: 1; min-width: 220px; }
.profile-head__text h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.profile-head__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; color: var(--ink-3); font-size: 14px; }

/* Gefahrenbereich */
.disclosure--danger { border-color: var(--danger-line); }
.disclosure--danger > summary .disclosure__icon { background: var(--danger-soft); color: var(--danger); border: 0; }
.disclosure--danger .disclosure__title strong { color: var(--danger); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
.danger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.danger-row:first-child { padding-top: 0; }
.danger-row p { color: var(--ink-3); font-size: 13.5px; max-width: 520px; }

/* Tabellenvorschau (Excel) */
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.sheet { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; }
.sheet tr > :first-child { border-left: 0; }
.sheet tr > :last-child { border-right: 0; }
.sheet thead th { border-top: 0; background: var(--surface-3); color: var(--ink-3); font-size: 11px; font-weight: 700; text-align: center; letter-spacing: .06em; }
.sheet tbody tr:last-child td, .sheet tbody tr:last-child th { border-bottom: 0; }
.sheet .rn { background: var(--surface-3); color: var(--ink-3); text-align: center; width: 36px; font-size: 11px; font-weight: 700; }
.sheet .hd td { font-weight: 700; background: var(--surface-2); }
.col-legend { display: grid; gap: 10px; }
.col-legend > div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.col-legend .col { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.col-legend strong { display: block; font-size: 14px; }
.col-legend small { display: block; color: var(--ink-3); font-size: 13px; }

/* Prüfergebnis in Tabellenzellen */
.check-result { display: grid; gap: 6px; justify-items: start; }
.check-result p { font-size: 13px; color: var(--ink-2); }
.check-result .row { gap: 8px; }
.row-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* Rechte-Matrix: Rollenköpfe */
.matrix th .role-tag { text-transform: none; letter-spacing: 0; }
.matrix td .yes .i { width: 18px; height: 18px; }

/* Sitzungen */
.session-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); flex: none; }

/* Schmale Bildschirme */
@media (max-width: 860px) {
  .auth__panel { padding-bottom: 96px; }
  .auth__top { margin-bottom: 24px; }
}
@media (max-width: 720px) {
  .bulkbar { border-radius: var(--r-lg); }
  .bulkbar__end { margin-left: 0; width: 100%; }
  .profile-head { gap: 16px; }
  .profile-head .avatar--xl { width: 60px; height: 60px; font-size: 21px; }
  .state-switch { border-radius: var(--r-lg); }
}

/* Symbol im Fließtext */
.i-inline { display: inline-block; vertical-align: -3px; }
.link-btn .i { display: inline-block; }
.checklist li:not(.ok) .i { opacity: .3; }

/* Bildseite bleibt bei langen Formularen stehen */
@media (min-width: 861px) {
  .auth__visual { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; }
}
.auth__steps { margin-bottom: 26px; }
.auth__steps .stepper { margin: 0; }

/* Hinweis mit Aktion: Knopf rutscht auf schmalen Bildschirmen unter den Text */
.notice--action { align-items: center; }
@media (max-width: 720px) {
  .notice--action { flex-wrap: wrap; align-items: flex-start; }
  .notice--action > .btn { margin-left: 32px; }
}

/* Seitenspalte bleibt beim Scrollen sichtbar (nur breite Bildschirme) */
@media (min-width: 1101px) {
  .sticky-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
}

/* Nur auf schmalen Bildschirmen sichtbar */
.only-sm { display: none; }
@media (max-width: 720px) { .only-sm { display: inline; } }
.sheet { font-size: 12px; }
.sheet th, .sheet td { padding: 6px 8px; }
.sheet .rn { width: 28px; }

/* Prüftabelle als Karten: Zeilenfarbe auf ganzer Karte */
@media (max-width: 720px) {
  .table--cards tr.is-error { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
  .table--cards tr.is-warn { background: color-mix(in srgb, var(--warn-soft) 60%, transparent); }
  .table--cards tr.is-error td, .table--cards tr.is-warn td { background: transparent; }
}
@media (max-width: 420px) {
  .grid--4.grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid--stats .stat { padding: 14px; }
  .grid--stats .stat__meta { font-size: 12px; }
}

/* E-Mail-Vorschau: Überschrift kompakt, Logo etwas größer */
.mail__body h1 { line-height: 1.25; }
.mail:not(.mail--mini) .mail__head img { width: 210px; }
