/* Verwaltungsportal Sta. Christiana Frohsdorf
   Farben als Variablen: hier zentral an das Erscheinungsbild von stachristiana.at anpassbar. */
:root {
  --primaer: #8a1c2b;        /* Akzentfarbe (Bordeaux) */
  --primaer-dunkel: #6c1421;
  --primaer-hell: #f6e9eb;
  --text: #1f2328;
  --text-leise: #5b6470;
  --rand: #d5d9de;
  --flaeche: #ffffff;
  --hintergrund: #f4f5f7;
  --fehler: #b3261e;
  --fehler-hell: #fdecea;
  --warnung: #8a5a00;
  --warnung-hell: #fff4d6;
  --ok: #1e6b3a;
  --ok-hell: #e6f4ea;
  --info-hell: #eaf1fb;
  --radius: 10px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--schrift); font-size: 17px; line-height: 1.5; color: var(--text); background: var(--hintergrund); }
a { color: var(--primaer); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; line-height: 1.25; }
[hidden] { display: none !important; }

/* Kopf und Fuss */
.kopf { background: var(--primaer); color: #fff; }
.kopf-innen, .fuss-innen { max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
.marke { color: #fff; text-decoration: none; display: flex; flex-direction: column; }
.marke-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.marke-sub { font-size: .8rem; opacity: .85; }
.fuss { color: var(--text-leise); font-size: .85rem; }
.inhalt { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }

/* Karten */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 20px; }
.karte.schmal { max-width: 640px; margin: 0 auto; }
.kopfzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* Wizard: Schrittleiste links (Bildschirm) bzw. oben (Handy) */
.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.schritte { position: sticky; top: 16px; }
.schritte ol { list-style: none; margin: 0; padding: 0; }
.schritte li { padding: 8px 10px; border-radius: 8px; color: var(--text-leise); font-size: .95rem; }
.schritte li a { color: inherit; text-decoration: none; display: block; }
.schritte li.aktiv { background: var(--primaer-hell); color: var(--primaer-dunkel); font-weight: 600; }
.schritte li.erledigt { color: var(--text); }
.schritte .nr { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1px solid currentColor; font-size: .8rem; margin-right: 6px; }
.schritte li.erledigt .nr { background: var(--ok); border-color: var(--ok); color: #fff; }
.schritte small { color: var(--text-leise); font-weight: 400; }
.fortschritt, .schritt-mobil { display: none; }
.zur-uebersicht { font-size: .9rem; margin-top: 12px; }

@media (max-width: 800px) {
  body { font-size: 16px; }
  .wizard { grid-template-columns: 1fr; gap: 12px; }
  .schritte { position: static; }
  .schritte ol { display: none; }
  .fortschritt { display: block; height: 6px; background: var(--rand); border-radius: 3px; overflow: hidden; }
  .fortschritt span { display: block; height: 100%; background: var(--primaer); }
  .schritt-mobil { display: block; margin: 8px 0 0; font-size: .95rem; }
  .karte { padding: 16px; }
  .zur-uebersicht { margin: 4px 0 0; }
}

/* Formular */
fieldset { border: 0; border-top: 1px solid var(--rand); margin: 20px 0 0; padding: 16px 0 0; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 0 6px; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.raster .breit { grid-column: 1 / -1; }
@media (max-width: 600px) { .raster { grid-template-columns: 1fr; } }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld.klein input { max-width: 10rem; }
label, .label { font-weight: 600; font-size: .95rem; }
.pflicht { color: var(--fehler); }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--rand); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--primaer-hell); border-color: var(--primaer); }
input:disabled { background: var(--hintergrund); color: var(--text-leise); }
.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--fehler); }
.hilfe { color: var(--text-leise); font-size: .88rem; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0; accent-color: var(--primaer); }
.auswahl-reihe { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.svnr { display: grid; grid-template-columns: 6rem 8rem; gap: 8px; }
.unterfeld { margin-top: 8px; }

/* Meldungen */
.meldung { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: .95rem; }
.meldung p { margin: .3rem 0; }
.meldung.fehler { background: var(--fehler-hell); color: var(--fehler); }
.meldung.warnung { background: var(--warnung-hell); color: var(--warnung); }
.meldung.ok { background: var(--ok-hell); color: var(--ok); }
.meldung.info { background: var(--info-hell); }
.klein { font-size: .85rem; }

/* Knoepfe */
.aktionen { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--primaer);
  background: var(--primaer); color: #fff; cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--primaer-dunkel); }
.knopf.sekundaer { background: #fff; color: var(--primaer); }
.knopf.sekundaer:hover { background: var(--primaer-hell); }
.knopf.klein { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.link { background: none; border: 0; padding: 0; color: var(--primaer); text-decoration: underline; font: inherit; cursor: pointer; }
@media (max-width: 600px) { .aktionen .knopf { flex: 1 1 100%; } }

/* Uebersicht */
.kinder { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.kinder li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--rand); border-radius: 8px; flex-wrap: wrap; }
.status { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: var(--hintergrund); margin-left: 6px; }
.status-eingereicht { background: var(--ok-hell); color: var(--ok); }
.neu-kind { margin-top: 20px; display: grid; gap: 12px; }

/* Schullaufbahn */
.lb-zeile { border: 1px solid var(--rand); border-radius: 8px; padding: 12px; margin: 8px 0; background: #fcfcfd; }
.lb-zeile .raster { grid-template-columns: minmax(0, 1fr) 7rem; }
.lb-zeile .frei .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .lb-zeile .raster, .lb-zeile .frei .raster { grid-template-columns: 1fr; } }
.suche { position: relative; }
.treffer { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; max-height: 300px; overflow: auto; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--rand); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.treffer li { padding: 10px 12px; cursor: pointer; font-size: .95rem; }
.treffer li[aria-selected="true"], .treffer li:hover { background: var(--primaer-hell); }
.treffer li.frei-option { border-top: 1px solid var(--rand); color: var(--primaer); font-weight: 600; }
.entfernen { margin-top: 8px; font-size: .9rem; }
.schulpflicht { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--hintergrund); }
.schulpflicht [data-erfuellt] { color: var(--ok); }

/* Schulwahl */
.schulformen { display: grid; gap: 10px; margin-top: 12px; }
.schulform { border: 1px solid var(--rand); border-radius: 8px; }
.schulform.gewaehlt { border-color: var(--primaer); box-shadow: 0 0 0 2px var(--primaer-hell); }
.schulform-kopf { display: flex; gap: 12px; align-items: center; padding: 14px; cursor: pointer; font-weight: 600; }
.schulform-kopf input { width: 1.3rem; height: 1.3rem; min-height: 0; accent-color: var(--primaer); }
.schulform-optionen { padding: 0 14px 14px 46px; display: grid; gap: 14px; }
@media (max-width: 600px) { .schulform-optionen { padding-left: 14px; } }
.reihung { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reihung label { font-weight: 400; display: grid; gap: 4px; }
@media (max-width: 600px) { .reihung { grid-template-columns: 1fr; } }

/* Personen (Schritt 4) */
.personen { display: grid; gap: 10px; margin-top: 12px; }
.person { border: 1px solid var(--rand); border-radius: 8px; background: #fcfcfd; }
.person[open] { border-color: var(--primaer); box-shadow: 0 0 0 2px var(--primaer-hell); background: #fff; }
.person > summary { padding: 14px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.person > summary::-webkit-details-marker { display: none; }
.person > summary::before { content: "\25B8"; color: var(--primaer); transition: transform .15s; }
.person[open] > summary::before { transform: rotate(90deg); }
.person-inhalt { padding: 0 14px 14px; }
.person fieldset { margin-top: 14px; }
.unterbox { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--hintergrund); }
.fehler-marke { background: var(--fehler-hell); color: var(--fehler); }

/* Zusatzinfos (Schritt 5) */
.kw-liste { display: grid; gap: 8px; margin: 8px 0; }
.kw-zeile { display: flex; gap: 10px; align-items: center; }
.kw-zeile input { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
textarea { resize: vertical; }

/* Dokumente (Schritt 6) */
.dokumente { display: grid; gap: 10px; margin-top: 12px; }
.dok-gruppe { font-size: 1.05rem; margin: 14px 0 0; }
.dokument { border: 1px solid var(--rand); border-radius: 8px; padding: 12px 14px; }
.dokument.vorhanden { border-color: var(--ok); }
.dokument.hat-fehler { border-color: var(--fehler); }
.dok-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dateien { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.dateien li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; word-break: break-all; }
.datei-waehlen { display: inline-block; margin-top: 8px; position: relative; }
.datei-waehlen input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.datei-waehlen input:focus + .knopf { outline: 3px solid var(--primaer-hell); }
.datei-waehlen.laedt .knopf::after { content: " … wird hochgeladen"; }

/* Zusammenfassung (Schritt 7) */
.zf-block { border-top: 1px solid var(--rand); margin-top: 18px; padding-top: 14px; }
.zf-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.zf-block h2 { font-size: 1.1rem; margin: 0 0 8px; }
.zf-block h3 { font-size: 1rem; margin: 12px 0 4px; }
.zf-liste { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.zf-liste dt { color: var(--text-leise); }
.zf-liste dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .zf-liste { grid-template-columns: 1fr; } .zf-liste dd { margin-bottom: 6px; } }
.check-oben { align-items: flex-start; }
.check-oben input { margin-top: .2rem; flex: none; }
.zustimmung { margin-top: 10px; font-size: .95rem; }

/* Verwaltung */
.inhalt.breit { max-width: 1400px; }
.kopf-innen { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.kopf-nav { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.kopf-nav a, .kopf-nav button { color: #fff; text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; padding: 0; }
.kopf-nav a:hover, .kopf-nav button:hover { text-decoration: underline; }
.filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 12px 0; }
.filter .feld { min-width: 10rem; flex: 1 1 10rem; }
.tabelle-wrap { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.liste th, table.liste td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
table.liste th { font-size: .82rem; color: var(--text-leise); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
table.liste tr:hover td { background: var(--primaer-hell); }
table.liste a { font-weight: 600; }
.fehlt { color: var(--fehler); font-size: .85rem; }
.status-entwurf { background: var(--warnung-hell); color: var(--warnung); }
.status-in_bearbeitung { background: var(--info-hell); }
.status-aufgenommen { background: var(--ok-hell); color: var(--ok); }
.status-abgelehnt, .status-storniert { background: var(--fehler-hell); color: var(--fehler); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail-seite { position: sticky; top: 16px; display: grid; gap: 14px; }
.detail-seite .karte { padding: 16px; }
.detail-seite h2 { font-size: 1.05rem; margin: 0 0 8px; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } .detail-seite { position: static; } }
.protokoll { list-style: none; padding: 0; margin: 0; font-size: .85rem; display: grid; gap: 4px; }
.protokoll time { color: var(--text-leise); }
.personen-haken td { white-space: nowrap; }
body.breit .kopf-innen, body.breit .fuss-innen { max-width: 1400px; }
.personen-haken input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--primaer); }
