/* Seitenrahmen: Kopfzeile mit Marke und Benutzermenü, Seitenbreiten, Seitentitel, Schrittanzeiger und die Fehlerleiste von
   Blazor. Tokens: tokens.css, Bausteine: app.css. */

/* ---------- Kopfzeile ---------- */

/* Innenabstand 5vw: Die Marke steht bündig mit der Prüfmaske, die 90 % der Fensterbreite nutzt. */
.app-header {
  min-height: 64px;
  padding: var(--space-4) 5vw;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-logo {
  display: block;
  width: 30px;
  height: 30px;
}

/* Name und darunter, rechtsbündig, der Zusatz "by SEPTEO" (wie im Lockup der Septeo-Produkte). */
.brand-name {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  line-height: 1.1;
}

.brand-endorsement {
  display: block;
  width: auto;
  height: 8px;
}

.brand-strong {
  font-weight: 600;
}

.brand-light {
  font-weight: 400;
  color: var(--text-secondary);
}

/* ---------- Benutzermenü ---------- */

/* <details> statt Skript: summary ist fokussierbar und klappt mit Enter und Leertaste auf. */
.user-menu {
  position: relative;
}

.user-menu > summary {
  list-style: none;
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.user-menu > summary::-webkit-details-marker {
  display: none;
}

.user-menu > summary:hover {
  color: var(--text-secondary);
}

.user-menu > summary:hover .avatar,
.user-menu[open] .avatar {
  border-color: var(--border-strong);
}

.user-menu-name {
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.user-menu-popover {
  position: absolute;
  top: calc(100% + var(--space-4));
  right: 0;
  z-index: 10;
  width: max-content;
  min-width: 240px;
  max-width: min(360px, 90vw);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.user-menu-account {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-menu-label {
  font: var(--type-label);
  color: var(--text-muted);
}

.user-menu-popover form {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.user-menu-popover .btn {
  width: 100%;
  justify-content: flex-start;
}

@media (max-width: 600px) {
  .user-menu-name {
    display: none;
  }
}

/* ---------- Seite ---------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-12) 56px;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* Breite Seiten (Listen und die Kanzlei im Admin-Bereich) nutzen wie die Prüfmaske 90 % der Fensterbreite: je 5 % Rand,
   bündig mit der Kopfzeile. */
.page--wide {
  max-width: none;
  width: 90vw;
  padding-left: 0;
  padding-right: 0;
}

.page--narrow {
  max-width: 480px;
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.page-title {
  font: var(--type-page-title);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font: var(--type-page-subtitle);
  color: var(--text-muted);
}

/* ---------- Schrittanzeiger ---------- */

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.step--done {
  color: var(--text-secondary);
}

.step--current {
  color: var(--text-primary);
  font-weight: 600;
}

.step-dot {
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.step--done .step-dot {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
}

.step--current .step-dot {
  border-color: var(--btn-primary-bg);
  background: var(--btn-primary-bg);
  color: #ffffff;
}

.step-line {
  flex: none;
  width: 36px;
  height: 1px;
  background: var(--border-strong);
}

/* ---------- Fehlerleiste von Blazor ---------- */

/* Sie steht in beiden Layouts (Kanzlei und Admin) und bleibt verborgen, bis Blazor sie bei einem unbehandelten Fehler
   einblendet. Deckende Fläche: Die Tönungen der Meldungsfarben sind im dunklen Thema durchscheinend. */
#blazor-error-ui {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 1000;
  width: 100%;
  padding: var(--space-5) var(--space-16) var(--space-5) 5vw;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--warning-fg);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: none;
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: var(--space-4);
  right: var(--space-6);
  cursor: pointer;
}
