/* eRechFix Online-Demo: nachgebaut nach der Windows-Oberfläche (Stil.cs). Menü links, Karten, Eingabefelder mit Linie unten. */
:root {
  --akzent: #1f6f8b;
  --akzent-hell: #e3f1f6;
  --akzent-dunkel: #155268;
  --ok: #2e7d4f;
  --ok-hell: #e6f4ec;
  --warn: #b3261e;
  --warn-hell: #fbeaea;
  --text: #1d2327;
  --text2: #5b6670;
  --linie: #dde3e8;
  --linie-hell: #eef1f4;
  --flaeche: #f8f9fb;
  --nav: #1d3a47;
  --nav-text: #cfe0e8;
  --feld: #737c84;
  --platzhalter: #9aa3ab;
  --orange: #e8590c;
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--schrift); color: var(--text); background: var(--flaeche); }
[hidden] { display: none !important; }
h1 { font-size: 1.55rem; font-weight: 600; margin: 0; }
h2 { font-size: 1rem; font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: var(--akzent); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--text2); }
.klein { font-size: .85rem; }
.blau { color: var(--akzent); }
:focus-visible { outline: 2px solid var(--nav); outline-offset: 2px; }

/* Gerüst */
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100%; }
.menue { background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; gap: 4px; padding: 18px 10px; position: sticky; top: 0; height: 100vh; }
.marke { display: block; padding: 0 8px 18px; }
.marke img { display: block; height: 32px; width: auto; }
.punkt { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 6px; color: var(--nav-text); text-decoration: none; font-size: .98rem; }
.punkt:hover { background: rgba(255,255,255,.07); color: #fff; }
.punkt.aktiv { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.sym { width: 16px; text-align: center; opacity: .9; }
.menue-fuss { margin-top: auto; font-size: .8rem; line-height: 1.5; padding: 0 8px; }
.menue-fuss b { display: block; color: #fff; }
.menue-fuss a { color: #fff; }
main { padding: 16px 20px 32px; min-width: 0; display: grid; gap: 14px; align-content: start; }
.banner { background: var(--akzent-hell); color: var(--akzent-dunkel); border-radius: 6px; padding: 8px 12px; font-size: .9rem; }
.seite { display: grid; gap: 14px; }
.seitenkopf { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.kopf-feld { margin-left: auto; display: flex; align-items: baseline; gap: 10px; color: var(--text2); font-size: .85rem; }
.raster { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.links, .rechts { display: grid; gap: 12px; min-width: 0; }
.rechts { position: sticky; top: 16px; }

/* Karten */
.karte { background: #fff; border: 1px solid var(--linie); border-radius: 6px; padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.karten-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.karten-kopf h2 { margin-right: 6px; }
.chip { background: var(--akzent-hell); color: var(--akzent-dunkel); padding: 3px 10px; border-radius: 4px; font-size: .85rem; }
.haken { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text2); }

/* Felder: Linie unten wie im Programm */
.felder { display: grid; gap: 6px 18px; }
.felder.drei { grid-template-columns: 2fr 1.3fr 1.1fr; }
.felder.sechs { grid-template-columns: 1.3fr .7fr 1.1fr .8fr .7fr 1.8fr; }
.breit2 { grid-column: span 2; }
.ort-zeile { display: grid; grid-template-columns: 60px 90px 1fr; gap: 10px; }
label { display: grid; gap: 2px; font-size: .8rem; color: var(--text2); min-width: 0; }
input, select { font: inherit; font-size: .95rem; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--feld); padding: 5px 2px; border-radius: 0; min-width: 0; width: 100%; }
input::placeholder { color: var(--platzhalter); }
input:focus, select:focus { outline: none; background: #fff; border-bottom: 2px solid var(--nav); padding-bottom: 4px; }
input[readonly] { color: var(--text2); border-bottom-style: dotted; }
.haken input { width: auto; }
.auswahl select { border: 1px solid var(--linie); border-radius: 4px; padding: 6px 8px; background: #fff; min-width: 220px; }
/* „Aus Kundenstamm wählen …“ hervorgehoben: oranger Rahmen, heller oranger Grund */
.auswahl.betont select { border: 2px solid var(--orange); background-color: #fff4ec; color: #a8400a; font-weight: 600; padding: 5px 8px; cursor: pointer; }
.auswahl.betont select:hover { background-color: #ffe6d5; }
.auswahl.betont select:focus { outline: 2px solid var(--orange); outline-offset: 2px; }
.auswahl.betont option { background: #fff; color: #222; font-weight: 400; }
.auswahl.breit { flex: 1; }
.auswahl.breit select { width: 100%; }
.hinweis-feld { margin-top: 2px; }

/* Knöpfe */
.knopf { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; border-radius: 4px; border: 1px solid var(--linie); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.knopf:hover { border-color: var(--feld); }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
.knopf.haupt:hover { background: var(--akzent-dunkel); }
.knopf.gross { padding: 13px 14px; font-size: 1rem; width: 100%; }
.knopf[disabled] { opacity: .6; cursor: progress; }
.knopf kbd { font: inherit; font-weight: 400; opacity: .8; }
.knopf-reihe { display: flex; gap: 8px; flex-wrap: wrap; }
.mini { border: 0; background: transparent; color: var(--text2); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 4px; }
.mini:hover { color: var(--warn); background: var(--warn-hell); }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 400; color: var(--text2); font-size: .82rem; padding: 6px 6px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
td { padding: 4px 6px; border-bottom: 1px solid var(--linie-hell); vertical-align: middle; }
.z { text-align: right; }
.positionen td input, .positionen td select { border-bottom-color: var(--linie); padding: 4px 2px; font-size: .92rem; }
.positionen td input:focus { border-bottom-color: var(--nav); }
.positionen .bez { min-width: 200px; }
.positionen .menge { width: 70px; text-align: right; }
.positionen .menge.auto { color: var(--akzent); font-weight: 600; }
.positionen .einheit { width: 110px; }
.positionen .preis { width: 90px; text-align: right; }
.positionen .ust { width: 92px; }
.positionen .gesamt { white-space: nowrap; color: var(--text2); }
.positionen .frei-text { color: var(--text2); white-space: nowrap; }
.leer td { color: var(--text2); text-align: center; padding: 18px; }
.liste td { padding: 8px 6px; }
.liste .knopf { padding: 4px 10px; font-size: .85rem; }

/* Summe und Meldungen */
.summe dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.summe dt { color: var(--text2); }
.summe dd { margin: 0; text-align: right; }
.summe .gesamt-zeile { font-size: 1.15rem; font-weight: 700; color: var(--text); padding-top: 8px; border-top: 1px solid var(--linie); }
.meldung ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.meldung.fehler { border-color: #f0c4c1; background: var(--warn-hell); color: var(--warn); }
.meldung.ok { border-color: #bfe0cb; background: var(--ok-hell); }
.meldung.ok h2 { color: var(--ok); }
.leise-karte { background: transparent; }
.leise-karte p { color: var(--text2); font-size: .88rem; }

/* Rechnungsliste */
.leiste { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.suche { width: 260px; }
.rechnungsliste td { white-space: nowrap; }
.rechnungsliste td:nth-child(3), .rechnungsliste td:nth-child(9) { white-space: normal; min-width: 110px; }
.rechnungsliste tr.neu td:first-child { font-weight: 600; }
.status { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .85rem; font-weight: 600; }
.status.Offen { background: #fff4dc; color: #8a5a00; }
.status.Ueberfaellig { background: var(--warn-hell); color: var(--warn); }
.status.Bezahlt { background: var(--ok-hell); color: var(--ok); }
.status.Storniert, .status.Storno { background: var(--warn-hell); color: var(--warn); font-weight: 400; }
.aktionen { display: flex; gap: 6px; }
.aktionen a { padding: 3px 9px; font-size: .85rem; }

/* Einstellungen (nur Ansicht) */
.einstellungen { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.einstellungen dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.einstellungen dt { color: var(--text2); }
.einstellungen dd { margin: 0; overflow-wrap: anywhere; }

/* Schmale Fenster */
@media (max-width: 1100px) {
  .raster { grid-template-columns: minmax(0, 1fr); }
  .rechts { position: static; }
  .felder.sechs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menue { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; }
  .marke { padding: 0 8px 0 0; }
  .marke img { height: 24px; }
  .punkt { padding: 6px 8px; font-size: .9rem; }
  .sym { display: none; }
  .menue-fuss { display: none; }
  main { padding: 12px; }
  .felder.drei, .felder.sechs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .breit2 { grid-column: span 2; }
  .kopf-feld { margin-left: 0; }
}
