/* Sport Organizer Admin. Gleiche Farben wie App und Webseite (DESIGN.md), dichter für Verwaltungsarbeit. */
:root {
  --accent: #1f3fa6; --accent-ink: #fff; --accent-soft: #e6ebfa;
  --bg: #f5f6f8; --surface: #fff; --surface-2: #edeff3;
  --text: #12161f; --muted: #4a5363; --line: #dfe3ea;
  --yes: #1b7f4b; --no: #c2362b; --maybe: #9a6700;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8ea6ff; --accent-ink: #0e1117; --accent-soft: #1d2540;
    --bg: #0e1117; --surface: #171b23; --surface-2: #1f242e;
    --text: #edeff4; --muted: #a6aebd; --line: #2a303c;
    --yes: #4cc38a; --no: #ff7b70; --maybe: #e3b341;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 720; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot, .muted { color: var(--muted); }
.boot { padding: 48px; text-align: center; }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 8px 16px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; line-height: 1.1; }
.side nav { display: grid; gap: 2px; }
.side a.nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 580; }
.side a.nav:hover { background: var(--surface-2); color: var(--text); }
.side a.nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side .me { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.side .me button { margin-top: 8px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
main { padding: 28px clamp(16px, 3vw, 40px) 64px; min-width: 0; max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.crumb { font-size: .88rem; margin-bottom: 6px; }

/* Bausteine */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--no); border-color: color-mix(in srgb, var(--no) 45%, var(--line)); }
.btn.danger.solid { background: var(--no); color: #fff; border-color: var(--no); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card > h2 small { font-weight: 500; color: var(--muted); font-size: .82rem; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.7rem; font-weight: 720; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .86rem; }
.kpi .s { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); margin-bottom: 16px; }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 16px; }

/* Tabellen */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card .tablewrap { border: 0; border-radius: 0; margin: 0 -18px -18px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .82rem; padding: 10px 14px; background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.act { white-space: nowrap; text-align: right; }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 99px; border: 1.5px solid currentColor; white-space: nowrap; }
.tag.yes { color: var(--yes); } .tag.no { color: var(--no); } .tag.maybe { color: var(--maybe); } .tag.info { color: var(--accent); } .tag.plain { color: var(--muted); }

/* Suche und Formulare */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
input[type=search], input[type=text], input[type=email], input[type=password], select { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); width: 100%; }
input:focus, select:focus { border-color: var(--accent); }
.toolbar input[type=search] { max-width: 360px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .88rem; }
label small { font-weight: 400; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--no); font-size: .9rem; min-height: 1.3em; }

/* Diagramme */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { opacity: .75; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.barlist { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.barlist li { display: grid; gap: 4px; }
.barlist .top { display: flex; justify-content: space-between; gap: 8px; }
.barlist .track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.barlist .fill { height: 100%; border-radius: 99px; background: var(--accent); }
.barlist .fill.yes { background: var(--yes); } .barlist .fill.no { background: var(--no); } .barlist .fill.maybe { background: var(--maybe); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(420px, 100%); padding: 28px; display: grid; gap: 18px; }
.login .brand { padding: 0; }

/* Dialog und Hinweise */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 24px; width: min(520px, calc(100% - 32px)); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
dialog::backdrop { background: rgba(8, 10, 16, .55); }
dialog h2 { margin-bottom: 4px; font-size: 1.2rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
dialog code, .code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; max-width: 360px; font-weight: 550; }
.toast.bad { background: var(--no); color: #fff; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; }
  .brand { padding: 4px 8px; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side a.nav { min-height: 44px; }
  .side .me { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 8px; }
  .side .me span { display: none; }
  .side .me button { margin: 0; }
  .form .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.mship { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; }
td .btn[data-link] { margin-top: 6px; }
