/* Gliederung der Zentrale (seit 27.10.2026): Seitenleiste mit Ressorts, Pfad über den Seiten, Schnellsuche, Punkt an
   „Bereiche“ unten am Telefon. Aufbau in public/js/navigation.js. Eigene Datei, nur neue Klassen; die alten Klassen der
   Seitenleiste (.tab, .leiste-bereiche, .leiste-titel) bleiben, damit die Browsertests und die Bereiche sie finden. */

/* ---------- Seitenleiste am Mac ---------- */

@media (min-width: 900px) {
  .leiste-suche {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    margin: 0 0 12px;
    padding: 0 8px 0 12px;
    border: 0;
    border-radius: var(--radius-m);
    background: var(--flaeche-2);
    box-shadow: inset 0 0 0 1px var(--linie);
    color: var(--tinte-3);
    font: inherit;
    font-size: 14.5px;
    font-weight: 540;
    text-align: left;
    cursor: pointer;
    transition:
      background-color 140ms ease,
      box-shadow 140ms ease,
      transform 140ms var(--ease-out);
  }

  .leiste-suche svg {
    flex: none;
  }

  .leiste-suche kbd {
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--flaeche);
    box-shadow: 0 0 0 1px var(--linie);
    color: var(--tinte-3);
    font: inherit;
    font-size: 11.5px;
    font-weight: 620;
    line-height: 1;
  }

  .leiste-suche:active {
    transform: scale(0.98);
  }

  /* Ressorts: Titel in Satzschreibung (keine Großbuchstaben-Etiketten), der aktive trägt den türkisen Punkt. */
  .leiste-ressort {
    margin: 12px 0 4px;
    padding-top: 12px;
  }

  .leiste-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    margin: 0 4px 4px 12px;
  }

  .leiste-ressort .leiste-titel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 640;
    color: var(--tinte-3);
  }

  .leiste-ressort .leiste-titel::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--linie);
    transition: background-color 160ms ease;
  }

  .leiste-ressort[data-aktiv] .leiste-titel {
    color: var(--tinte);
  }

  .leiste-ressort[data-aktiv] .leiste-titel::before {
    background: var(--marke);
    box-shadow: 0 0 0 3px oklch(0.8 0.12 195 / 0.2);
  }

  .leiste-klappe {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--tinte-3);
    cursor: pointer;
    transition:
      opacity 140ms ease,
      background-color 140ms ease,
      transform 140ms var(--ease-out);
  }

  .leiste-klappe svg {
    transition: transform 200ms var(--ease-out);
  }

  .leiste-ressort.zu .leiste-klappe svg {
    transform: rotate(-90deg);
  }

  .leiste-klappe:active {
    transform: scale(0.92);
  }

  .leiste-ressort .tab {
    padding: 8px 12px;
  }

  .leiste-ressort .tab span:not(.zaehler) {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .leiste-ressort .tab .zaehler {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11.5px;
  }

  .seitenleiste .tab.offen {
    color: var(--tinte);
    font-weight: 600;
  }

  /* Unterbereiche des aktiven Teils: eingerückt an einer feinen Führungslinie, ohne Symbole. */
  .leiste-unter {
    display: grid;
    gap: 2px;
    margin: 2px 0 8px 23px;
    padding-left: 8px;
    box-shadow: inset 1px 0 0 var(--linie);
  }

  .seitenleiste .unter-tab {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 520;
    color: var(--tinte-2);
  }

  .seitenleiste .unter-tab[aria-current='page'] {
    background: var(--marke-zart);
    color: var(--tinte);
    font-weight: 620;
  }

  .seitenleiste .leiste-einstellungen {
    margin-top: 12px;
  }
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .leiste-suche:hover {
    background: var(--flaeche);
    box-shadow:
      inset 0 0 0 1px oklch(0.82 0.04 200),
      0 4px 12px -8px oklch(0.2 0.02 228 / 0.3);
    color: var(--tinte-2);
  }

  .leiste-ressort .leiste-klappe {
    opacity: 0;
  }

  .leiste-ressort:hover .leiste-klappe,
  .leiste-ressort.zu .leiste-klappe,
  .leiste-klappe:focus-visible {
    opacity: 1;
  }

  .leiste-klappe:hover {
    background: var(--flaeche-3);
    color: var(--tinte);
  }

  .leiste-ressort .leiste-titel:hover {
    color: var(--tinte);
  }
}

/* ---------- Untere Leiste am Telefon ---------- */

.tab .tab-punkt {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 2px oklch(0.99 0.003 205);
}

/* ---------- Pfad über den Seiten ---------- */

/* Telefon: eine wischbare Zeile (zurück zum Ressort, dann die Nachbarn). */
.pfadleiste {
  padding: calc(var(--oben) + 8px) 0 0;
}

.pfadleiste + .seite {
  padding-top: 8px;
}

.pfad {
  display: none;
}

.pfad-reiter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px calc(var(--seite) + var(--rechts)) 8px calc(var(--seite) + var(--links) - 4px);
  scrollbar-width: none;
  scroll-padding-inline: 16px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}

.pfad-reiter::-webkit-scrollbar {
  display: none;
}

.pfad-zurueck,
.pfad-pille {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 140ms var(--ease-out),
    background-color 140ms ease;
}

