/* Portal-Ergänzungen – nur Tokens aus design-system/tokens.css, keine eigenen Farben/Radien/Abstände. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1 { font-size: var(--mdk-font-size-xl); font-weight: var(--mdk-font-weight-semibold); margin: 0 0 var(--mdk-space-md); }
h2 { font-size: var(--mdk-font-size-lg); font-weight: var(--mdk-font-weight-semibold); margin: 0 0 var(--mdk-space-md); }
a { color: var(--mdk-color-accent-green); }

/* ---------- Vollbild-Ansichten (Anmeldung, Pflichtwechsel, Einrichtung …) ---------- */
.vollbild { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--mdk-space-lg); }
.vollbild__karte { width: 100%; max-width: 520px; }
.marke { display: flex; align-items: center; gap: var(--mdk-space-md); margin-bottom: var(--mdk-space-lg); }
.marke img { border-radius: var(--mdk-radius-button); background: var(--mdk-color-text-primary); }
.marke__name { font-size: var(--mdk-font-size-lg); font-weight: var(--mdk-font-weight-bold); }
.marke__zusatz { font-size: var(--mdk-font-size-sm); color: var(--mdk-color-text-secondary); }
.marke--klein { margin-bottom: var(--mdk-space-lg); gap: var(--mdk-space-sm); }
.marke--klein .marke__name { font-size: var(--mdk-font-size-md); }

.formular { display: flex; flex-direction: column; gap: var(--mdk-space-md); margin: var(--mdk-space-md) 0; }
.formular label { display: flex; flex-direction: column; gap: var(--mdk-space-xs); font-size: var(--mdk-font-size-sm);
  color: var(--mdk-color-text-secondary); }
.formular .mdk-btn { align-self: flex-start; }
.mdk-btn:disabled { opacity: 0.45; cursor: default; }
.mdk-input:focus, .mdk-btn:focus-visible { outline: 2px solid var(--mdk-color-accent-green); outline-offset: 1px; }
.zeile { display: flex; flex-wrap: wrap; gap: var(--mdk-space-sm); align-items: center; }
.kurz { width: 7em; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.hinweis { color: var(--mdk-color-text-secondary); font-size: var(--mdk-font-size-sm); line-height: 1.5; }
.klein { font-size: var(--mdk-font-size-xs); }
.meldung { min-height: 1.2em; font-size: var(--mdk-font-size-sm); color: var(--mdk-status-error); }
.meldung--ok { color: var(--mdk-status-success); }
.trenner { border-top: 1px solid var(--mdk-color-border-card); margin: var(--mdk-space-lg) 0 var(--mdk-space-md); }
.checkbox { display: flex; gap: var(--mdk-space-sm); align-items: flex-start; font-size: var(--mdk-font-size-sm);
  color: var(--mdk-color-text-secondary); margin-bottom: var(--mdk-space-sm); }

.recovery { font-family: ui-monospace, Consolas, monospace; font-size: var(--mdk-font-size-lg); letter-spacing: 0.04em;
  line-height: 1.6; padding: var(--mdk-space-md); border: 1px dashed var(--mdk-color-accent-yellow);
  border-radius: var(--mdk-radius-button); color: var(--mdk-color-accent-yellow); word-spacing: 0.3em;
  margin: var(--mdk-space-md) 0; }

/* ---------- Shell ---------- */
.mdk-sidebar { display: flex; flex-direction: column; gap: var(--mdk-space-xs); }
.mdk-nav-item { text-decoration: none; }
.mdk-nav-item svg, .unten-nav svg { width: var(--mdk-icon-md); height: var(--mdk-icon-md); fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.topbar__titel { color: var(--mdk-color-text-primary); font-weight: var(--mdk-font-weight-semibold); font-size: var(--mdk-font-size-md); }
.topbar__abstand { flex: 1; }
.seitentitel { margin-bottom: var(--mdk-space-lg); }
.spalten { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--mdk-space-card); align-items: start; }

/* ---------- Kacheln der Anwendungen ---------- */
.kachel { display: flex; flex-direction: column; gap: var(--mdk-space-md); min-height: 220px; }
.kachel__kopf { display: flex; align-items: center; gap: var(--mdk-space-md); }
.kachel__kopf img { width: 56px; height: 56px; border-radius: var(--mdk-radius-button); background: var(--mdk-color-text-primary); }
.kachel__name { font-size: var(--mdk-font-size-lg); font-weight: var(--mdk-font-weight-semibold); }
.kachel__version { font-size: var(--mdk-font-size-sm); color: var(--mdk-color-text-secondary); }
.kachel__fuss { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: var(--mdk-space-sm); }
.kachel--gesperrt { opacity: 0.45; }
.kachel--gesperrt img { filter: grayscale(1); }

/* ---------- Verwaltung: Liste links, Detail rechts ---------- */
.liste-detail { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: var(--mdk-space-card); align-items: start; }
.liste { list-style: none; margin: 0 0 var(--mdk-space-lg); padding: 0; max-height: 40vh; overflow-y: auto; }
.liste li { padding: var(--mdk-space-sm) var(--mdk-space-md); border-radius: var(--mdk-radius-button); cursor: pointer;
  display: flex; justify-content: space-between; gap: var(--mdk-space-sm); font-size: var(--mdk-font-size-sm); }
.liste li:hover { background: rgba(255,255,255,0.04); }
.liste li[aria-selected="true"] { background: var(--mdk-color-primary); }
.rechte { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--mdk-space-sm); }
.detail-abschnitt { border-top: 1px solid var(--mdk-color-border-card); padding-top: var(--mdk-space-md); margin-top: var(--mdk-space-md); }

