/* XAssist – Farbwelt "Petrol hell, grünlich" (Mockup-Variante D-b) */
:root {
  --flaeche: #D5E2DF;
  --karte: #EDF4F2;
  --karte2: #C6D7D3;
  --rand: #AEC5C0;
  --topbar: #14454C;
  --topbar-text: #EAF5F4;
  /* Akzentfarbe zentral - Wechsel nur hier plus logo.svg (Klaus' Wahl vom
     31.07.2026: Pflaume; vorher Gold #C9982F / hell #F0C36A). */
  --akzent: #6F4A8C;
  --akzent-text: #FFFFFF;
  --akzent-hell: #C3A3DE;
  --zweit: #27756F;
  --warn: #A87C1D;
  --text: #21322F;
  --gedimmt: #547370;
  --ampel-gruen: #2F9E5E;
  --ampel-gelb: #F2C94C;   /* bewusst hell, klare Abgrenzung zu Rot (Klaus, 31.07.2026) */
  --ampel-blau: #3178C6;   /* heute fällig (Klaus' Wunsch, 31.07.2026) */
  --ampel-rot: #D64B4B;    /* nur noch überfällig */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  background: var(--flaeche);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--topbar);
  color: var(--topbar-text);
}
.topbar .logo { width: 34px; height: 34px; flex: none; }
.topbar .marke { font-weight: 600; font-size: 17px; letter-spacing: .3px; }
.topnav { display: flex; gap: 4px; margin-left: 22px; flex-wrap: wrap; }
.topnav > a, .topnav > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--topbar-text);
  opacity: .72;
  text-decoration: none;
  border: 1px solid transparent;
}
.topnav > a:hover { opacity: 1; }
.topnav .aktiv {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
  opacity: 1;
}
.topnav .bald { cursor: default; opacity: .38; }
.topbar .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.knopf-abmelden {
  background: transparent;
  color: var(--topbar-text);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.knopf-abmelden:hover { background: rgba(255,255,255,.12); }

/* ---------- Inhalt ---------- */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px; }

.kopfzeile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.kopfzeile h1 { font-size: 19px; font-weight: 600; }

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.kachel {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(20,69,76,.10);
}
.kachel .wert { font-size: 26px; font-weight: 700; }
.kachel .beschriftung { font-size: 13px; color: var(--gedimmt); margin-top: 2px; }
.kachel .zusatz { font-size: 12px; color: var(--zweit); margin-top: 6px; }

.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(20,69,76,.10);
  margin-bottom: 16px;
}
.karte h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.karte p { font-size: 13.5px; color: var(--gedimmt); line-height: 1.55; }
.karte ul { margin: 8px 0 0 18px; font-size: 13.5px; color: var(--gedimmt); line-height: 1.7; }

/* ---------- Formulare ---------- */
.feldzeile { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.feldzeile label { font-size: 13px; color: var(--gedimmt); }
input[type="text"], input[type="password"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 9px 12px;
  width: 100%;
  max-width: 360px;
}
input:focus { outline: 2px solid var(--zweit); outline-offset: 1px; }

.knopf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--akzent);
  color: var(--akzent-text);
  border: none;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

[data-icon] { display: inline-flex; align-items: center; }
.icon-akzent { color: var(--akzent); }

.kachel .kopf { display: flex; justify-content: space-between; align-items: flex-start; }
.kachel .kopf [data-icon] { color: var(--akzent); opacity: .85; }

.karte h2 { display: flex; align-items: center; gap: 8px; }
.karte h2 [data-icon] { color: var(--akzent); }

.kopfzeile [data-icon] { color: var(--akzent); }
.knopf:hover { filter: brightness(1.06); }

.hinweis-fehler { color: var(--ampel-rot); font-size: 13px; margin-top: 8px; min-height: 18px; }
.hinweis-ok { color: var(--ampel-gruen); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- Anmeldeseiten ---------- */
.anmelde-buehne {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.anmelde-karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(20,69,76,.16);
  padding: 30px 34px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.anmelde-karte .logo { width: 64px; height: 64px; margin-bottom: 10px; }
.anmelde-karte h1 { font-size: 20px; margin-bottom: 4px; }
.anmelde-karte .unterzeile { font-size: 13px; color: var(--gedimmt); margin-bottom: 18px; }
.anmelde-karte input { max-width: none; text-align: center; }
.anmelde-karte .knopf { width: 100%; margin-top: 6px; }

/* ---------- Fußzeile: festes Akzentband am unteren Fensterrand ---------- */
:root { --fusszeile-hoehe: 42px; }

body { padding-bottom: var(--fusszeile-hoehe); }

.fusszeile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fusszeile-hoehe);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--akzent);
  color: #F5F0FA;
  font-size: 12.5px;
  letter-spacing: .3px;
  padding: 0 20px;
  z-index: 60;
  box-shadow: 0 -2px 8px rgba(20,69,76,.18);
}

