/* ToDo-Liste vph - Neubau 2026. Farben: Igepa-Hausgruen #007858. */

:root {
  --gruen: #007858;
  --gruen-dunkel: #005c43;
  --gruen-hell: #d4efdb;
  --gruen-blass: #eef8f1;
  --text: #1d2a24;
  --leise: #5b6b63;
  --rand: #c9ddd0;
  --rot: #b3261e;
  --rot-blass: #fdecea;
  --gelb: #8a6400;
  --gelb-blass: #fff6d6;
  --orange: #7a3300;
  --orange-blass: #ffc98a;
  --flaeche: #ffffff;
  --grund: #f4f7f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--text); background: var(--grund);
}

a { color: var(--gruen-dunkel); }

/* Kopf mit Menue */
.kopf { background: var(--gruen); color: #fff; }
.kopf-innen {
  max-width: 80rem; margin: 0 auto; padding: .55rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
}
.marke { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.marke span { font-weight: 400; opacity: .8; }
.menue { display: flex; flex-wrap: wrap; gap: .15rem .3rem; flex: 1; }
.menue a {
  color: #fff; text-decoration: none; padding: .3rem .6rem; border-radius: .35rem; white-space: nowrap;
}
.menue a:hover { background: rgba(255, 255, 255, .15); }
.menue a[aria-current="page"] { background: #fff; color: var(--gruen-dunkel); font-weight: 600; }
.wer { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.wer a { color: #fff; }
.wer form { margin: 0; }

main { max-width: 80rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .25rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }

.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: .6rem;
  padding: 1rem 1.1rem; margin: 0 0 1rem;
}
.karte.schmal { max-width: 28rem; margin-left: auto; margin-right: auto; }
.karte.schmal-links { max-width: 34rem; }
.spalten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin-bottom: 1rem; }
.spalten > .karte { margin: 0; }

/* Kacheln der Startseite */
.kacheln { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); margin-bottom: 1rem; }
.kachel {
  display: block; padding: 1.1rem 1rem; background: var(--flaeche); border: 1px solid var(--rand);
  border-left: 5px solid var(--gruen); border-radius: .55rem; text-decoration: none;
  color: var(--text); font-weight: 600; font-size: 1.05rem;
}
.kachel:hover { background: var(--gruen-blass); }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid #e3ece6; vertical-align: top; }
.tabelle thead th { font-size: .85rem; color: var(--leise); text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--rand); }
.tabelle tr.aus td { color: var(--leise); }
.tabelle.rechte select { min-width: 8rem; }
.tabelle.rechte tbody th { font-weight: 600; }
.karte:has(> .tabelle), .karte:has(> form > .tabelle) { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.feldwert { font-size: .9rem; }

.stand {
  display: inline-block; font-size: .8rem; padding: .05rem .45rem; border-radius: 1rem;
  background: var(--gruen-blass); color: var(--gruen-dunkel); font-weight: 600; white-space: nowrap;
}
.stand.zu { background: #eceeed; color: var(--leise); }
.stand.bald { background: var(--gelb-blass); color: var(--gelb); }
.stand.ueber { background: var(--rot-blass); color: var(--rot); }

/* Formulare */
.formular { display: grid; gap: .7rem; }
.formular label { display: grid; gap: .25rem; font-weight: 600; }
.formular label.haken { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; padding: .45rem .6rem; border: 1px solid #a9c1b3; border-radius: .4rem; background: #fff; color: var(--text);
}
.formular input:not([type="checkbox"]):not([type="radio"]), .formular select, .formular textarea { width: 100%; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 3px solid #f2b705; outline-offset: 2px;
}
button {
  font: inherit; font-weight: 600; cursor: pointer; padding: .5rem 1.05rem; border-radius: .4rem;
  border: 1px solid var(--gruen); background: var(--gruen); color: #fff; justify-self: start;
}
button:hover { background: var(--gruen-dunkel); }
button.zweitrangig { background: #fff; color: var(--gruen-dunkel); }
button.zweitrangig:hover { background: var(--gruen-blass); }
button.gefahr { background: var(--rot); border-color: var(--rot); }
button.klein { padding: .2rem .6rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; font-weight: 400; text-decoration: underline; color: var(--gruen-dunkel); }
button.link.hell { color: #fff; }

.leiste { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; margin: 0 0 1rem; }
.leiste label { display: grid; gap: .2rem; font-size: .9rem; font-weight: 600; }
.standortwahl { display: inline-flex; align-items: end; gap: .5rem; margin: 0 0 1rem; }
.standortwahl label { display: grid; gap: .2rem; font-size: .9rem; font-weight: 600; }

.leise { color: var(--leise); font-weight: 400; font-size: .9em; }

/* Meldungen */
.meldung { padding: .7rem .9rem; border-radius: .5rem; margin: 0 0 1rem; border: 1px solid; }
.meldung.ok { background: var(--gruen-blass); border-color: #9fd0b0; }
.meldung.fehler { background: var(--rot-blass); border-color: #e5b7b3; color: #6d1712; }
.meldung.hinweis { background: var(--gelb-blass); border-color: #ecd98a; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em;
  background: #fff; padding: .05rem .45rem; border-radius: .3rem; border: 1px dashed var(--gruen); }

.blaettern { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1rem 0; }

.fuss { text-align: center; color: var(--leise); font-size: .85rem; padding: 1.5rem 1rem 2rem; }

@media (max-width: 40rem) {
  .kopf-innen { gap: .4rem .8rem; }
  .menue { order: 3; flex-basis: 100%; }
  main { padding: .75rem; }
  h1 { font-size: 1.3rem; }
}

/* Reiter (Fahrer / Lager) und Knoepfe als Verweis */
.reiter { display: flex; gap: .25rem; margin: 0 0 1rem; border-bottom: 2px solid var(--rand); }
.reiter a {
  padding: .45rem 1rem; text-decoration: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: .45rem .45rem 0 0; margin-bottom: -2px; color: var(--gruen-dunkel); font-weight: 600;
}
.reiter a[aria-current="page"] { background: var(--flaeche); border-color: var(--rand); border-bottom: 2px solid var(--flaeche); }
a.knopf {
  display: inline-block; font-weight: 600; padding: .5rem 1.05rem; border-radius: .4rem; text-decoration: none;
  border: 1px solid var(--gruen); background: var(--gruen); color: #fff;
}
a.knopf:hover { background: var(--gruen-dunkel); }
a.knopf.zweitrangig { background: #fff; color: var(--gruen-dunkel); }
a.knopf.zweitrangig:hover { background: var(--gruen-blass); }
.leiste .standortwahl { margin: 0; }

/* Fristen mit Ampel */
td.datum { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.datum.leer { color: var(--leise); }
.ampel-ueber { background: var(--rot); color: #fff; font-weight: 700; }
.ampel-rot { background: var(--rot-blass); color: var(--rot); font-weight: 700; }
.ampel-gelb { background: var(--orange-blass); color: var(--orange); font-weight: 600; }   /* „laeuft in Kuerze ab“: orange wie im Altbestand */
.legende span { display: inline-block; padding: .05rem .5rem; border-radius: .3rem; margin-right: .35rem; }
.tabelle.fristen td, .tabelle.fristen th { padding: .4rem .45rem; }

/* Formular in Spalten */
.raster { display: grid; gap: .7rem 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); align-items: end; }
.formular h2 { margin: .6rem 0 0; }
.formular h2:first-of-type { margin-top: 0; }
.gefahrzone { border-color: #e5b7b3; }
.leiste input[type="text"] { min-width: 14rem; }

/* Ampel als Marke neben einem Feld (Geraet, Ersthelfer, Sicherheitsausruestung) */
.ampelmarke { display: inline-block; padding: .05rem .45rem; border-radius: .3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mitampel { display: grid; gap: .25rem; align-content: end; }
.mitampel .ampelmarke { justify-self: start; font-size: .85rem; }
details > summary { cursor: pointer; color: var(--gruen-dunkel); font-weight: 600; margin: .5rem 0; }
.leiste label.haken { display: flex; align-items: center; gap: .4rem; font-weight: 400; }

/* Sortierbare Spalten */
th.sortierbar { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortierbar::after { content: " ⇅"; opacity: .35; font-size: .8em; }
th.sortierbar[aria-sort="ascending"]::after { content: " ▲"; opacity: .8; }
th.sortierbar[aria-sort="descending"]::after { content: " ▼"; opacity: .8; }
th.sortierbar:hover { color: var(--gruen-dunkel); }

/* Suche im Kopf */
.kopfsuche { margin: 0; }
.kopfsuche input { width: 11rem; padding: .3rem .55rem; border: 0; border-radius: .35rem; font-size: .9rem; }
@media (max-width: 40rem) { .kopfsuche { order: 4; flex-basis: 100%; } .kopfsuche input { width: 100%; } }