/* ---------- Einstellungen: Sicherheitsschlüssel der Verwaltung (docs/35 §3) ---------- */
.schluessel-liste { list-style: none; margin: 0 0 var(--mdk-space-sm); padding: 0; }
.schluessel-liste li { display: flex; justify-content: space-between; align-items: center; gap: var(--mdk-space-sm);
  padding: var(--mdk-space-sm) 0; border-bottom: 1px solid var(--mdk-color-border-card); }
.schluessel__name { font-weight: var(--mdk-font-weight-semibold); overflow-wrap: anywhere; }

/* ---------- Downloads (docs/33, DL2) ---------- */
.liste--apps { max-height: none; }
.liste--apps li { align-items: center; }
.liste--apps img { width: 28px; height: 28px; border-radius: var(--mdk-radius-button); background: var(--mdk-color-text-primary); }
.liste__name { display: flex; align-items: center; gap: var(--mdk-space-sm); }
.liste li[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.liste li[aria-disabled="true"]:hover { background: none; }
.liste li[aria-disabled="true"] img { filter: grayscale(1); }
.schloss { width: var(--mdk-icon-md); height: var(--mdk-icon-md); fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; color: var(--mdk-color-text-muted); flex: none; }
.dl-kopf { display: flex; align-items: center; gap: var(--mdk-space-md); margin-bottom: var(--mdk-space-md); }
.dl-kopf img { width: 48px; height: 48px; border-radius: var(--mdk-radius-button); background: var(--mdk-color-text-primary); }
.reiter { display: flex; gap: var(--mdk-space-xs); border-bottom: 1px solid var(--mdk-color-border-card);
  margin-bottom: var(--mdk-space-md); flex-wrap: wrap; }
.reiter button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--mdk-color-text-secondary);
  padding: var(--mdk-space-sm) var(--mdk-space-md); font: inherit; font-size: var(--mdk-font-size-sm); cursor: pointer; }
.reiter button[aria-selected="true"] { color: var(--mdk-color-text-primary); border-bottom-color: var(--mdk-color-accent-green); }
.reiter button:disabled { opacity: 0.45; cursor: default; }
.datei { border: 1px solid var(--mdk-color-border-card); border-radius: var(--mdk-radius-button); padding: var(--mdk-space-md);
  display: flex; flex-direction: column; gap: var(--mdk-space-sm); margin-bottom: var(--mdk-space-md); }
.datei__name { font-weight: var(--mdk-font-weight-semibold); overflow-wrap: anywhere; }
.pruefsumme { font-family: ui-monospace, Consolas, monospace; font-size: var(--mdk-font-size-xs);
  color: var(--mdk-color-text-secondary); overflow-wrap: anywhere; }
.abschnitt { margin-top: var(--mdk-space-card); }
.tabelle-scroll { overflow-x: auto; margin-bottom: var(--mdk-space-md); }
.tabelle-scroll .mdk-table td { vertical-align: top; }
.dateiliste { white-space: pre-line; min-width: 18em; }
.grund { color: var(--mdk-status-error); font-size: var(--mdk-font-size-xs); max-width: 32em; overflow-wrap: anywhere; }
a.mdk-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Geöffnete Fachanwendung ---------- */
.mdk-main.mit-app { padding: 0; }
.app-ansicht { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.app-leiste { display: flex; align-items: center; gap: var(--mdk-space-sm); padding: var(--mdk-space-sm) var(--mdk-space-md);
  background: var(--mdk-color-bg-elevated); border-bottom: 1px solid var(--mdk-color-border-card); flex-wrap: wrap; }
.app-leiste__name { font-weight: var(--mdk-font-weight-semibold); }
.app-ansicht .meldung { margin: 0; padding: 0 var(--mdk-space-md); min-height: 0; }
.app-rahmen { flex: 1; min-height: 0; }
.app-rahmen iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--mdk-color-bg); }

/* ---------- Dialoge ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2, 13, 8, 0.75); display: flex; align-items: center;
  justify-content: center; z-index: var(--mdk-z-modal); padding: var(--mdk-space-lg); }
.dialog { max-width: 560px; width: 100%; box-shadow: var(--mdk-shadow-elevated); }

/* ---------- Mobil: Bottom-Navigation ---------- */
.unten-nav { display: none; }
@media (max-width: 767px) {
  .mdk-sidebar { display: none; }               /* wie components.css – hier erneut, da oben display:flex gesetzt */
  .kachel { min-height: 0; }
  .mdk-topbar [data-feld="uhr"], .mdk-topbar [data-feld="email"] { display: none; }
  .mdk-main { padding-bottom: 88px; }
  .unten-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--mdk-z-sticky);
    background: var(--mdk-color-primary-dark); border-top: 1px solid var(--mdk-color-border-card); }
  .unten-nav a { flex: 1; text-align: center; padding: var(--mdk-space-md) var(--mdk-space-xs); color: var(--mdk-color-text-secondary);
    text-decoration: none; font-size: var(--mdk-font-size-sm); }
  .unten-nav a.aktiv { color: var(--mdk-color-text-primary); background: var(--mdk-color-primary); }
  .liste-detail { grid-template-columns: 1fr; }
  .app-offen .unten-nav { display: none; }       /* geöffnete App bekommt die ganze Höhe */
  .app-offen .mdk-main { padding-bottom: 0; }
}
@media (max-width: 420px) {                        /* Verwaltung: 5 Einträge unten (seit „Downloads“) passen in 375 px */
  .unten-nav a { font-size: var(--mdk-font-size-xs); padding-left: 2px; padding-right: 2px; }
}

@media print {
  body * { visibility: hidden; }
  .recovery, .recovery * { visibility: visible; }
  .recovery { position: absolute; top: 0; left: 0; color: #000; border-color: #000; }
}
