:root {
  --navy: #1b2a6b;
  --navy-2: #2d3f8f;
  --rot: #c8102e;
  --gruen: #1f7a4a;
  --gelb: #b7791f;
  --grau: #f3f4f7;
  --linie: #d8dbe3;
  --text: #1d2130;
  --muted: #6b7185;
  --radius: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grau); }
a { color: var(--navy-2); }
header.top {
  background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1.5rem;
  padding: .55rem 1.2rem; position: sticky; top: 0; z-index: 10;
}
header.top .logo { font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; color: #fff; text-decoration: none; white-space: nowrap; }
header.top .logo span { color: #ff6b7d; }
header.top nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
header.top nav a { color: #dfe4ff; text-decoration: none; padding: .35rem .65rem; border-radius: var(--radius); }
header.top nav a:hover, header.top nav a.aktiv { background: rgba(255,255,255,.14); color: #fff; }
header.top .user { font-size: .85rem; color: #c9cff0; white-space: nowrap; }
header.top .user a, header.top .user button { color: #fff; background: none; border: 0; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
main { max-width: 1400px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
h1 .nr { background: var(--rot); color: #fff; padding: .1rem .55rem; border-radius: var(--radius); font-size: 1.1rem; }
h1 .ref { background: var(--navy); color: #fff; padding: .1rem .55rem; border-radius: var(--radius); font-size: 1.1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; color: var(--navy); }
.karte { background: #fff; border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kacheln { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.kachel { background: #fff; border: 1px solid var(--linie); border-radius: 10px; padding: .8rem 1rem; text-decoration: none; color: var(--text); }
.kachel b { display: block; font-size: 1.7rem; color: var(--navy); }
.kachel.warn b { color: var(--rot); }
.kachel:hover { border-color: var(--navy-2); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .42rem .55rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
th { background: #e8ebf3; font-weight: 600; font-size: .85rem; color: #39405a; }
tr:hover td { background: #f7f8fc; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.storno td { color: var(--muted); text-decoration: line-through; }
.tabelle { border: 1px solid var(--linie); border-radius: 10px; overflow: auto; }
.btn, button.btn {
  display: inline-block; padding: .45rem .9rem; border-radius: var(--radius); border: 1px solid var(--navy);
  background: var(--navy); color: #fff; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600;
}
.btn.zweit { background: #fff; color: var(--navy); }
.btn.rot { background: var(--rot); border-color: var(--rot); }
.btn.klein { padding: .2rem .55rem; font-size: .85rem; font-weight: 500; }
.leiste { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.leiste form { display: flex; gap: .4rem; }
input, select, textarea {
  font: inherit; padding: .38rem .5rem; border: 1px solid #b9bfcf; border-radius: var(--radius); background: #fff; width: 100%;
}
input[type=checkbox] { width: auto; transform: scale(1.2); }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fa2ff; border-color: var(--navy-2); }
.leiste input, .leiste select { width: auto; }
.formular { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem 1rem; }
.formular .feld.breit { grid-column: 1 / -1; }
.feld label { display: block; font-size: .8rem; font-weight: 600; color: #4a5170; margin-bottom: .2rem; }
.feld .hilfe { font-size: .75rem; color: var(--muted); }
.feld .fehler, .errorlist { color: var(--rot); font-size: .82rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.feld.checkbox { display: flex; align-items: center; gap: .5rem; padding-top: 1.2rem; }
.feld.checkbox label { margin: 0; }
fieldset { border: 1px solid var(--linie); border-radius: 10px; padding: .8rem 1rem 1rem; margin: 0 0 1rem; background: #fff; }
legend { font-weight: 700; color: var(--navy); padding: 0 .4rem; }
.msg { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .6rem; background: #e7f4ec; border: 1px solid #b7dec6; }
.msg.error { background: #fde8eb; border-color: #f3b9c2; }
.msg.info { background: #eaf0ff; border-color: #c3d1ff; }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #e4e7f0; color: #39405a; }
.badge.ok { background: #dcf2e4; color: var(--gruen); }
.badge.offen { background: #fdecc8; color: #8a5a00; }
.badge.rot { background: #fde0e4; color: var(--rot); }
dl.daten { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.daten dt { color: var(--muted); font-size: .85rem; }
dl.daten dd { margin: 0; font-weight: 500; }
.summe { font-weight: 700; border-top: 2px solid var(--text); }
.hinweis { color: var(--muted); font-size: .85rem; }
.live { padding: .7rem 1rem; border-radius: 8px; background: #eef1fb; border: 1px dashed #aab4e0; margin-bottom: 1rem; }
.live.belegt { background: #fde8eb; border-color: var(--rot); }
/* Belegungsplan */
.plan { font-size: .75rem; }
.plan th, .plan td { padding: 0; border: 1px solid #e3e6ee; text-align: center; min-width: 26px; height: 24px; }
.plan th.haus, .plan td.haus { text-align: left; padding: 0 .4rem; min-width: 150px; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }

.plan td.b { background: var(--navy-2); }
.plan td.b a { display: block; width: 100%; height: 100%; }
.plan td.s { background: repeating-linear-gradient(45deg, #ccc, #ccc 3px, #eee 3px, #eee 6px); }
.plan td.frei:hover { background: #dfe6ff; }
.plan td.frei a { display: block; width: 100%; height: 100%; }
.legende span { display: inline-block; width: 14px; height: 14px; vertical-align: middle; margin: 0 .3rem 0 .8rem; border-radius: 3px; }
@media print {
  header.top, .leiste, .noprint, .msg { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  th { position: static; }
}
