:root {
  color-scheme: light;
  --grund: #f7f8f7;
  --flaeche: #ffffff;
  --rand: #e3e6e3;
  --text: #1d2420;
  --leise: #5f6b64;
  /*
   * ══════════════════════════════════════════════════════════════════════
   * DAS MARKENGRUEN -- AUS DEM MASTER GELESEN, NICHT GESCHAETZT
   * ══════════════════════════════════════════════════════════════════════
   *
   * #97CA41 ist der Wert, der in nora-HR-Master.jpg in der Wortmarke
   * „nora" steht. Er ist als FLAECHE gedacht und nicht als Schrift: auf
   * Weiss hat er ein Kontrastverhaeltnis von 1,94 -- als Textfarbe waere
   * er unlesbar. Mit dunkler Schrift darauf sind es 8,18, und damit ist er
   * genau das Richtige fuer die eine Primaeraktion einer Seite.
   *
   * --akzent ist DIESELBE Farbe, nur dunkler (gleicher Farbton 82°,
   * gleiche Saettigung, Helligkeit 52 % → 28 %). Keine zweite Marke,
   * keine erfundene Farbe -- ein lesbarer Ton derselben: 5,68 auf Weiss,
   * 5,34 auf der Grundflaeche. Er traegt Verweise und den aktiven
   * Navigationszustand.
   *
   * Das Grau der Marke (#C6C9CA) bleibt der Marke. Fuer sekundaere Schrift
   * waere es zu hell -- --leise bleibt, was es ist.
   */
  --marke: #97CA41;
  --akzent: #52701f;
  --akzent-leise: #eef6df;
  --warnung: #8a5a1b;
  --warnung-leise: #fdf5e7;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Kopf und Navigation ─────────────────────────────────────────────── */
.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky; top: 0; z-index: 10;
}
.kopf-innen {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  min-height: 64px;
}
/* Die Wortmarke. Kompakt gehalten: sie soll den Kopf nicht hoeher machen
   und die Navigation nicht nach rechts draengen. 44 px Hoehe, Breite folgt
   dem Seitenverhaeltnis des Masters -- nie verzerrt. */
.marke { display: flex; align-items: center; flex: 0 0 auto; }
.marke img { height: 44px; width: auto; display: block; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: var(--radius); color: var(--leise);
  font-size: .94rem; font-weight: 500;
}
.nav a:hover { background: var(--grund); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--akzent-leise); color: var(--akzent); }
.wer { display: flex; align-items: center; gap: 12px; font-size: .86rem; color: var(--leise); }
.wer form { margin: 0; }
.knopf-leise {
  background: none; border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 6px 12px; font: inherit; font-size: .86rem; color: var(--leise); cursor: pointer;
}
.knopf-leise:hover { background: var(--grund); }

/* ── Rumpf ───────────────────────────────────────────────────────────── */
main { max-width: 1080px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: .95rem; font-weight: 600; margin: 0 0 8px; }
.unterzeile { color: var(--leise); margin: 0 0 28px; }

