:root { --navy: #0F2A4A; --gold: #C7A140; --ink: #1c2430; --muted: #5b6673; --line: #dfe3e8; --bg: #f7f8fa; --card: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root { --ink: #e8ecf1; --muted: #9aa5b1; --line: #33404f; --bg: #12171f; --card: #1a2029; --navy: #7fa3d1; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
header { background: #0F2A4A; color: #fff; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
header h1 { font-size: 16px; margin: 0; font-weight: 600; }
header h1::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 10px; }
header nav { margin-left: auto; display: flex; gap: 16px; }
header a { color: #fff; opacity: .85; text-decoration: none; }
header a:hover { opacity: 1; }
main { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 20px; }
h2 { font-size: 17px; margin: 0 0 8px; color: var(--navy); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=url], input[type=email], input[type=date], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: inherit; background: transparent; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
button { padding: 8px 14px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button.quiet { background: transparent; color: var(--navy); }
button.small { padding: 4px 10px; font-size: 13px; font-weight: 500; }
.row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.status { min-height: 20px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stats div b { display: block; font-size: 22px; color: var(--navy); }

/* Kostenübersicht */
.periods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.period { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 14px;
  padding: 4px 13px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.period.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi b { display: block; font-size: 21px; color: var(--navy); line-height: 1.25; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin: 6px 0 4px; }
.bars i { flex: 1; background: var(--navy); opacity: .75; border-radius: 2px 2px 0 0; min-height: 2px; display: block; }
.bars i:hover { opacity: 1; }
.barlabels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.rates td input { width: 90px; padding: 4px 7px; }
h3 { font-size: 14px; margin: 20px 0 2px; color: var(--muted); font-weight: 600; }
details summary { cursor: pointer; font-size: 13.5px; color: var(--navy); margin-top: 14px; }

/* Reiter in der Verwaltung */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.tabs .tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 15px;
  font-weight: 600; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.on { color: var(--navy); border-bottom-color: var(--gold); }
.tabs .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; border-radius: 4px; }
.panel.hidden { display: none; }
.hidden { display: none; }
.tabs .badge { display: inline-block; margin-left: 7px; min-width: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--gold); color: #2a2208; font-size: 12px; font-weight: 700; }
/* Muss spezifischer sein als die Regel darüber, sonst bleibt das Abzeichen bei null sichtbar */
.tabs .badge.hidden { display: none; }
.stylerow td { background: var(--bg); padding: 14px 10px 16px; }
.stylerow textarea { min-height: 90px; }
