:root {
  --gruen: #4a7c59; --gruen-dunkel: #35593f; --creme: #faf7f0;
  --ok: #e3f4e6; --ok-text: #1e5c2e;
  --pruefen: #fdf3d7; --pruefen-text: #7a5a00;
  --klaeren: #fbe3e4; --klaeren-text: #8f1f2b;
  --grau: #6b7280; --linie: #e5e1d8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--creme); color: #26302a; font-size: 15px; }
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }
nav { background: var(--gruen); padding: 0.55rem 1rem; display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
nav a { color: #fff; text-decoration: none; padding: 0.25rem 0.4rem; border-radius: 6px; }
nav a:hover { background: var(--gruen-dunkel); }
nav .brand { font-weight: 700; font-size: 1.05rem; }
nav .logout { margin-left: auto; }
.linkbtn { background: none; border: none; color: #dfeee2; cursor: pointer; font-size: 0.9rem; padding: 0.25rem 0.4rem; }
.linkbtn:hover { text-decoration: underline; }
.badge { background: #e0a800; color: #fff; border-radius: 9px; padding: 0 0.42em; font-size: 0.78rem; }

h1 { font-size: 1.35rem; margin: 0.4rem 0 1rem; } h2 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
th, td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { background: #f0ede4; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; color: #57534e; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok-text); } .neg { color: var(--klaeren-text); }
.muted { color: var(--grau); font-size: 0.85rem; }
.klein { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

.status { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.status-OK { background: var(--ok); color: var(--ok-text); }
.status-PRUEFEN { background: var(--pruefen); color: var(--pruefen-text); }
.status-KLAEREN, .status-KLAEREN-UST { background: var(--klaeren); color: var(--klaeren-text); }
.lock { color: var(--grau); }

.flash { padding: 0.6rem 0.9rem; border-radius: 8px; margin-bottom: 0.9rem; }
.flash-ok { background: var(--ok); color: var(--ok-text); }
.flash-error { background: var(--klaeren); color: var(--klaeren-text); }

form.filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; align-items: center; }
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid #cfc9bc; border-radius: 7px; padding: 0.4rem 0.55rem; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gruen); border-color: var(--gruen); }
button.primary { background: var(--gruen); color: #fff; border: none; border-radius: 7px; padding: 0.45rem 1rem; cursor: pointer; font-weight: 600; }
button.primary:hover { background: var(--gruen-dunkel); }
button.klein-btn { padding: 0.15rem 0.6rem; font-size: 0.82rem; border-radius: 6px; border: 1px solid #cfc9bc; background: #fff; cursor: pointer; }
button.klein-btn:hover { background: #f0ede4; }

.card { background: #fff; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: 0 1px 2px rgba(0,0,0,0.06); margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.kpi { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.formgrid { display: grid; grid-template-columns: 130px 1fr; gap: 0.55rem 0.8rem; align-items: center; max-width: 620px; }
.formgrid label { font-size: 0.85rem; color: #57534e; }
.login-box { max-width: 360px; margin: 10vh auto; }
.login-box input { width: 100%; margin-bottom: 0.7rem; }
a { color: var(--gruen-dunkel); }
.beleg-thumb { max-height: 42px; border-radius: 4px; }
@media (max-width: 700px) {
  main { padding: 0.6rem; } body { font-size: 14px; }
  th, td { padding: 0.35rem 0.4rem; }
  .verbergen-mobil { display: none; }
}