.karten { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.karte {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 20px;
}
.karte.leise { background: transparent; border-style: dashed; }
.kennzahl { font-size: 2rem; font-weight: 600; line-height: 1.2; }
.kennzahl.achtung { color: var(--warnung); }
.kennzahl-text { color: var(--leise); font-size: .88rem; }

.liste { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.zeile {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.zeile .haupt { flex: 1; min-width: 200px; }
.zeile .titel { font-weight: 600; }
.zeile .beiwerk { color: var(--leise); font-size: .88rem; }

.marke-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 500; background: var(--akzent-leise); color: var(--akzent);
}
.marke-chip.warnung { background: var(--warnung-leise); color: var(--warnung); }
.marke-chip.neutral { background: var(--grund); color: var(--leise); }

/* ── Leerzustand -- der haeufigste Zustand in V1 ─────────────────────── */
.leer {
  background: var(--flaeche); border: 1px dashed var(--rand); border-radius: var(--radius);
  padding: 40px 28px; text-align: center; color: var(--leise);
}
.leer .gross { color: var(--text); font-weight: 600; margin-bottom: 6px; }
.leer p { margin: 6px auto 0; max-width: 52ch; }

/* ── Aktionen ────────────────────────────────────────────────────────── */
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
/*
 * DREI STUFEN, UND JEDE SAGT ETWAS ANDERES.
 *
 *   .aktion         die EINE Primaeraktion -- gefuellt im Markengruen,
 *                   dunkle Schrift darauf (8,18). Je Seite oder je
 *                   Formular hoechstens eine.
 *   .aktion.leise   eine Nebenaktion -- Umriss, ruhig. „Profil oeffnen",
 *                   „Bearbeiten".
 *   .knopf-leise    eine Randhandlung -- klein und zurueckhaltend.
 *                   „Abbrechen", „Beenden", „Filter zuruecksetzen".
 *
 * KEIN ROTER KNOPF. Es gibt in dieser Oberflaeche keine zerstoerende
 * Handlung -- kein Hard Delete, nicht einmal in der Datenbankrolle. Rot
 * anzubieten, wo nichts zerstoert wird, waere eine Warnung ohne Gefahr;
 * beim naechsten Mal glaubt sie niemand.
 */
.aktion {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--marke); background: var(--marke);
  font-size: .9rem; font-weight: 600; color: var(--text); cursor: pointer;
}
.aktion:hover { background: #8cbf35; border-color: #8cbf35; text-decoration: none; }
.aktion.leise, .aktion.haupt.leise {
  background: var(--flaeche); border-color: var(--rand);
  color: var(--text); font-weight: 500;
}
.aktion.leise:hover { background: var(--grund); border-color: var(--rand); }
.aktion.haupt { background: var(--marke); border-color: var(--marke); color: var(--text); }
.aktion[aria-disabled="true"] {
  color: #9aa39d; background: var(--grund); cursor: not-allowed; border-style: dashed;
}

/* ── Unternavigation der Personalakte ────────────────────────────────── */
.unternav {
  display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--rand);
  margin: 24px 0 24px;
}
.unternav a {
  padding: 10px 14px; font-size: .9rem; color: var(--leise); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.unternav a:hover { color: var(--text); text-decoration: none; }
.unternav a[aria-current="page"] { color: var(--akzent); border-bottom-color: var(--akzent); }

/* ── Hinweisfeld ─────────────────────────────────────────────────────── */
.hinweis {
  background: var(--akzent-leise); border: 1px solid #d6e5dc;
  border-radius: var(--radius); padding: 16px 20px; color: var(--text);
  font-size: .92rem;
}
.hinweis.warnung { background: var(--warnung-leise); border-color: #f0e0c2; }
.hinweis strong { font-weight: 600; }

dl.felder { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
dl.felder dt { color: var(--leise); font-size: .88rem; }
dl.felder dd { margin: 0; }

/* ── Der Mensch in der Organisation (0011) ──────────────────────────────
   Eine Karte je Mensch, darin zwei getrennte Gruppen: Beschaeftigung und
   organisatorische Stellung. Die Trennung ist nicht Gestaltung, sondern die
   Aussage des Modells -- wer beides untereinander ohne Ueberschrift setzt,
   macht aus zwei Sachverhalten optisch einen. */
.personen { display: grid; gap: 16px; }
.person h2 { font-size: 1.05rem; margin: 0 0 2px; }
.person .beiwerk { color: var(--leise); font-size: .88rem; margin: 0; }
.person h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--leise); font-weight: 600; margin: 18px 0 8px;
}
.person .quelle { color: var(--leise); font-size: .82rem; }
.person dl.felder dd { display: grid; gap: 4px; }

/* ── Mitarbeiterverwaltung: Kopf, Filter, Karten, Reiter ────────────────
   Ruhige Flaechen, flache Hierarchie, EINE Primaeraktion je Bereich. Die
   Ordnung kommt aus Abstand und Ueberschrift, nicht aus Linien und Farbe. */
.seitenkopf {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 20px;
}
.seitenkopf h1 { margin: 0 0 4px; }
.seitenkopf .unterzeile { margin: 0; }

.filterleiste {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px;
}
.filterleiste label { display: grid; gap: 4px; font-size: .82rem; color: var(--leise); }
.filterleiste input, .filterleiste select {
  font: inherit; padding: 7px 10px; border: 1px solid var(--rand);
  border-radius: var(--radius); background: var(--grund); color: var(--text); min-width: 160px;
}

.karten.personen { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.person-karte { display: flex; flex-direction: column; gap: 10px; }
/* Kopf der Karte: rundes Bild links, Name und Taetigkeit daneben. Das Bild
   schrumpft nicht, der Name bricht um -- auch auf schmalen Displays. */
.person-karte .kartenkopf { display: flex; gap: 12px; align-items: center; }
.person-karte .kartenname { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-karte h2 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.person-karte h2 a { color: var(--text); }
.person-karte .funktion { color: var(--leise); font-size: .9rem; margin: 0; }
.person-karte .aktion { margin-top: auto; align-self: flex-start; }
.person-karte .marke-chip { align-self: flex-start; }
.funktion.leer { font-style: italic; }

/* Der Bereichskopf im Profil -- Ueberschrift links, Hauptaktion rechts.
   Auf schmalen Displays bricht der Knopf darunter und nimmt die volle
   Breite: eine Hauptaktion, die man suchen muss, ist keine. */
.seitenkopf.bereichskopf { align-items: center; margin: 0 0 16px; }
.seitenkopf.bereichskopf h2 { margin: 0; }
h3.bereich {
  font-size: .95rem; font-weight: 600; margin: 28px 0 10px; color: var(--text);
}

.firmen { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.firmen li { font-size: .88rem; }
.zugang { margin: 0; font-size: .82rem; color: var(--leise); }
.zugang .ja::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: var(--marke); margin-right: 6px; vertical-align: middle;
}
.zugang .nein { color: var(--leise); }

/* Der Profilkopf eines Menschen -- Name, Funktion, Gesellschaften, eine Aktion. */
.profilkopf-person {
  display: flex; gap: 20px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 16px;
}
.profilkopf-person .angaben { flex: 1; min-width: 220px; }
.profilkopf-person h1 { margin: 0 0 2px; }
.profilkopf-person .funktion { color: var(--leise); margin: 0 0 8px; }

/* Flache Navigation im Profil. Vier Adressen, kein Baum. */
.reiter { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 24px; border-bottom: 1px solid var(--rand); }
.reiter a {
  padding: 10px 16px; color: var(--leise); font-weight: 500; font-size: .94rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.reiter a:hover { color: var(--text); }
.reiter a[aria-current="page"] { color: var(--akzent); border-bottom-color: var(--akzent); }

/* ── VIEW FIRST, EDIT ON DEMAND ──────────────────────────────────────────
 *
 * Der Stift steht am rechten Ende der Bereichsleiste -- derselbe Ort und
 * dasselbe Zeichen wie in HOMEBASE. Fingergroesse, nicht Zeigergroesse.
 * Der aktive Modus ist am Stift ablesbar, wird aber nicht allein von ihm
 * getragen: die beschriftete Leiste darunter sagt es in Worten.
 */
.reiter .stift {
  margin-left: auto; align-self: center; margin-bottom: 4px;
  min-width: 40px; min-height: 40px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px;
  font-size: 1.15rem; line-height: 1; color: var(--leise);
}
.reiter .stift:hover { color: var(--text); background: var(--akzent-leise); }
.reiter .stift:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.reiter .stift.an { color: var(--akzent); border-color: var(--akzent); background: var(--akzent-leise); }

.modusleiste {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: -12px 0 20px; padding: 10px 14px;
  border: 1px solid var(--akzent); border-radius: 10px; background: var(--akzent-leise);
}
.modusleiste .moduslabel { font-weight: 600; }
.modusleiste .modushinweis { flex: 1 1 14rem; color: var(--leise); font-size: .84rem; }
.modusleiste .aktion { margin-left: auto; }
.bericht {
  margin: -8px 0 16px; padding: 8px 12px; border-radius: 8px;
  background: var(--akzent-leise); color: var(--akzent); font-size: .88rem;
}
.karte.in-bearbeitung { border-color: var(--akzent); }
.liste .zeile.dokpflege { display: block; padding-top: 0; }
.liste .zeile.dokpflege .nachtrag { margin: 4px 0; }

.karten.zweispaltig { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.karte h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--leise); font-weight: 600; margin: 0 0 12px;
}
.karte .block + .block { margin-top: 14px; }
.blocktitel { font-weight: 600; margin: 0 0 4px; font-size: .92rem; }
.karte .gross { font-size: 1.02rem; margin: 0 0 4px; }
.karte .quelle { color: var(--leise); font-size: .82rem; margin: 0; }

.beziehungen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.beziehungen li {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--rand);
}
.beziehungen li:last-child { border-bottom: none; padding-bottom: 0; }
.beziehungen .quelle { flex: 1; }

/* Pflegeformulare -- ueberall dieselbe Form. */
.pflegeform { display: grid; gap: 14px; max-width: 560px; margin-top: 12px; }
.pflegeform label { display: grid; gap: 6px; font-size: .88rem; color: var(--leise); }
.pflegeform input[type="text"], .pflegeform input[type="search"],
.pflegeform select, .pflegeform input[type="file"] {
  font: inherit; padding: 8px 10px; border: 1px solid var(--rand);
  border-radius: var(--radius); background: var(--grund); color: var(--text); max-width: 100%;
}
.pflegeform button { justify-self: start; }
.pflegeform .hinweis-klein { color: var(--leise); font-size: .82rem; margin: 0; }
.feldpaar { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.aktionen { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inlineform { display: inline; }
details.nachtrag > summary { cursor: pointer; color: var(--leise); font-size: .88rem; }
details.nachtrag[open] > summary { margin-bottom: 4px; }

/* Der Anlegeweg -- drei Schritte, sichtbar. */
.schritte { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; }
.schritte li {
  display: flex; gap: 8px; align-items: center; color: var(--leise);
  font-size: .88rem; padding: 8px 14px; border: 1px solid var(--rand);
  border-radius: var(--radius); background: var(--flaeche);
}
.schritte .zahl {
  display: inline-flex; width: 20px; height: 20px; border-radius: 999px;
  align-items: center; justify-content: center; font-size: .74rem;
  background: var(--grund); border: 1px solid var(--rand);
}
.schritte li.hier { color: var(--text); border-color: var(--akzent); }
.schritte li.hier .zahl { background: var(--akzent-leise); color: var(--akzent); border-color: transparent; }
.schritte li.erledigt .zahl { background: var(--akzent-leise); color: var(--akzent); border-color: transparent; }

/* Der Verlauf -- eine Spalte Datum, eine Spalte Satz. */
.verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.verlauf li {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--rand);
}
.verlauf li:last-child { border-bottom: none; }
.verlauf .am { color: var(--leise); font-size: .88rem; font-variant-numeric: tabular-nums; }

/* ── Die Unterlagen einer Akte (0012) ───────────────────────────────────
   Die Einrueckung einer Anlage zeigt eine gespeicherte Beziehung und keine
   Vermutung -- deshalb darf sie deutlich sein. */
.liste.dokumente .zeile.anlage { margin-left: 28px; background: transparent; border-style: dashed; }
.dokumentform { display: grid; gap: 14px; margin-top: 16px; max-width: 560px; }
.dokumentform label { display: grid; gap: 6px; font-size: .88rem; color: var(--leise); }
.dokumentform input[type="text"], .dokumentform select, .dokumentform input[type="file"] {
  font: inherit; padding: 8px 10px; border: 1px solid var(--rand);
  border-radius: var(--radius); background: var(--grund); color: var(--text); max-width: 100%;
}
.dokumentform button { justify-self: start; }
.dokumentform .hinweis-klein { color: var(--leise); font-size: .82rem; margin: 0; }
details.karte summary { cursor: pointer; }

.fuss {
  max-width: 1080px; margin: 0 auto; padding: 24px 20px 48px;
  color: var(--leise); font-size: .82rem; border-top: 1px solid var(--rand);
}

/* ── Das Gesicht eines KI-Kollegen ───────────────────────────────────────
 *
 * Zwei Groessen, ein Bauteil. In der Liste gross genug, um jemanden
 * wiederzuerkennen, und klein genug, dass die Uebersicht ruhig bleibt; im
 * Profilkopf so gross, dass es wirklich ein Portraet ist und kein Symbol.
 *
 * object-fit: cover heisst: hochgeladene Bilder werden nie verzerrt.
 * Lieber ein Ausschnitt als ein in die Laenge gezogenes Gesicht.
 */
.portraet {
  flex: none; border-radius: 50%; overflow: hidden;
  background: var(--akzent-leise); border: 1px solid var(--rand);
  display: grid; place-items: center;
}
.portraet img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portraet.klein { width: 56px; height: 56px; }
.portraet.gross { width: 128px; height: 128px; }
/* Im Kopf eines Mitarbeiterprofils: erkennbar, aber kein Plakat (0014). */
.portraet.mittel { width: 88px; height: 88px; }

/* Der Ersatz: Initialen, ruhig gesetzt. Kein zerbrochenes Bildsymbol und
   keine fremde Silhouette, die so tut, als waere da ein Foto. */
.portraet .initialen {
  font-weight: 600; color: var(--akzent); letter-spacing: .02em; user-select: none;
}
.portraet.klein .initialen { font-size: 1.05rem; }
.portraet.gross .initialen { font-size: 2.4rem; }
.portraet.mittel .initialen { font-size: 1.7rem; }

.profilkopf { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.profilkopf .angaben { flex: 1; min-width: 240px; }
.profilkopf h1 { margin: 0 0 4px; }
.profilkopf .rolle { color: var(--leise); margin: 0 0 8px; }
.profilkopf .herkunft { color: var(--leise); font-size: .88rem; margin: 0; }

/* Die Bildverwaltung -- sichtbar, aber nicht laut. */
.bildpflege { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.bildpflege input[type="file"] { font: inherit; font-size: .88rem; max-width: 100%; }
.bildpflege .hinweis-klein { color: var(--leise); font-size: .82rem; }

/* ── Klein und mobil ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .portraet.gross { width: 96px; height: 96px; }
  .portraet.gross .initialen { font-size: 1.8rem; }
  .profilkopf { gap: 16px; }
  .kopf-innen { padding: 10px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; }
  .nav a { padding: 8px 10px; }
  main { padding: 24px 16px 48px; }
  h1 { font-size: 1.35rem; }
  .zeile { padding: 14px 16px; }
  dl.felder { grid-template-columns: 1fr; gap: 2px 0; }
  dl.felder dd { margin-bottom: 10px; }
  .feldpaar { grid-template-columns: 1fr; }
  .verlauf li { grid-template-columns: 1fr; gap: 2px; }
  .filterleiste { flex-direction: column; align-items: stretch; }
  .filterleiste input, .filterleiste select { min-width: 0; width: 100%; }
  .karten.personen, .karten.zweispaltig { grid-template-columns: 1fr; }
  .seitenkopf.bereichskopf .aktion { width: 100%; text-align: center; }
  .modusleiste { margin-top: 0; }
  .modusleiste .aktion { margin-left: 0; width: 100%; text-align: center; }
}