:root {
  --bg: #f4f6f5; --fg: #1d2521; --muted: #66706b; --card: #fff; --line: #dde3df;
  --brand: #d7141a; --brand-dark: #a30f14; --action: #1d3f9a; --action-dark: #152f75; --ok: #15803d; --danger: #b91c1c; --warn: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .4em 0 .6em; }
h2 { font-size: 1.15rem; margin-top: 1.6em; }
a { color: var(--action); }
.muted { color: var(--muted); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 16px; background: var(--brand); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 44px; width: auto; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
.login-logo { display: block; height: 140px; margin: 10px 0 18px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 10px; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.18); }
.topbar .user { font-size: .9rem; }
.badge { background: #fbbf24; color: #1d2521; border-radius: 10px; padding: 0 7px; font-size: .8rem; font-weight: 700; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 8px 0; background: #dcfce7; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; border-color: #fca5a5; }
.flash-warn { background: #fef3c7; border-color: #fcd34d; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 420px; }
label { display: block; margin-bottom: 10px; font-size: .9rem; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--fg); }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c5cdc8; border-radius: 6px; background: #fff; color: var(--fg); }
label input:not([type=checkbox]), label select, label textarea { display: block; width: 100%; margin-top: 3px; }
input.short { width: 80px; }
input[type=color] { padding: 2px; width: 48px; height: 34px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

button, .btn { display: inline-block; font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--action); background: var(--action); color: #fff; cursor: pointer; text-decoration: none; }
.btn { background: #fff; color: var(--action); }
.btn.active { background: var(--action); color: #fff; }
button.ok { background: var(--ok); border-color: var(--ok); }
button.danger { background: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
.toolbar, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.row input { flex: 1; min-width: 200px; }
form.inline { display: inline; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; margin: 8px 0 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pending-swatch { background: repeating-linear-gradient(45deg, #999 0 3px, #fff 3px 6px); border: 1px solid #999; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
thead th { background: #eef2ef; font-size: .9rem; }
table.list td input:not([type=checkbox]):not([type=color]) { width: 100%; }
tr.new td { background: #f7fbf8; }
tr.inactive td { color: var(--muted); }

table.week { min-width: 900px; table-layout: fixed; }
table.week th:first-child { width: 140px; }
table.week th.today { background: #d1fae5; }
table.week th.pitch small { display: block; font-weight: 400; color: var(--muted); }
table.week td { position: relative; padding: 4px 4px 22px; min-height: 60px; }
.slot { display: block; margin-bottom: 4px; padding: 4px 6px; border-radius: 5px; font-size: .8rem; text-decoration: none; color: #fff;
        background: var(--c); border-left: 4px solid rgba(0,0,0,.25); overflow-wrap: anywhere; }
.slot small { display: block; opacity: .9; }
.slot.pending { color: var(--fg); background: repeating-linear-gradient(45deg, #fff 0 6px, #f1f1f1 6px 12px); border: 1px dashed var(--c); border-left: 4px solid var(--c); }
.add { position: absolute; right: 4px; bottom: 2px; font-size: 1.1rem; text-decoration: none; color: var(--muted); opacity: .4; }
td:hover .add { opacity: 1; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; color: #fff; background: var(--c); }
.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #e5e7eb; color: #374151; }

fieldset.series { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; }
.weekdays { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-bottom: 6px; }
.weekdays label.check { margin: 0; }

pre.log { white-space: pre-wrap; font-size: .82rem; background: #f6f8f7; border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 360px; overflow: auto; }

.slot .share { float: right; margin-left: 4px; padding: 0 5px; border-radius: 8px; background: rgba(255,255,255,.3); font-weight: 700; }
.slot.pending .share { background: rgba(0,0,0,.08); }

@media print {
  .topbar, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  table { font-size: 11px; }
  a { color: inherit; text-decoration: none; }
}

/* Farbe nach Altersstufe: Hintergrund = Altersstufe, linker Rand = Kategorie */
.slot { color: var(--t, #fff); border-left: 6px solid var(--k, rgba(0,0,0,.25)); }
.slot.pending { color: var(--fg); border-left: 6px solid var(--c); }
.chip { color: var(--t, #fff); }
.team-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.team-preview .chip { font-size: .85rem; padding: 3px 10px; }
.nowrap { white-space: nowrap; }

/* Hilfe-Bereich */
.help-list { display: grid; gap: 12px; }
.help-item { display: flex; gap: 16px; align-items: flex-start; margin: 0; }
.help-item h2 { margin: 0 0 4px; font-size: 1.1rem; }
.help-item p { margin: 4px 0; }
.help-icon { flex: none; width: 48px; height: 60px; border-radius: 4px; background: var(--brand); color: #fff; font-weight: 700; font-size: .8rem; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