/* ---------- Tabellen (Regeln: Zellen oben, Kopf sticky) ---------- */
:root { --topbar-hoehe: 54px; --filterleiste-hoehe: 56px; }

.filterleiste {
  position: sticky;
  top: var(--topbar-hoehe);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--flaeche);
  padding: 10px 0;
  margin-bottom: 8px;
}
.filterleiste input[type="text"] { max-width: 240px; }
.filterleiste select {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 8px 10px;
}
.filterleiste .zaehler { font-size: 12.5px; color: var(--gedimmt); margin-left: auto; }

/* WICHTIG: kein overflow:hidden und kein border-collapse:collapse an dieser
   Tabelle - beides bricht die sticky-Kopfzeile (der Kopf schiebt sich sonst
   über die erste Datenzeile). */
table.liste {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 12px;
}
table.liste thead th:first-child { border-top-left-radius: 12px; }
table.liste thead th:last-child { border-top-right-radius: 12px; }
table.liste tr:last-child td:first-child { border-bottom-left-radius: 12px; }
table.liste tr:last-child td:last-child { border-bottom-right-radius: 12px; }
table.liste th {
  position: sticky;
  top: calc(var(--topbar-hoehe) + var(--filterleiste-hoehe));
  z-index: 10;
  background: var(--karte2);
  text-align: left;
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rand);
}
table.liste td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rand);
  vertical-align: top;
}
table.liste tr:last-child td { border-bottom: none; }
table.liste tr.erledigt td { color: var(--gedimmt); }
table.liste tr.erledigt td.titel-zelle { text-decoration: line-through; }

.wichtig-stern { color: var(--akzent); font-size: 15px; }

.ampel {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.28);
  vertical-align: -1px;
}
.ampel.rot   { background: var(--ampel-rot); }
.ampel.gelb  { background: var(--ampel-gelb); }
.ampel.blau  { background: var(--ampel-blau); }
.ampel.gruen { background: var(--ampel-gruen); }
.ampel.grau  { background: var(--karte2); }

.heute-faellig { color: var(--ampel-blau); font-weight: 600; }
.tag-marke {
  display: inline-block;
  background: var(--karte2);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  color: var(--zweit);
  margin: 0 3px 2px 0;
  white-space: nowrap;
}
.gedimmt { color: var(--gedimmt); font-size: 12.5px; }
.ueberfaellig { color: var(--ampel-rot); font-weight: 600; }

/* ---------- Zeilenmenü ---------- */
.zeilenmenue-knopf {
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.zeilenmenue-knopf:hover { background: var(--karte2); }
.zeilenmenue {
  position: fixed;
  z-index: 100;
  background: #FFFFFF;
  border: 1px solid var(--rand);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(20,69,76,.22);
  min-width: 180px;
  padding: 5px;
  display: none;
}
.zeilenmenue button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.zeilenmenue button:hover { background: var(--karte); }
.zeilenmenue button.gefaehrlich { color: var(--ampel-rot); }
.zeilenmenue .trenner { border-top: 1px solid var(--rand); margin: 4px 6px; }

/* ---------- Bestätigungsdialog ---------- */
.dialog-schleier {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20,69,76,.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog-karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(20,69,76,.3);
  padding: 22px 24px;
  max-width: 420px;
  width: 100%;
}
.dialog-karte h3 { font-size: 15.5px; margin-bottom: 8px; }
.dialog-karte p { font-size: 13.5px; color: var(--gedimmt); margin-bottom: 16px; }
.dialog-knoepfe { display: flex; gap: 10px; justify-content: flex-end; }
.knopf-zweitrangig {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.knopf-zweitrangig:hover { background: var(--karte2); }
.knopf.gefaehrlich { background: var(--ampel-rot); }

/* ---------- Statusmeldung ---------- */
.statusmeldung {
  position: fixed;
  bottom: calc(var(--fusszeile-hoehe) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: var(--topbar);
  color: var(--topbar-text);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(20,69,76,.3);
  display: none;
}
.statusmeldung a { color: var(--akzent-hell); }

/* ---------- Schnellerfassung ---------- */
.schnellerfassung { display: flex; gap: 10px; margin-bottom: 18px; }
.schnellerfassung input { max-width: none; flex: 1; }

/* ---------- Formularraster ---------- */
.formular-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 16px;
}
.formular-raster .feldzeile { margin-bottom: 0; }
.formular-raster input, .formular-raster select, .formular-raster textarea {
  max-width: none;
  width: 100%;
}
.formular-raster textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 9px 12px;
  resize: vertical;
  min-height: 38px;
}
.formular-raster select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 9px 10px;
}
.feld-breit { grid-column: 1 / -1; }
.formular-fuss { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.kontroll-zeile { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.kontroll-zeile input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--akzent); }

@media (max-width: 700px) {
  .filterleiste { position: static; }
  table.liste th { position: static; }
}
