/* Stammdaten-Verwaltung — Gestaltung nach Werksnorm
   (design-norm.css liefert die zentralen Farbwerte). */

:root {
  --brand-gradient: linear-gradient(140deg, #1d4674 0%, #0b1d34 78%);
  --navy: #071b36;
  --aqua: #17c3c8;
  --aqua-text: #08777b;
  --aqua-soft: #e7f7f4;
  --paper: #f5f8f7;
  --white: #ffffff;
  --ink: #102135;
  --muted: #607083;
  --line: rgba(7, 27, 54, .14);
  --red: #c23b3b;
  --green: #1f8b66;
  --amber: #8a6300;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3 { color: var(--navy); margin-top: 0; }

.app-header {
  min-height: 92px;
  padding: 14px clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand img { width: 210px; display: block; }
.app-header nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; color: var(--navy); }
.app-header nav a { color: inherit; text-decoration-color: var(--aqua); text-underline-offset: 4px; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 12px 18px; border-radius: 8px;
  background: var(--white); color: var(--navy); font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

main { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 90px; }

.kopf {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 16px;
}
.eyebrow { color: var(--aqua-text); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin: 0 0 8px; }
.kopf h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.einleitung { color: var(--muted); max-width: 720px; margin: 0; }

.kontextfeld {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}
.kontextfeld label span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.kontextzeile { margin: 10px 0 0; font-size: .85rem; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }

.statusmeldung { min-height: 24px; margin: 0 0 12px; font-weight: 700; color: var(--muted); }
.statusmeldung.ok { color: var(--green); }
.statusmeldung.warnung { color: var(--amber); }
.statusmeldung.fehler { color: var(--red); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(7, 27, 54, .05);
  padding: 20px;
  margin-bottom: 20px;
}
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.dezent { color: var(--muted); font-size: .85rem; margin-top: -6px; }

.import-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
label span { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
input, select {
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}
input[type="file"] { padding: 7px 10px; }
textarea {
  width: 100%; min-height: 80px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical;
}

button {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  background: var(--white);
  color: var(--navy);
}
button:hover, button:focus-visible { background: var(--aqua-soft); }
button.primaer { background: var(--brand-gradient); color: var(--white); border-color: var(--navy); }
button.primaer:hover, button.primaer:focus-visible { background: var(--brand-gradient); color: #9cf0e8; }
button.klein { padding: 6px 10px; font-size: .85rem; }
button.leise { border-color: transparent; background: transparent; color: var(--muted); font-weight: 700; }
button.leise:hover, button.leise:focus-visible { color: var(--navy); background: var(--aqua-soft); }
button.leise-gefahr { border-color: rgba(179, 58, 58, .35); background: var(--white); color: var(--red); }
button.leise-gefahr:hover, button.leise-gefahr:focus-visible { background: #fff0ee; }
.zweitrangig { background: var(--white); }

.knopfzeile { display: flex; gap: 10px; flex-wrap: wrap; }

.vorschau { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.vorschau:empty, .vorschau-fehler:empty { display: none; }
.kennzahl { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.kennzahl strong { display: block; font-size: 1.3rem; color: var(--navy); }
.kennzahl span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.vorschau-fehler { margin-top: 12px; border: 1px solid rgba(179, 58, 58, .3); border-left: 4px solid var(--red); border-radius: 8px; padding: 10px 14px; background: #fff0ee; color: var(--red); font-size: .85rem; }
.vorschau-fehler p { margin: 4px 0; }
/* Fehlerliste nach dem Speichern: übersprungene Zeilen zum Herunterladen */
.fehlerliste-block { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 8px; padding: 10px 14px; background: var(--white); }
.fehlerliste-block[hidden] { display: none; }
.fehlerliste-block p { margin: 0; flex: 1 1 320px; color: var(--ink); font-size: .9rem; overflow-wrap: anywhere; }

/* Auf- und einklappbare Bestandslisten mit Mengenangabe im Kopf */
details.bestand > summary.bestand-summary {
  display: flex;
  /* Schmale Bildschirme: Zaehler darf in die zweite Zeile rutschen,
     sonst ragen Zaehler und Pfeil rechts aus der Karte. */
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  list-style: none;
  min-height: 34px;
}
details.bestand > summary.bestand-summary::-webkit-details-marker { display: none; }
details.bestand > summary.bestand-summary::marker { content: ""; }
.bestand-summary h2 { margin: 0; }
.bestand-summary:hover h2, .bestand-summary:focus-visible h2 { color: var(--aqua-text); }
.bestand-anzahl {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--aqua-soft);
  color: var(--navy);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.klapp-anzeige {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-right: 2.5px solid var(--navy);
  border-bottom: 2.5px solid var(--navy);
  transform: rotate(45deg);
  transition: transform .16s ease;
}
details.bestand[open] .klapp-anzeige { transform: rotate(225deg); }
.bestand-inhalt { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bestand-aktionen { display: flex; justify-content: flex-end; margin-bottom: 10px; }

.filterzeile { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }

.tabellenrahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 2px solid var(--navy);
  padding: 8px 10px; white-space: nowrap; background: #fbfcfd;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.aktionen { white-space: nowrap; }
tr.inaktiv td { color: var(--muted); }
.status-pille {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; white-space: nowrap;
}
.status-pille.aktiv { background: #eaf7ef; color: var(--green); }
.status-pille.inaktiv { background: #eeeeee; color: var(--muted); }
.status-pille.gesperrt { background: #fff5dc; color: var(--amber); }
.status-pille.archiviert { background: #fff0ee; color: var(--red); }

.gefahrenzone { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.historie { display: grid; gap: 10px; margin-top: 10px; }
.historie article { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fbfcfd; }
.historie strong { color: var(--navy); }
.historie span, .historie p { display: block; margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.leer { color: var(--muted); font-size: .9rem; }

dialog {
  border: none; border-radius: 8px;
  box-shadow: 0 24px 70px rgba(7, 27, 54, .18);
  padding: 22px;
  width: min(640px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(7, 27, 54, .45); }
dialog h3 { margin-bottom: 12px; }
#einzel-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
#einzel-felder label.breit { grid-column: 1 / -1; }
#einzel-dialog label span { margin-top: 0; }
.dialog-knoepfe { justify-content: flex-end; margin-top: 16px; }

footer { padding: 28px 20px; text-align: center; color: #8295a7; background: #041328; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .kopf, .filterzeile { grid-template-columns: 1fr; }
  #einzel-felder { grid-template-columns: 1fr; }
  .app-header { display: block; }
  .brand img { margin-bottom: 12px; }
}

/* Hinweistext in Bestands-Panels (z. B. Datenschutz-Hinweis Mitarbeiter) */
.bestand-inhalt .hinweis { margin: 0 0 6px; color: var(--muted, #62706f); font-size: 14px; line-height: 1.5; }

/* Kontakte (Adressbuch), 09.09.2026 */
.verborgen { display: none !important; }
.bestand-aktionen { gap: 10px; flex-wrap: wrap; }
.kontakt-art {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--aqua-soft); color: var(--navy); font-size: .72rem; font-weight: 800; vertical-align: middle;
}
button.leise.gefahr { color: var(--red); }
button.leise.gefahr:hover, button.leise.gefahr:focus-visible { background: #fff0ee; color: var(--red); }
.vorschau-hinweis { margin-top: 12px; border: 1px solid rgba(176, 122, 0, .3); border-left: 4px solid var(--amber); border-radius: 8px; padding: 10px 14px; background: #fff8e6; color: var(--amber); font-size: .85rem; }
.vorschau-hinweis:empty { display: none; }
.vorschau-hinweis p { margin: 4px 0; }
.dialog-meldung { min-height: 20px; margin: 4px 0 0; font-size: .85rem; font-weight: 700; color: var(--amber); }
