:root {
  --navy: #3E5C9A;
  --navy-dark: #2f4878;
  --green: #6BB550;
  --green-dark: #559a3d;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e2e6ec;
  --red: #c0392b;
  --yellow: #d99a00;
  --orange: #e07a1f;
  --radius: 8px;
  --font: Calibri, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--navy); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--navy-dark); }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; color: var(--navy-dark); }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

/* Kopf */
.top { background: var(--navy); color: #fff; border-bottom: 5px solid var(--green); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand img { height: 38px; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; opacity: .9; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); opacity: 1; }
.nav a.muted { opacity: .65; }
.burger { display: none; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; font-size: 1.3rem; border-radius: 6px; padding: 4px 10px; }
main { padding: 24px 0 40px; }
.foot { color: var(--muted); font-size: .85rem; padding: 10px 20px 30px; }
.foot .lizenz { font-size: .78rem; opacity: .85; }
.foot .lizenz a { color: var(--muted); }

/* Karten & Meldungen */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border-left: 5px solid; background: #fff; }
.flash-ok { border-color: var(--green); }
.flash-warn { border-color: var(--yellow); }
.flash-err { border-color: var(--red); }
.hint { color: var(--muted); font-size: .9rem; }

/* Formulare */
form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9cfd8; border-radius: 6px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 26px; }
.check input { width: 18px; height: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--navy-dark); }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); }
.btn-ghost { background: #fff; color: var(--navy); }
.btn-ghost:hover { background: #eef2f9; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #fdf0ee; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Filterleiste */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > div { min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters label { font-size: .8rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f8fa; color: var(--navy-dark); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
th a { color: inherit; text-decoration: none; }
th a.sorted::after { content: " ▾"; }
th a.sorted.asc::after { content: " ▴"; }
tr:hover td { background: #fafbfd; }
td.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tr.warn td { background: #fff8e6; }
tr.done td { color: var(--muted); }
.small { font-size: .85rem; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-blau { background: #e3eaf8; color: var(--navy-dark); }
.badge-gruen { background: #e2f3db; color: #2f6b1d; }
.badge-gelb { background: #fff1c7; color: #7a5600; }
.badge-orange { background: #ffe5cc; color: #8a4500; }
.badge-grau { background: #e9ecf0; color: #555; }
.badge-rot { background: #fadbd8; color: var(--red); }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border-top: 4px solid var(--navy); }
.kpi.green { border-top-color: var(--green); }
.kpi.orange { border-top-color: var(--orange); }
.kpi b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--navy-dark); }
.kpi span { color: var(--muted); font-size: .85rem; }

/* Auswertung: Balken */
.bars { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bar { display: grid; grid-template-columns: 170px 1fr 60px; align-items: center; gap: 10px; font-size: .9rem; }
.bar .track { background: #eef1f5; border-radius: 4px; height: 20px; overflow: hidden; }
.bar .fill { background: var(--navy); height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 6px; color: #fff; font-size: .75rem; }
.bar .fill.pers { background: var(--green); }
.bar .val { text-align: right; font-weight: 600; }

/* Verlauf */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 14px; border-left: 3px solid var(--line); font-size: .9rem; }
.timeline li time { color: var(--muted); margin-right: 8px; }

/* Rangliste im Absagefall */
.rank { font-weight: 800; color: var(--green-dark); font-size: 1.1rem; }
.rank.first { color: #fff; background: var(--green); border-radius: 999px; padding: 2px 10px; }

/* Vorschau */
.preview { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: #fafbfd; white-space: pre-wrap; font-size: .93rem; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .88em; }

/* Login */
.login { max-width: 420px; margin: 60px auto; }
.login h1 { text-align: center; }

/* Öffentliche Seite */
body.public main { padding-top: 40px; }
body.public .card { padding: 32px; }
body.public h1 { font-size: 1.5rem; }
.big-ok { font-size: 3rem; color: var(--green); line-height: 1; margin-bottom: 10px; }

/* Mobil */
@media (max-width: 860px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-dark); flex-direction: column; padding: 10px 20px 14px; z-index: 10; }
  body.nav-open .nav { display: flex; }
  .top { position: relative; }
  .bar { grid-template-columns: 120px 1fr 44px; }
  th, td { padding: 8px; }
  .hide-m { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 1.5rem; }
  .brand img { height: 30px; }
}
@media print {
  .top, .filters, .actions, .foot, .burger { display: none !important; }
  .table-wrap { box-shadow: none; }
}
