/*
 * Finanzen – Gestaltung nach experity Styleguide 1.1 (13.10.2026)
 * Quelle: experity1/experity1-experity-verwaltung docs/EXPERITY-STYLEGUIDE.md, Git-Blob 8b77b4fa75fae39b698d74cbaf007d54be90b3ab
 * Logo und Schriften unverändert aus derselben Quelle; Schriftlizenzen: fonts/OFL-*.txt (SIL Open Font License 1.1).
 * Grössen in rem, damit 200 % Textvergrösserung Inhalt und Aktionen erreichbar lässt.
 */
@font-face { font-family: "Open Sans"; src: url("fonts/OpenSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/OpenSans-SemiBold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("fonts/Michroma-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --brand: #9BCB3B; --brand-hover: #83AD2E; --brand-ink: #25320E; --heading: #3B3C42; --text: #4C4C4C; --muted: #696969;
  --page: #F7F7F7; --surface: #FFFFFF; --brand-soft: #EAF3D7; --divider: #DCDCDC; --field-border: #8A8A8A;
  --link: #49690B; --focus: #557B0B; --success: #3C6412; --error: #A42222; --warning: #795000;
  --schrift: "Open Sans", Arial, sans-serif; --titelschrift: "Michroma", "Open Sans", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 1rem/1.5 var(--schrift); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font: 400 1.75rem/1.35 var(--titelschrift); color: var(--heading); margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; color: var(--heading); margin: 0 0 12px; }
h3 { font-size: 1rem; line-height: 1.4; font-weight: 600; color: var(--heading); margin: 16px 0 8px; }
p { margin: 0 0 12px; }
small, .klein { font-size: 0.875rem; }
code { font-size: 0.875rem; overflow-wrap: anywhere; }
.nur-vorleser { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gedaempft { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ungeklaert { color: var(--warning); }

/* Bedienelemente: eckig, ohne Schatten. Standard ist die Sekundäraktion; .primaer ist die eine Hauptaktion. */
button, .knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 0;
  background: var(--surface); color: var(--heading); border: 1px solid var(--field-border); cursor: pointer; text-decoration: none; line-height: 1.25;
}
button:hover, .knopf:hover { background: var(--page); }
.primaer { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; min-height: 48px; padding: 0 24px; }
.primaer:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.gefahr { color: var(--error); border-color: var(--error); }
.gefahr:hover { background: #FBECEC; }
button:disabled { opacity: .6; cursor: not-allowed; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 0; padding: 8px 12px; min-height: 44px; max-width: 100%;
}
input:disabled, select:disabled { background: var(--page); color: var(--muted); border-color: var(--divider); cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { min-height: 0; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--focus); flex: none; }
input[type="file"] { padding: 8px; }
label { color: var(--heading); }
.feld { display: grid; gap: 4px; min-width: 0; align-content: start; }
.feld > label, .feld > .bezeichnung { font-size: 0.875rem; font-weight: 600; color: var(--heading); }
.feld input, .feld select { width: 100%; }
.feld .fehlertext { margin: 0; }
.fehlertext { color: var(--error); font-size: 0.875rem; }
.feld.hat-fehler input, .feld.hat-fehler select { border-color: var(--error); }
form.inline { display: inline; }
fieldset { border: 1px solid var(--divider); margin: 12px 0; padding: 12px 16px; min-width: 0; }
legend { font-weight: 600; color: var(--heading); padding: 0 4px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Kopf: Logo auf Weiss mit Schutzraum (≥ ¼ der Logohöhe), Produkttitel, fünf Hauptwege, ruhiger Hilfsbereich */
.kopf { background: var(--surface); border-bottom: 1px solid var(--divider); }
.kopf-innen { max-width: 76rem; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; }
.marke { order: 1; display: flex; align-items: center; gap: 16px; padding: 16px 0; text-decoration: none; color: var(--heading); }
.marke img { display: block; width: 155px; height: auto; }
.marke .produkt { font-weight: 600; font-size: 1.125rem; padding-left: 16px; border-left: 1px solid var(--divider); }
.hauptnavigation { order: 3; width: 100%; }
.hauptnavigation > ul { margin-left: -12px; }
.hauptnavigation ul, .unternavigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.hauptnavigation a, .unternavigation a {
  display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--heading); text-decoration: none; border-bottom: 3px solid transparent;
}
.hauptnavigation a:hover, .unternavigation a:hover { text-decoration: underline; }
/* Aktiv: fett, Unterstrich und Fläche – nicht nur Farbe */
.hauptnavigation a[aria-current="page"] { font-weight: 600; background: var(--brand-soft); border-bottom-color: var(--focus); }
.hilfsbereich { order: 2; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.875rem; color: var(--muted); padding: 8px 0; }
.hilfsbereich form { display: flex; gap: 4px; }
.hilfsbereich input[type="search"] { width: 12rem; min-height: 40px; padding: 6px 10px; }
.hilfsbereich button { min-height: 40px; padding: 0 12px; }
.menue-knopf { order: 2; display: none; margin-left: auto; }
.unternavigation { background: var(--page); border-bottom: 1px solid var(--divider); }
.unternavigation ul { max-width: 76rem; margin: 0 auto; padding: 0 24px; gap: 0 8px; }
.unternavigation a { font-size: 0.9375rem; }
.unternavigation a[aria-current="page"] { font-weight: 600; border-bottom-color: var(--focus); }

main { max-width: 76rem; margin: 0 auto; padding: 24px 24px 64px; }
main.anmeldung { max-width: 30rem; }

/* Meldungen: Text plus Randmarke, nicht nur Farbe */
.hinweis { padding: 12px 16px; margin: 0 0 12px; border-left: 4px solid var(--field-border); background: var(--surface); }
.hinweis.fehler { border-color: var(--error); color: var(--error); }
.hinweis.erfolg { border-color: var(--success); color: var(--success); }
.hinweis.warnung { border-color: var(--warning); color: var(--warning); }
.hinweis a { color: inherit; }

/* Seitenkopf mit Titel, Ergebniszeile und einer Hauptaktion */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.seitenkopf .ergebnis { margin: 4px 0 0; color: var(--muted); }

/* Statusreiter */
.reiter { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--divider); }
.reiter a { display: flex; gap: 6px; align-items: center; min-height: 44px; padding: 8px 16px; color: var(--heading); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.reiter a:hover { text-decoration: underline; }
.reiter a[aria-current="page"] { font-weight: 600; border-bottom-color: var(--focus); background: var(--brand-soft); }
.reiter .zahl { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }

/* Filter: beschriftete Felder in einer umbrechenden Leiste */
.filter { background: var(--surface); border: 1px solid var(--divider); padding: 16px; margin-bottom: 16px; }
.filter-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: 12px 16px; align-items: end; }
.filter-zeile.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.weitere-knopf { display: none; }
/* Weitere Filter auf allen Breiten einklappbar; bei aktiven weiteren Filtern serverseitig offen. Ohne JavaScript immer sichtbar. */
.js .weitere-knopf { display: inline-flex; }
.js .filter:not(.weitere-offen) .weitere { display: none; }
.weitere { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.weitere .zeitraum-wahl { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; border: 0; padding: 0; margin: 0; }
.weitere .zeitraum-wahl legend { font-size: 0.875rem; padding: 0; margin-bottom: 4px; }
.wahl { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.filter .aktionen { margin-top: 12px; }
.filter-hinweis { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }

.trefferzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.trefferzahl { margin: 0; }
.zahlwert { font-variant-numeric: tabular-nums; }
.formular-ende { margin-top: 16px; }
.werkzeugleiste { align-items: flex-start; margin-bottom: 16px; }
.werkzeugleiste details { margin: 0; }
details.abgesetzt { margin-top: 32px; }
form.abgesetzt { margin-top: 24px; }
.bexio-status { margin-top: 24px; }
main.anmeldung .marke { background: var(--surface); padding: 16px; margin-bottom: 24px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--field-border); background: var(--surface); color: var(--heading); text-decoration: none; font-size: 0.875rem; }
.chip:hover { background: var(--brand-soft); }
.chip .x { font-weight: 600; }
.summen { margin: 0 0 16px; padding: 12px 16px; background: var(--surface); border-top: 2px solid var(--heading); font-weight: 600; color: var(--heading); }
.summen .gedaempft, .summen .zweitzeile { font-weight: 400; }

/* Tabellen */
.tabelle { background: var(--surface); border: 1px solid var(--divider); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
thead th { background: var(--brand-soft); color: var(--heading); font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
td { font-size: 0.9375rem; }
th.num, td.num { text-align: right; }
.zweitzeile { display: block; color: var(--muted); font-size: 0.875rem; }
.titelzeile { font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.status-text { font-weight: 600; color: var(--heading); }
.leer { padding: 24px 16px; text-align: left; color: var(--muted); }

.blaettern { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.blaettern .aktionen a[aria-disabled="true"] { pointer-events: none; color: var(--muted); border-color: var(--divider); }

/* Detailansicht */
.zurueck { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
.kopfdaten { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 8px 0 0; color: var(--text); }
.kopfdaten strong { color: var(--heading); }
.ablauf { list-style: none; counter-reset: schritt; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: 8px; margin: 24px 0; padding: 0; }
.ablauf li { counter-increment: schritt; border-top: 4px solid var(--divider); padding: 8px 0 0; }
.ablauf li::before { content: counter(schritt) ". "; font-weight: 600; color: var(--heading); }
.ablauf li.erledigt { border-top-color: var(--focus); }
.ablauf .zustand { display: block; font-size: 0.875rem; color: var(--muted); }
.ablauf li.erledigt .zustand { color: var(--success); }
.abschnitt { border-top: 1px solid var(--divider); padding-top: 24px; margin-top: 32px; }
.abschnitt > h2:first-child { margin-top: 0; }
.spalten { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.spalten > .abschnitt { margin-top: 0; }
dl.daten { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 16px; }
dl.daten dt { color: var(--muted); font-size: 0.875rem; padding-top: 2px; }
dl.daten dd { margin: 0; overflow-wrap: anywhere; }
.liste-schlicht { list-style: none; margin: 0 0 12px; padding: 0; }
.liste-schlicht li { padding: 8px 0; border-bottom: 1px solid var(--divider); overflow-wrap: anywhere; }
.pruefung fieldset { border: 0; border-bottom: 1px solid var(--divider); margin: 0; padding: 12px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pruefung fieldset > * { min-width: 0; overflow-wrap: anywhere; }
.pruefung legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 0.9375rem; }
.pruefung .geprueft { font-size: 0.875rem; color: var(--muted); clear: both; }
.pruefung .wahl { min-height: 36px; align-items: flex-start; }
.pruefung .wahl input[type="radio"] { margin-top: 3px; }
.pruefung .manuell { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pruefung .manuell input:not([type]) { flex: 0 1 22rem; min-width: 0; }
.herkunft { font-size: 0.8125rem; color: var(--muted); }
.marke-ki { display: inline-block; font-size: 0.8125rem; font-weight: 600; color: var(--warning); border: 1px solid var(--warning); padding: 0 6px; }
details { margin: 12px 0; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--link); text-decoration: underline; }
details[open] > summary { margin-bottom: 8px; }
details.werkzeug { background: var(--surface); border: 1px solid var(--divider); padding: 0 16px; }
details.werkzeug[open] { padding-bottom: 16px; }
.manuell-zuordnen input { width: 11rem; }
.formular { display: grid; gap: 12px; max-width: 40rem; }
.formular-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); gap: 12px; align-items: end; }

/* Mittlere Breite: Detail einspaltig */
@media (max-width: 64em) {
  .spalten { grid-template-columns: minmax(0, 1fr); }
  .spalten > .abschnitt + .abschnitt { margin-top: 32px; }
}

/* Schmal: Menübutton, Navigation untereinander, Listen als Karten */
@media (max-width: 52em) {
  .kopf-innen { padding: 0 16px; gap: 0 12px; }
  .marke { padding: 12px 0; gap: 12px; }
  .js .menue-knopf { display: inline-flex; }
  .js .kopf:not(.offen) .hauptnavigation, .js .kopf:not(.offen) .hilfsbereich { display: none; }
  .hauptnavigation { width: 100%; border-top: 1px solid var(--divider); }
  .hauptnavigation > ul { flex-direction: column; margin-left: 0; }
  .hauptnavigation a { border-bottom: 0; border-left: 4px solid transparent; }
  .hauptnavigation a[aria-current="page"] { border-left-color: var(--focus); }
  .hilfsbereich { order: 4; width: 100%; margin: 0; padding: 8px 0 16px; }
  .hilfsbereich form { flex: 1 1 100%; }
  .hilfsbereich input[type="search"] { flex: 1; width: auto; }
  .unternavigation ul { padding: 0 16px; }
  main { padding: 16px 16px 48px; }
  h1 { font-size: 1.5rem; }
  /* Karten statt verkleinerter Tabelle */
  .tabelle.karten { background: none; border: 0; overflow: visible; }
  .karten thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .karten table, .karten tbody, .karten tr, .karten td { display: block; width: 100%; }
  .karten tr { background: var(--surface); border: 1px solid var(--divider); margin-bottom: 8px; padding: 8px 12px; }
  .karten td { border: 0; padding: 4px 0; text-align: left; display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 8px; }
  .karten td::before { content: attr(data-label); color: var(--muted); font-size: 0.875rem; }
  .karten td.num { white-space: normal; }
  .karten td > .zweitzeile, .karten td > .status-text + .zweitzeile { grid-column: 2; }
  .karten td > details { grid-column: 1 / -1; margin: 4px 0 0; }
  .karten td.haupt { display: block; }
  .karten td.haupt::before, .karten td.aktion::before { content: none; }
  .karten td.aktion { display: block; padding-top: 8px; }
  .karten td.leer { display: block; }
  .karten td.leer::before { content: none; }
}
/* Sehr schmal oder 200 % Text: Logo bleibt ≥ 120 px, Produkttitel unter das Logo */
@media (max-width: 22em) {
  .marke { flex-direction: column; align-items: flex-start; gap: 4px; }
  .marke img { width: 130px; }
  .marke .produkt { padding-left: 0; border-left: 0; font-size: 1rem; }
  .karten td { display: block; }
  .karten td::before { display: block; }
  dl.daten { grid-template-columns: minmax(0, 1fr); }
  dl.daten dd { margin-bottom: 8px; }
}
@media (pointer: coarse) {
  .chip, .hilfsbereich input[type="search"], .hilfsbereich button { min-height: 44px; }
}
