:root {
  --text: #272d30; --grau: #656768; --hell: #8a9095; --linie: #e3e3e3; --flaeche: #f5f6f7;
  --akzent: #0079b3; --akzent-hell: #e6f2f8; --gruen: #2e8540; --rot: #c0392b; --gelb: #b7791f;
  --weiss: #fff; --leiste: #23292d;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", Selawik, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--flaeche); }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 400; margin: 0 0 16px; }
h2 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }

.seitenleiste { position: fixed; inset: 0 auto 0 0; width: 200px; background: var(--leiste); padding: 18px 0;
  display: flex; flex-direction: column; overflow-y: auto; }
.seitenleiste .marke { color: #fff; font-size: 19px; font-weight: 600; padding: 0 20px 18px; letter-spacing: .5px; }
.seitenleiste a { color: #c9d1d6; padding: 9px 20px; border-left: 3px solid transparent; }
.seitenleiste a:hover { background: #2e363b; color: #fff; text-decoration: none; }
.seitenleiste a.aktiv { color: #fff; background: #2e363b; border-left-color: var(--akzent); }
.seitenleiste .abmelden { margin-top: auto; padding: 12px 20px; }
.seitenleiste .abmelden button { background: none; border: 1px solid #50595f; color: #c9d1d6; width: 100%; }
main.mit-leiste { margin-left: 200px; padding: 28px 36px 60px; max-width: 1400px; }
main.allein { max-width: 420px; margin: 12vh auto; padding: 0 16px; }

.meldung { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; background: var(--akzent-hell); }
.meldung.fehler { background: #fdecea; color: var(--rot); }
.meldung.ok { background: #e7f4ea; color: var(--gruen); }

.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kopfzeile h1 { margin: 0; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.aktionen form { margin: 0; }

button, .knopf { font: inherit; padding: 7px 14px; border-radius: 4px; border: 1px solid var(--linie); background: #fff;
  color: var(--text); cursor: pointer; display: inline-block; line-height: 1.3; }
button:hover, .knopf:hover { border-color: #b9bec2; text-decoration: none; }
.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.haupt:hover { background: #00679a; }
.gefahr { color: var(--rot); }
.klein { padding: 3px 8px; font-size: 13px; }

.karte { background: #fff; border: 1px solid var(--linie); border-radius: 6px; padding: 18px 20px; margin-bottom: 18px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kennzahl { background: #fff; border: 1px solid var(--linie); border-radius: 6px; padding: 14px 16px; }
.kennzahl .wert { font-size: 22px; font-weight: 600; margin-top: 4px; }
.kennzahl .label { color: var(--grau); font-size: 13px; }

table.liste { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; }
table.liste th { text-align: left; font-weight: 600; font-size: 13px; color: var(--grau); padding: 9px 12px; background: #fafbfb;
  border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.liste td { padding: 8px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tr.klickbar:hover td { background: #f7fafc; cursor: pointer; }
.zahl { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dezent { color: var(--hell); }
.summenzeile td { font-weight: 600; background: #fafbfb; }

.filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter a { padding: 5px 11px; border-radius: 14px; border: 1px solid var(--linie); background: #fff; color: var(--text); font-size: 13px; }
.filter a.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.filter a:hover { text-decoration: none; border-color: #b9bec2; }
.filter .anzahl { opacity: .7; margin-left: 3px; }
.filter form { display: flex; gap: 6px; margin-left: auto; }

.status { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #eef0f1; color: var(--grau); white-space: nowrap; }
.status.paid, .status.accepted, .status.invoiced, .status.projectCreated { background: #e7f4ea; color: var(--gruen); }
.status.locked, .status.open, .status.started { background: var(--akzent-hell); color: var(--akzent); }
.status.partiallyPaid { background: #fdf3e1; color: var(--gelb); }
.status.cancelled, .status.rejected { background: #fdecea; color: var(--rot); }
.status.ueberfaellig { background: #fdecea; color: var(--rot); }
.herkunft { font-size: 11px; color: var(--hell); border: 1px solid var(--linie); border-radius: 3px; padding: 0 4px; margin-left: 4px; }

label { display: block; font-size: 13px; color: var(--grau); margin-bottom: 3px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 7px 9px; border: 1px solid #cfd4d8; border-radius: 4px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, .rtext:focus { outline: 2px solid #9ccbe3; border-color: var(--akzent); }
textarea { min-height: 70px; resize: vertical; }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.feld-breit { grid-column: 1 / -1; }
.haken { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.haken input { width: auto; }

.rtext-wrap { border: 1px solid #cfd4d8; border-radius: 4px; background: #fff; }
.rtext-leiste { display: flex; gap: 2px; padding: 3px; border-bottom: 1px solid var(--linie); background: #fafbfb; }
.rtext-leiste button { padding: 2px 8px; font-size: 13px; border: 1px solid transparent; background: none; }
.rtext-leiste button:hover { border-color: var(--linie); background: #fff; }
.rtext { min-height: 48px; padding: 7px 9px; }
.rtext p { margin: 0; }
.rtext ul, .rtext ol, .html ul, .html ol { margin: 0; padding-left: 22px; }
.html p { margin: 0; }
.rtext-klein .rtext { font-size: 13px; color: var(--grau); }

.positionen { width: 100%; border-collapse: collapse; }
.positionen th { font-size: 12px; color: var(--grau); text-align: left; padding: 4px 6px; font-weight: 600; }
.positionen td { padding: 6px; vertical-align: top; border-top: 1px solid var(--linie); }
.positionen input, .positionen select { padding: 5px 6px; }
.positionen .p-titel { min-width: 220px; }
.positionen .p-menge { width: 82px; } .positionen .p-einheit { width: 92px; } .positionen .p-preis { width: 100px; }
.positionen .p-mwst { width: 76px; } .positionen .p-rabatt { width: 70px; } .positionen .p-summe { width: 110px; padding-top: 12px; }
.positionen .p-knoepfe { white-space: nowrap; width: 90px; }
.summen-block { margin-left: auto; width: 320px; margin-top: 12px; }
.summen-block div { display: flex; justify-content: space-between; padding: 3px 0; }
.summen-block .gesamt { font-weight: 600; border-top: 1px solid var(--linie); padding-top: 6px; }

.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .zweispaltig { grid-template-columns: 1fr; } }
.pdf-rahmen { width: 100%; height: 82vh; border: 1px solid var(--linie); border-radius: 6px; background: #fff; }
.zeilen dt { color: var(--grau); font-size: 13px; }
.zeilen dd { margin: 0 0 8px; }
.verlauf { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.verlauf li { padding: 5px 0; border-bottom: 1px solid var(--linie); }
.verlauf .zeit { color: var(--hell); margin-right: 6px; }
.hinweis { background: #fdf3e1; border: 1px solid #f3d9a6; padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; }
.balken { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 6px 0; }
.balken .monat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.balken .paar { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.balken .ein { background: var(--akzent); width: 42%; border-radius: 2px 2px 0 0; }
.balken .aus { background: #b9c3c9; width: 42%; border-radius: 2px 2px 0 0; }
.balken .name { font-size: 11px; color: var(--hell); }
.legende { font-size: 12px; color: var(--grau); display: flex; gap: 14px; }
.legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.legende .l-ein::before { background: var(--akzent); } .legende .l-aus::before { background: #b9c3c9; }
.anmelden-karte { background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 28px; }
.anmelden-karte h1 { font-size: 22px; }
.anmelden-karte button { width: 100%; margin-top: 14px; }
@media (max-width: 700px) {
  .seitenleiste { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 6px; }
  .seitenleiste .marke { width: 100%; padding: 0 10px 6px; }
  .seitenleiste a { padding: 6px 10px; border-left: 0; }
  .seitenleiste .abmelden { margin: 0 0 0 auto; padding: 4px 10px; }
  main.mit-leiste { margin-left: 0; padding: 16px 16px 40px; }
  table.liste { display: block; overflow-x: auto; }
  .filter form { margin-left: 0; flex-wrap: wrap; }
  .felder { grid-template-columns: 1fr; }
  textarea, input, select { max-width: 100%; }
}
