/* Pfarrstellvertretung – Gestaltung in Anlehnung an zhref.ch (siehe docs/gestaltung.md) */

:root {
    --text: #212121;
    --text-2: #4c4c4c;
    --text-3: #737373;
    --schwarz: #000;
    --weiss: #fff;
    --akzent: #006ca8;
    --akzent-hover: #00598b;
    --akzent-hell: #f0f5f9;
    --rose: #f8eef0;
    --grau-flaeche: #f4f5f4;
    --grau-linie: #d0d5d2;
    --linie-fein: #e6e8e7;
    --ok: #1f6f3a;
    --ok-bg: #e7f3eb;
    --warn: #7a4f00;
    --warn-bg: #fff3d6;
    --fehler: #a4262c;
    --fehler-bg: #fbe9ea;
    --radius: 6px;
    --schrift: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--grau-flaeche);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; margin-top: 1.4em; }
h1 small { font-size: 16px; color: var(--text-3); font-weight: 400; }
p { margin: 0 0 1em; }
a { color: var(--akzent); }
a:hover { color: var(--akzent-hover); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.kopf { background: var(--schwarz); color: var(--weiss); }
.kopf-innen {
    max-width: 1280px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.marke { display: flex; align-items: center; gap: 14px; color: var(--weiss); text-decoration: none; }
.marke:hover { color: var(--weiss); }
.wortmarke { font-size: 17px; font-weight: 500; line-height: 1.1; max-width: 160px; letter-spacing: -.01em; }
.logo { height: 40px; width: auto; display: block; }
.app-titel { border-left: 1px solid #555; padding-left: 14px; font-size: 15px; color: #ccc; }

.hauptnav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; flex: 1; }
.hauptnav > a, .menu > summary {
    color: var(--weiss); text-decoration: none; padding: 6px 12px; border-radius: 999px;
    font-size: 15px; cursor: pointer; list-style: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; font-size: 11px; }
.hauptnav > a:hover, .menu > summary:hover { background: #222; color: var(--weiss); }
.hauptnav > a.aktiv, .menu.aktiv > summary { background: var(--weiss); color: var(--schwarz); }
.menu { position: relative; }
.menu-liste {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 190px;
    background: var(--weiss); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 6px;
    display: flex; flex-direction: column;
}
.menu-liste a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 4px; }
.menu-liste a:hover, .menu-liste a.aktiv { background: var(--akzent-hell); color: var(--akzent); }

.benutzer { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.benutzer a { color: #ccc; text-decoration: none; }
.benutzer a:hover, .benutzer a.aktiv { color: var(--weiss); text-decoration: underline; }
.benutzer .link { color: #ccc; }
.benutzer .link:hover { color: var(--weiss); }

/* ---------- Inhalt ---------- */
.inhalt { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }
.fuss {
    max-width: 1280px; width: 100%; margin: 0 auto; padding: 16px 24px 24px;
    display: flex; justify-content: space-between; color: var(--text-3); font-size: 13px;
}

.seitenkopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.brotkrumen { margin: 0 0 4px; font-size: 14px; }
.brotkrumen a { color: var(--text-3); text-decoration: none; }
.brotkrumen a::after { content: " /"; }
.untertitel { color: var(--text-2); margin-top: -4px; }

.karte {
    background: var(--weiss); border: 1px solid var(--linie-fein); border-radius: var(--radius);
    padding: 22px 24px; margin-bottom: 20px;
}
.karte.schmal { max-width: 480px; margin: 40px auto; }
.karte > :last-child { margin-bottom: 0; }
.hinweisbox { background: var(--akzent-hell); border-color: #d6e4ef; }

.raster-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.raster-2 > .karte { margin-bottom: 0; }
.spalte > .karte:last-child { margin-bottom: 0; }
.spalte { display: flex; flex-direction: column; gap: 20px; }
.spalte > .karte { margin-bottom: 0; }
@media (max-width: 960px) { .raster-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Kacheln ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kachel {
    background: var(--weiss); border: 1px solid var(--linie-fein); border-radius: var(--radius);
    padding: 16px 18px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px;
}
.kachel:hover { border-color: var(--akzent); color: var(--text); }
.kachel .zahl { font-size: 30px; font-weight: 500; line-height: 1; }
.kachel .label { font-size: 14px; color: var(--text-2); }
.kachel .status { white-space: normal; }

/* ---------- Knöpfe ---------- */
.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-size: 15px; line-height: 1.2; padding: 9px 18px; border-radius: 999px;
    border: 1.5px solid var(--akzent); background: var(--weiss); color: var(--akzent);
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.knopf:hover { background: var(--akzent-hell); color: var(--akzent-hover); }
.knopf.primaer { background: var(--akzent); color: var(--weiss); }
.knopf.primaer:hover { background: var(--akzent-hover); border-color: var(--akzent-hover); color: var(--weiss); }
.knopf.gefahr { border-color: var(--fehler); color: var(--fehler); }
.knopf.gefahr:hover { background: var(--fehler-bg); }
button.link {
    background: none; border: 0; padding: 0; font: inherit; color: var(--akzent); cursor: pointer; text-decoration: underline;
}
.link.gefahr { color: var(--fehler); }
a.link { font-size: 15px; }
form.inline { display: inline; }

/* ---------- Formulare ---------- */
.formular { display: flex; flex-direction: column; gap: 14px; }
.formular label, .filter label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--text-2); }
label small, legend small { color: var(--text-3); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=search], input[type=file], select, textarea {
    font: inherit; font-size: 15px; color: var(--text); background: var(--weiss);
    border: 1px solid #b9bfbc; border-radius: 4px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--akzent); outline: 2px solid rgba(0,108,168,.2); outline-offset: 0; }
textarea { resize: vertical; min-height: 70px; }
input.code { font-size: 22px; letter-spacing: .2em; text-align: center; max-width: 200px; }
fieldset { border: 0; border-top: 1px solid var(--linie-fein); margin: 6px 0 0; padding: 14px 0 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 500; font-size: 15px; color: var(--text); padding: 0 8px 0 0; }
fieldset.intern { background: var(--rose); border: 0; border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
fieldset.intern legend { float: left; width: 100%; padding: 0; margin-bottom: 0; }
.zeile { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.zeile > label { flex: 1 1 180px; }
.zeile > label.w-s { flex: 0 1 150px; }
.w-xs { width: 70px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--akzent); }
.feldgruppe { display: flex; flex-direction: column; gap: 6px; }
.feldlabel { font-size: 14px; color: var(--text-2); }
.checkgruppe { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.einheit { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.einheit input { max-width: 90px; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.hinweis { font-size: 14px; color: var(--text-3); }
.leer { color: var(--text-3); font-style: italic; }

.filter {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    background: var(--weiss); border: 1px solid var(--linie-fein); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.filter .suche { flex: 1 1 260px; }
.filter label.check { padding-bottom: 9px; }
.filter .link { padding-bottom: 9px; }
.anzahl { font-size: 14px; color: var(--text-3); margin: 6px 0 8px; }

.zeile-inline { display: flex; gap: 8px; align-items: center; }
.zeile-inline input[type=text] { flex: 1; padding: 5px 8px; }
.zeile-inline input[type=number] { padding: 5px 6px; }
.zeile-inline.neu { margin-top: 14px; }

/* ---------- Tabellen ---------- */
.tabelle-scroll { overflow-x: auto; background: var(--weiss); border: 1px solid var(--linie-fein); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th, .tabelle td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linie-fein); vertical-align: top; }
.tabelle th { font-weight: 500; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; background: #fafbfa; }
.tabelle tbody tr:hover { background: #fafcfd; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; }
.tabelle.kompakt th, .tabelle.kompakt td { padding: 6px 8px; }
.karte .tabelle th { background: transparent; }
.tabelle tr.vergangen td { color: var(--text-3); }
.tabelle .details { font-size: 13px; color: var(--text-2); max-width: 520px; }
.aktionen-zelle { white-space: nowrap; text-align: right; }
.aktionen-zelle > * + * { margin-left: 10px; }
.nowrap { white-space: nowrap; }
th[data-sortierbar] { cursor: pointer; user-select: none; }
th[data-sortierbar]::after { content: " ↕"; color: #bbb; }
th[data-richtung=auf]::after { content: " ↑"; color: var(--akzent); }
th[data-richtung=ab]::after { content: " ↓"; color: var(--akzent); }
.nebentext { color: var(--text-3); font-size: 13px; margin-left: 6px; }

/* ---------- Status, Marker, Meldungen ---------- */
.status { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.status-frei { background: var(--ok-bg); color: var(--ok); }
.status-teilweise { background: var(--warn-bg); color: var(--warn); }
.status-besetzt { background: #e1ecf4; color: #00456d; }
.status-nicht_verfuegbar { background: #ececec; color: #555; }
.status-gesperrt { background: var(--fehler-bg); color: var(--fehler); }
.marker { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #ececec; color: #555; margin-left: 6px; vertical-align: 1px; }

.meldung { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border-left: 4px solid; }
.meldung ul { margin: 0; padding-left: 18px; }
.meldung-ok { background: var(--ok-bg); border-color: var(--ok); color: #13472a; }
.meldung-fehler { background: var(--fehler-bg); border-color: var(--fehler); color: #6e1a1e; }
.meldung-warnung { background: var(--warn-bg); border-color: #c08a00; color: var(--warn); }

.checkliste { list-style: none; padding: 0; }
.checkliste .ok { color: var(--ok); }
.checkliste .nok { color: var(--fehler); font-weight: 500; }

.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; font-size: 15px; }
.angaben dt { color: var(--text-3); }
.angaben dd { margin: 0; }

.verlauf { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.verlauf li { padding: 8px 0; border-bottom: 1px solid var(--linie-fein); }
.verlauf li:last-child { border-bottom: 0; }
.verlauf .zeit { color: var(--text-3); margin-right: 8px; }
.verlauf .wer { color: var(--text-2); margin-right: 8px; }
.verlauf .details { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }

.gefahrenzone { margin-top: 16px; }
.gefahrenzone summary { cursor: pointer; color: var(--fehler); font-size: 14px; }
.gefahrenzone .formular { margin-top: 12px; max-width: 320px; }

.schritte { padding-left: 20px; }
.schritte li { margin-bottom: 10px; }
.qr { margin: 12px 0; }
.qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--linie-fein); }
.schluessel { display: inline-block; margin-top: 8px; font-size: 16px; background: var(--grau-flaeche); padding: 6px 10px; border-radius: 4px; letter-spacing: .05em; }
.logo-vorschau { background: var(--schwarz); padding: 16px; border-radius: var(--radius); margin-bottom: 14px; display: inline-block; }
.logo-vorschau img { height: 40px; display: block; }

/* ---------- Einsätze und Trefferliste ---------- */
.estatus-offen { background: var(--warn-bg); color: var(--warn); }
.estatus-in_anfrage { background: #e1ecf4; color: #00456d; }
.estatus-zugestimmt { background: #e1ecf4; color: #00456d; }
.estatus-vergeben { background: var(--ok-bg); color: var(--ok); }
.estatus-abgeschlossen { background: #ececec; color: #555; }
.estatus-abgebrochen { background: var(--fehler-bg); color: var(--fehler); }
.kachel.betont { border-color: var(--akzent); }
.kachel.betont .zahl { color: var(--akzent); }
.treffer { margin-top: 28px; }
.treffer > h3 { margin: 22px 0 10px; }
.treffer .seitenkopf { align-items: baseline; }
.zaehler { display: inline-block; min-width: 26px; text-align: center; font-size: 13px; background: var(--text); color: var(--weiss); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.grund, .hinweis-chip, .erf { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; margin: 1px 4px 1px 0; white-space: nowrap; }
.grund { background: var(--warn-bg); color: var(--warn); }
.hinweis-chip { background: #ececec; color: #444; }
.hinweis-chip.plus { background: var(--ok-bg); color: var(--ok); }
.hinweis-chip.minus { background: var(--rose); color: #7a2b36; }
.erf.ok { background: var(--ok-bg); color: var(--ok); }
.erf.nok { background: transparent; color: var(--text-3); border: 1px dashed #c8cccb; }
.marker-info { background: var(--akzent-hell); color: var(--akzent); cursor: help; }
.warnbox { border-left: 4px solid #c08a00; background: var(--warn-bg); }
.umbruch { white-space: pre-line; }
.fehlertext { color: var(--fehler); }
.loeschen { margin-top: 14px; }
.formular-breit { max-width: 900px; }
.inline-details { display: inline-block; text-align: left; }
.inline-details > summary { list-style: none; display: inline; cursor: pointer; color: var(--akzent); text-decoration: underline; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > form { margin-top: 8px; }
.inline-details input[type=password] { width: 190px; padding: 5px 8px; }

/* ---------- Anfragen und Mails ---------- */
.astatus-geplant, .astatus-angefragt { background: #e1ecf4; color: #00456d; }
.astatus-interesse, .astatus-vorgeschlagen { background: var(--warn-bg); color: var(--warn); }
.astatus-zugestimmt, .astatus-vergeben { background: var(--ok-bg); color: var(--ok); }
.astatus-absage, .astatus-abgelehnt { background: var(--fehler-bg); color: var(--fehler); }
.astatus-keine_antwort, .astatus-nicht_beruecksichtigt, .astatus-zurueckgezogen, .astatus-gestrichen { background: #ececec; color: #555; }
.mstatus-gesendet { background: var(--ok-bg); color: var(--ok); }
.mstatus-test { background: #e1ecf4; color: #00456d; }
.mstatus-fehler { background: var(--fehler-bg); color: var(--fehler); }
.anfrage-leiste {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--weiss); border: 1px solid var(--akzent); border-radius: var(--radius); padding: 10px 16px; margin: 6px 0 4px;
}
.anfrage-leiste .knopf[disabled] { opacity: .45; cursor: not-allowed; }
.anfragetabelle td { font-size: 14px; }
.anfrage-aktionen { min-width: 230px; line-height: 1.9; }
.anfrage-aktionen form + form { margin-left: 8px; }
.aktionslabel { color: var(--text-3); font-size: 13px; margin-right: 4px; }
.knopf.klein { padding: 4px 12px; font-size: 13px; margin-top: 4px; }
.ja { color: var(--ok); }
.nein { color: var(--fehler); }
.offen { color: var(--text-3); }
.block { display: block; margin-left: 0; }
.checkgruppe.senkrecht { flex-direction: column; gap: 8px; }
.abstand { margin-top: 18px; }
.zeile > label.w-m, label.w-m { max-width: 220px; }
.ohne-rahmen { border: 0; }
.mailliste { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.mailliste li { padding: 7px 0; border-bottom: 1px solid var(--linie-fein); }
.mailliste li:last-child { border-bottom: 0; }
.mailliste .status { margin-left: 6px; }
.mailvorschau { border: 1px solid var(--linie-fein); border-radius: var(--radius); background: #fcfcfc; }
.mailvorschau .betreff { font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--linie-fein); }
.mailvorschau pre { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.55; }
.antwortkarte { max-width: 620px; }
.antwort-knoepfe { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.knopf.gross { padding: 13px 26px; font-size: 17px; }
.platzhalter { font-size: 13px; }
.platzhalter code { background: var(--grau-flaeche); padding: 1px 5px; border-radius: 3px; }

.reiter { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--grau-linie); }
.reiter a { padding: 8px 14px; text-decoration: none; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.reiter a.aktiv { color: var(--text); border-bottom-color: var(--akzent); font-weight: 500; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.5; }
.umbruch-alles { word-break: break-all; display: block; }

.fz { white-space: nowrap; }
.anfrage-karte { border-bottom: 1px solid #e8d9a8; padding-bottom: 6px; margin-bottom: 14px; }
.anfrage-karte:last-of-type { border-bottom: 0; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
    .kopf-innen { padding: 12px 16px; gap: 12px; }
    .inhalt { padding: 20px 14px 40px; }
    .karte { padding: 18px 16px; overflow-x: auto; }
    .zeile > label, .zeile > label.w-s { flex: 1 1 100%; }
    .benutzer { width: 100%; justify-content: flex-end; }
    h1 { font-size: 24px; }
}

@media print {
    .kopf, .fuss, .filter, .aktionen, form { display: none !important; }
    body { background: #fff; }
    .karte, .tabelle-scroll { border: 0; }
}
