/* VHS Hainburg — Gestaltung (gleiches System wie der Wirtschaftsrat, eigene Akzentfarbe)
   Schriftgrade: 11 / 12 / 13 / 14 / 22 px     Abstände: 4 / 8 / 12 / 16 / 24 / 40 px */

:root {
  --blau: #3b3486;   /* VHS-Indigo, dunkel genug für Text auf Weiß */
  --text: #111827;
  --grau: #4b5563;
  --linie: #c9d0da;
  --rand: #aeb7c4;
  --flaeche: #e9edf2;
  --rot: #d43f3f;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--flaeche); color: var(--text);
  font: 14px/1.45 var(--schrift);
}
.vhs-seite { max-width: 1180px; margin: 0 auto; padding: 0 24px 64px; }
a { color: var(--blau); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; border: 1px solid #9aa5b4; border-radius: 8px;
  background: #fff; color: #1f2937; font: 500 14px/1.2 var(--schrift);
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: #eef2f7; }
.btn:active { transform: translateY(1px); }
.btn-primaer { background: var(--blau); border-color: var(--blau); color: #fff; }
.btn-primaer:hover { background: #4a42a3; }
.btn-klein { padding: 2px 9px; font-size: 13px; }
.btn-gefahr-rand { border-color: #d36b6b; color: #b42323; }
.btn-gefahr-rand:hover { background: #fdf2f2; }
/* Löschen in Listen: weißes Kreuz auf rotem Grund */
.btn-x {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: var(--rot); color: #fff; font: 600 13px/1 var(--schrift); cursor: pointer;
}
.btn-x:hover { background: #b83030; }

/* ---------- Aktionsleiste ---------- */
.vhs-leiste {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -24px; padding: 12px 24px;
  background: var(--flaeche); border-bottom: 1px solid #c3cad5;
}
.vhs-kopf { flex: 1 1 auto; min-width: 0; margin-left: 4px; }
.vhs-ueberzeile {
  display: block; font-size: 11px; line-height: 1.2; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--grau); margin-bottom: 4px;
}
.vhs-titel {
  display: block; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em;
  color: var(--blau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vhs-abmelden { margin: 0; }
.vhs-hinweis { margin: 12px 0 0; font-size: 13px; color: var(--grau); }

.vhs-savestate {
  font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px;
}
.vhs-savestate:empty { display: none; }
.vhs-savestate.is-saving { color: #4b5563; background: #dfe5ed; }
.vhs-savestate.is-saved  { color: #17693a; background: #dcf2e4; }
.vhs-savestate.is-dirty  { color: #8a5a00; background: #fdf1d6; }
.vhs-savestate.is-error  { color: #a12626; background: #fde4e4; }

/* ---------- Abschnitte ---------- */
.vhs-abschnitt, .vhs-portalkopf h2 {
  font-size: 13px; line-height: 1.3; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blau); margin: 0;
}
.vhs-abschnitt { margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--blau); }
.vhs-portalkopf {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 40px 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--blau);
}
.vhs-portalkopf h2 { flex: 1 1 12rem; }
.vhs-portalkopf .btn { margin-left: auto; }

/* ---------- Felder ---------- */
.vhs-feld {
  width: 100%; padding: 6px 10px; border: 1px solid var(--rand); border-radius: 8px;
  background: #fff; color: var(--text); font: 14px/1.4 var(--schrift);
}
.vhs-feld:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(59,52,134,0.18); }
.vhs-feld:required { border-left: 3px solid #5b7096; }
.vhs-feld[readonly] { background: #f3f5f8; color: var(--grau); }
textarea.vhs-feld { resize: vertical; line-height: 1.55; }
.vhs-feld.vhs-ok { border-color: #15803d; box-shadow: 0 0 0 3px rgba(21,128,61,0.18); }
.vhs-feld.vhs-fehler { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.vhs-fett { font-weight: 600; }
.vhs-blau { color: var(--blau); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blau); }

.vhs-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
/* Beschriftung + Feld: feste Beschriftungsspalte = gemeinsame Fluchtlinie */
.vhs-zeile { display: grid; grid-template-columns: 9rem minmax(0, 1fr); align-items: start; gap: 0 8px; margin-bottom: 8px; }
.vhs-zeile > span:first-child { padding-top: 8px; font-size: 13px; line-height: 1.3; font-weight: 600; color: #1f2937; hyphens: auto; }
.vhs-zeile-breit { margin-top: 0; }
.vhs-haken { align-items: center; }
.vhs-haken > span:first-child { padding-top: 0; }
.vhs-haken input { justify-self: start; }
.vhs-plzort { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; }
.vhs-oben { display: block; margin-top: 8px; }
.vhs-oben > span {
  display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: #374151;
}
.vhs-fehlerliste {
  margin: 16px 0 0; padding: 10px 14px; border: 1px solid #e8a3a3; border-radius: 8px;
  background: #fdeeee; color: #8f1d1d; font-size: 13px;
}

/* ---------- Tabellen ---------- */
.vhs-tabellenrahmen { overflow-x: auto; }
.vhs-tabelle {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid #d3d9e1; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,0.12);
}
.vhs-tabelle th {
  padding: 10px 12px; background: #dfe5ed; color: #1f2937; text-align: left; vertical-align: bottom;
  font-size: 12px; line-height: 1.3; font-weight: 600; border-bottom: 1px solid #b9c2ce;
}
.vhs-tabelle th a { color: inherit; text-decoration: none; }
.vhs-tabelle th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.vhs-tabelle td { padding: 6px 12px; vertical-align: middle; border-top: 1px solid #e3e7ed; }
.vhs-tabelle tbody tr:first-child td { border-top: 0; }
.vhs-tabelle .vhs-schmal { width: 1%; white-space: nowrap; text-align: center; }
.vhs-tabelle .vhs-mitte { text-align: center; }
.vhs-tabelle form { margin: 0; }
.vhs-leerzeile td { text-align: center; color: #6b7280; font-style: italic; padding: 14px; }
.vhs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #374151; overflow-wrap: anywhere; }

.vhs-uebersicht th.vhs-mitte { width: 1%; padding-left: 6px; padding-right: 6px; hyphens: manual; }
.vhs-uebersicht td.vhs-mitte { padding-left: 6px; padding-right: 6px; }
.vhs-uebersicht tbody tr[data-href] { cursor: pointer; }
.vhs-uebersicht tbody tr[data-href]:hover { background: #eef2f8; }

/* ---------- Kombifeld: freier Text + Vorschläge ---------- */
.vhs-combo { position: relative; }
.vhs-combo > input { padding-right: 32px; }
.vhs-combo-btn {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 28px; padding: 0;
  border: 0; border-left: 1px solid #d3d9e1; border-radius: 0 7px 7px 0;
  background: #f4f6f9; color: #1f2937; font-size: 12px; cursor: pointer;
}
.vhs-combo-btn:hover { background: #e3e9f1; }
.vhs-combo-liste {
  position: fixed; z-index: 50; max-height: 260px; overflow: auto; margin: 0; padding: 4px 0;
  list-style: none; background: #fff; border: 1px solid var(--rand); border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16,24,40,0.16);
}
.vhs-combo-liste li { padding: 7px 12px; cursor: pointer; overflow-wrap: anywhere; }   /* lange Einträge umbrechen */
.vhs-combo-liste li:hover, .vhs-combo-liste li.ist-aktiv { background: #e6edf7; }
.vhs-combo-liste li.ist-aktuell { font-weight: 600; }
.vhs-combo-liste li.vhs-combo-leer { color: var(--grau); font-style: italic; cursor: default; white-space: normal; max-width: 22rem; }

/* ---------- Löschen klar abgesetzt ---------- */
.vhs-gefahr {
  display: flex; align-items: center; gap: 16px; margin-top: 40px; padding-top: 16px;
  border-top: 1px solid var(--linie); font-size: 13px; color: var(--grau);
}

/* ---------- Übersicht ---------- */
.vhs-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 16px 0; font-size: 13px; color: #374151; }
.vhs-suche { display: flex; gap: 8px; margin-bottom: 16px; }
.vhs-leerseite { margin: 64px 0; text-align: center; font-size: 15px; color: var(--grau); }

/* ---------- Meldungen ---------- */
.vhs-meldungen { position: fixed; top: 12px; right: 12px; z-index: 60; display: grid; gap: 8px; max-width: 26rem; }
.vhs-meldung { padding: 10px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--linie); box-shadow: 0 6px 16px rgba(16,24,40,0.14); font-size: 13px; }
.vhs-meldung-success { border-color: #9fd3b1; background: #e9f7ee; color: #17693a; }
.vhs-meldung-error { border-color: #e8a3a3; background: #fdeeee; color: #8f1d1d; }

/* ---------- Anmeldung ---------- */
.vhs-anmeldeseite { background: var(--blau); }
.vhs-anmeldung {
  max-width: 24rem; margin: 12vh auto 0; padding: 32px; border-radius: 12px; background: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.vhs-anmeldung h1 { margin: 0 0 16px; font-size: 22px; font-weight: 600; color: var(--blau); }
.vhs-anmeldung .btn { width: 100%; margin-top: 24px; padding: 9px 12px; }
.vhs-anmeldung .vhs-fehlerliste { margin: 0 0 8px; }

/* ---------- Schmale Fenster ---------- */
@media (max-width: 860px) {
  /* Übersicht: weniger Polster, damit alle Spalten Platz haben */
  .vhs-uebersicht th, .vhs-uebersicht td { padding-left: 6px; padding-right: 6px; }
  .vhs-uebersicht th.vhs-mitte, .vhs-uebersicht td.vhs-mitte { padding-left: 2px; padding-right: 2px; }
  .vhs-uebersicht .btn-klein { padding: 2px 7px; }
}
@media (max-width: 760px) {
  .vhs-spalten { grid-template-columns: minmax(0, 1fr); }
  .vhs-titel { font-size: 18px; }
}
@media (max-width: 520px) {
  .vhs-seite { padding: 0 12px 48px; }
  .vhs-leiste { margin: 0 -12px; padding: 8px 12px; flex-wrap: wrap; }
  .vhs-zeile { grid-template-columns: 1fr; }
  .vhs-zeile > span:first-child { padding-top: 0; }
}

/* ---------- VHS: Liste ---------- */
.vhs-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.vhs-werkzeuge .vhs-feld[type="search"] { flex: 1 1 18rem; width: auto; }
.vhs-werkzeuge select.vhs-feld { flex: 0 0 auto; width: auto; min-width: 11rem; }
.vhs-zaehler { margin: -4px 0 12px; font-size: 13px; color: var(--grau); }
.vhs-liste tbody tr[data-href] { cursor: pointer; }
.vhs-liste tbody tr[data-href]:hover { background: #f0eff9; }
.vhs-liste td { padding-top: 8px; padding-bottom: 8px; }
.vhs-liste .vhs-nr { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vhs-liste .vhs-zeit { white-space: nowrap; font-variant-numeric: tabular-nums; color: #374151; }
.vhs-marke {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; vertical-align: 1px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: #fff; background: var(--blau);
}
.vhs-haken-ok { color: #17693a; font-weight: 700; }
.vhs-haken-offen { color: #b7bfcb; }

/* ---------- VHS: Detailansicht ---------- */
.vhs-blaettern { display: inline-flex; align-items: center; gap: 4px; }
.vhs-blaettern .vhs-position { min-width: 5.5rem; text-align: center; font-size: 12px; color: var(--grau); font-variant-numeric: tabular-nums; }
.vhs-blaettern .btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.vhs-von-bis { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.vhs-von-bis > span { font-size: 13px; color: var(--grau); }
.vhs-kurz { max-width: 14rem; }
details.vhs-erweitert {
  margin-top: 40px; border: 1px solid #c3cad5; border-radius: 10px; background: #f6f7fa; padding: 0 16px;
}
details.vhs-erweitert > summary {
  cursor: pointer; padding: 12px 0; list-style-position: inside;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blau);
}
details.vhs-erweitert[open] > summary { border-bottom: 1px solid #d3d9e1; margin-bottom: 16px; }
details.vhs-erweitert > .vhs-spalten { padding-bottom: 8px; }
.vhs-stand { margin-top: 16px; font-size: 12px; color: var(--grau); }
@media (max-width: 760px) {
  .vhs-blaettern .vhs-position { display: none; }
}