.pfad-zurueck {
  gap: 2px;
  padding: 0 12px 0 4px;
  color: var(--tinte);
  font-weight: 650;
}

.pfad-pille {
  padding: 0 16px;
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
  color: var(--tinte-2);
  font-weight: 560;
}

.pfad-pille[aria-current='page'] {
  background: var(--nacht);
  box-shadow: none;
  color: #fff;
}

.pfad-zurueck:active,
.pfad-pille:active {
  transform: scale(0.96);
}

.pfad-pille .zaehler {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
}

/* Mac: nur der Pfad, schmal über dem Titel; die Seitenleiste zeigt die Nachbarn. */
@media (min-width: 900px) {
  .pfadleiste {
    padding: 28px var(--seite) 0;
  }

  .pfadleiste + .seite {
    padding-top: 8px;
  }

  .pfad {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    font-size: 13.5px;
  }

  .pfad-glied {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
    border-radius: 6px;
    color: var(--tinte-3);
    font-weight: 580;
    text-decoration: none;
    transition: color 120ms ease;
  }

  .pfad-glied:hover {
    color: var(--tinte);
  }

  .pfad-trenner {
    display: inline-grid;
    color: var(--linie);
  }

  .pfad-reiter {
    display: none;
  }
}

/* ---------- Schnellsuche ---------- */

.suche-zeile-feld {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-l);
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
  color: var(--tinte-3);
  cursor: text;
  transition: box-shadow 140ms ease;
}

.suche-zeile-feld:focus-within {
  box-shadow:
    0 0 0 2px var(--marke-tief),
    0 8px 24px -16px oklch(0.2 0.02 228 / 0.4);
}

.suche-feld {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tinte);
  font: inherit;
  font-size: 16px;
  font-weight: 520;
  outline: none;
}

.suche-feld::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.suche-feld::placeholder {
  color: var(--tinte-3);
}

.suche-treffer {
  display: grid;
  gap: 2px;
  align-content: start;
}

.suche-eingebettet .suche-treffer {
  margin-top: 8px;
  padding: 8px;
  border-radius: var(--radius-l);
  background: var(--flaeche);
  box-shadow: var(--schatten-2);
}

.suche-gruppe {
  padding: 12px 12px 4px;
  color: var(--tinte-3);
  font-size: 12.5px;
  font-weight: 640;
}

.suche-zeile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--radius-m);
  color: var(--tinte);
  text-decoration: none;
  scroll-margin: 8px;
}

.suche-zeile > svg {
  color: var(--tinte-3);
}

.suche-zeile[aria-selected='true'] {
  background: var(--marke-zart);
}

.suche-zeile:active {
  background: var(--marke-zart);
}

.suche-text {
  display: grid;
  min-width: 0;
}

.suche-name,
.suche-pfad {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.suche-name {
  font-weight: 620;
  letter-spacing: -0.01em;
}

.suche-pfad {
  color: var(--tinte-3);
  font-size: 13px;
}

.suche-zeit {
  color: var(--tinte-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.suche-tipp {
  margin: 12px;
  color: var(--tinte-3);
  font-size: 14px;
  line-height: 1.45;
}

/* Fenster über allem (über Blättern, unter Versions- und Einladungsband) */
.suche-schleier {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: max(12vh, calc(var(--oben) + 16px)) 16px 16px;
  background: oklch(0.2 0.02 228 / 0.26);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: suche-schleier 160ms var(--ease-out);
}

.suche-schleier.weg {
  opacity: 0;
  transition: opacity 140ms ease;
}

.suche-fenster {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(72dvh, 640px);
  padding: 8px;
  border-radius: var(--radius-xl);
  background: oklch(0.995 0.003 205 / 0.94);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.9),
    0 32px 64px -24px oklch(0.2 0.03 228 / 0.45),
    0 0 0 1px oklch(0.2 0.02 228 / 0.08);
  animation: suche-fenster 180ms var(--ease-out);
}

.suche-fenster .suche {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.suche-fenster .suche-zeile-feld {
  flex: none;
  background: none;
  box-shadow: none;
}

.suche-fenster .suche-treffer {
  overflow-y: auto;
  min-height: 0;
  padding: 4px 0;
  box-shadow: inset 0 1px 0 var(--linie-2);
}

.suche-fuss {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 12px 4px;
  box-shadow: inset 0 1px 0 var(--linie-2);
  color: var(--tinte-3);
  font-size: 12.5px;
}

.suche-fuss kbd {
  margin-right: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--flaeche-3);
  color: var(--tinte-2);
  font: inherit;
  font-weight: 620;
}

@media (hover: none) {
  .suche-fuss {
    display: none;
  }
}

@keyframes suche-schleier {
  from {
    opacity: 0;
  }
}

@keyframes suche-fenster {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .suche-schleier,
  .suche-fenster {
    animation: none;
  }
}

/* Externer Link am Ende der Unterbereiche (Dental-Dashboard, seit 02.11.2026): leiser als die Reiter, Pfeil nach außen. */
.seitenleiste .unter-tab.unter-extern {
  color: var(--tinte-3);
  gap: 6px;
}
.seitenleiste .unter-tab.unter-extern svg {
  flex: none;
  opacity: 0.7;
}
