/* Kundenservice-Portal: schlichtes, gut lesbares Grundlayout, mobil tauglich.
   Module legen eigene Regeln in eigene Dateien unter public/ (z. B. faelle.css) und binden
   sie mit seite_kopf($titel, $aktiv, ['stile' => ['faelle.css']]) ein.
   Farben nur ueber die Variablen unten, damit alles einheitlich bleibt. */

:root {
    --hintergrund: #f6f7f9;
    --flaeche: #ffffff;
    --text: #1d2330;
    --text-leise: #5b6473;
    --linie: #dde1e7;
    --akzent: #1f5fbf;
    --akzent-dunkel: #174a96;
    --erfolg: #1e7a3c;
    --erfolg-hell: #e7f5ec;
    --fehler: #b3261e;
    --fehler-hell: #fdecea;
    --hinweis: #8a5a00;
    --hinweis-hell: #fff6e0;
    --heikel: #b3261e;
    --radius: 6px;
    --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

a { color: var(--akzent); }
a:hover { color: var(--akzent-dunkel); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }

code { font-family: var(--mono); font-size: .9em; }

.sprungmarke { position: absolute; left: -999px; top: 0; }
.sprungmarke:focus { left: 1rem; background: var(--flaeche); padding: .5rem; z-index: 10; }

/* Kopf und Navigation */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf-innen {
    max-width: 1200px; margin: 0 auto; padding: .5rem 1rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
}
.marke { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.navigation a {
    display: block; padding: .4rem .75rem; border-radius: var(--radius);
    text-decoration: none; color: var(--text);
}
.navigation a:hover { background: var(--hintergrund); }
.navigation a.aktiv { background: var(--akzent); color: #fff; }
.benutzer { margin-left: auto; display: flex; align-items: center; gap: .75rem; color: var(--text-leise); }

.testhinweis {
    background: var(--hinweis-hell); color: var(--hinweis); text-align: center;
    padding: .25rem; font-weight: 600; border-bottom: 1px solid var(--linie);
}

/* Inhalt und Fuss */
.inhalt { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.inhalt.breit { max-width: none; }
.fuss {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
    padding: .75rem 1rem; font-size: .85rem; color: var(--text-leise);
    border-top: 1px solid var(--linie); background: var(--flaeche);
}

/* Meldungen */
.meldung { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; border: 1px solid transparent; }
.meldung-erfolg { background: var(--erfolg-hell); color: var(--erfolg); border-color: #bfe3cc; }
.meldung-fehler { background: var(--fehler-hell); color: var(--fehler); border-color: #f5c2bd; }
.meldung-hinweis { background: var(--hinweis-hell); color: var(--hinweis); border-color: #f1dca6; }
.hinweis { color: var(--hinweis); }
.leise { color: var(--text-leise); font-size: .9rem; }

/* Knoepfe und Formulare */
.knopf, button.knopf {
    display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--akzent);
    border-radius: var(--radius); background: var(--akzent); color: #fff; font: inherit;
    cursor: pointer; text-decoration: none; line-height: 1.3;
}
.knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
.knopf-zweit { background: var(--flaeche); color: var(--akzent); }
.knopf-zweit:hover { background: var(--hintergrund); color: var(--akzent-dunkel); }
.knopf-gefahr { background: var(--fehler); border-color: var(--fehler); }
.knopf-link {
    background: none; border: 0; padding: 0; color: var(--akzent); font: inherit;
    cursor: pointer; text-decoration: underline;
}
button:disabled, .knopf[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

.formular { display: flex; flex-direction: column; gap: .4rem; max-width: 32rem; }
.formular label { font-weight: 600; margin-top: .5rem; }
.formular .knopf { margin-top: 1rem; align-self: flex-start; }
.formular-unten { margin-top: 1rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="tel"],
select, textarea {
    width: 100%; padding: .5rem .6rem; font: inherit; color: var(--text);
    background: var(--flaeche); border: 1px solid #c3c9d2; border-radius: var(--radius);
}
textarea { min-height: 10rem; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--akzent); }

/* Anmeldung */
.anmeldung {
    max-width: 26rem; margin: 2rem auto; background: var(--flaeche); padding: 1.5rem;
    border: 1px solid var(--linie); border-radius: var(--radius);
}
.schritte { padding-left: 1.25rem; }
.schritte li { margin-bottom: .5rem; }
.schluessel {
    display: block; margin: .5rem 0; padding: .5rem; background: var(--hintergrund);
    border-radius: var(--radius); letter-spacing: .05em; word-break: break-all;
}
.umbruch { word-break: break-all; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche); border: 1px solid var(--linie); }
.tabelle th, .tabelle td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: .85rem; color: var(--text-leise); font-weight: 600; background: #fafbfc; }
.tabelle tbody tr:hover { background: #f9fafc; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabellen-rahmen { overflow-x: auto; }

/* Bausteine fuer Module */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.werkzeugleiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.raster { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
.marker {
    display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem;
    background: var(--hintergrund); border: 1px solid var(--linie); color: var(--text-leise); white-space: nowrap;
}
.marker-heikel { background: var(--fehler-hell); color: var(--heikel); border-color: #f5c2bd; font-weight: 600; }
.marker-neu { background: #e8f0fc; color: var(--akzent); border-color: #c6d8f5; }
.marker-erledigt { background: var(--erfolg-hell); color: var(--erfolg); border-color: #bfe3cc; }
.vorformatiert { white-space: pre-wrap; word-wrap: break-word; }

/* Schmale Bildschirme */
@media (max-width: 720px) {
    .kopf-innen { padding: .5rem .75rem; }
    .benutzer { margin-left: 0; width: 100%; justify-content: space-between; }
    .navigation { width: 100%; }
    .navigation ul { width: 100%; }
    .navigation li { flex: 1; }
    .navigation a { text-align: center; }
    .inhalt { padding: 1rem .75rem 1.5rem; }
    .raster { grid-template-columns: 1fr; }
    .anmeldung { margin: 1rem auto; padding: 1rem; }
    .tabelle th, .tabelle td { padding: .45rem .5rem; }
    .knopf, button.knopf { padding: .65rem 1.1rem; }
}
