:root {
  --blue-deep: #084a99;   /* dunkleres Vereinsblau: Kopfleiste, Login (weiße Schrift) */
  --blue: #0b6ad8;        /* Shirt-Blau: primäre Buttons, aktive Tabs */
  --accent: #a5d400;      /* Limettengrün (Wappen): Nummern-Badge, Fortschrittsbalken */
  --success: #198754;     /* Statusfarbe „anwesend/bezahlt" */
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1a1d1f;
  --muted: #6b7280;
  --border: #e3e5e8;
  --red: #dc3545;
  --amber: #f59e0b;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--blue-deep);
}
.login-card {
  background: var(--card); border-radius: var(--radius); padding: 28px 22px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.login-card h1 { margin: 0 0 4px; font-size: 26px; }
.login-card input {
  width: 100%; padding: 15px; font-size: 18px; margin: 18px 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
}

/* ---------- Buttons ---------- */
button { font-family: inherit; cursor: pointer; }
.btn-primary {
  width: 100%; padding: 15px; font-size: 18px; font-weight: 600;
  background: var(--blue); color: #fff; border: none; border-radius: 10px;
}
.btn-primary:active { background: var(--blue-deep); }
.btn-sm {
  padding: 9px 14px; font-size: 15px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
}
.btn-danger { color: var(--red); border-color: #f3c2c7; background: #fff; }
.btn-add {
  position: sticky; bottom: calc(76px + var(--safe-bottom)); margin-left: auto;
  display: block; width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue); color: #fff; border: none; font-size: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--blue-deep); color: #fff; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 20px; font-weight: 600;
}
.badge { font-size: 12px; font-weight: 600; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 20px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.logout-btn {
  font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  padding: 5px 12px; border-radius: 20px;
}
.logout-btn:active { background: rgba(255,255,255,.3); }

/* ---------- Content ---------- */
main {
  padding: 14px 14px calc(90px + var(--safe-bottom));
  max-width: 640px; margin: 0 auto;
}
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-name { font-weight: 600; }
.sub { font-size: 14px; color: var(--muted); }
.section-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 4px 8px; }
.inactive { opacity: .5; }
.num {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--blue-deep); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}

/* ---------- Anwesenheit Statusknöpfe ---------- */
.att-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.att-row:last-child { border: none; }
.att-name { flex: 1; font-weight: 600; }
.att-btns { display: flex; gap: 6px; }
.att-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.att-btn.on-present { background: var(--success); border-color: var(--success); color: #fff; }
.att-btn.on-absent  { background: var(--red); border-color: var(--red); color: #fff; }
.att-btn.on-excused { background: var(--amber); border-color: var(--amber); color: #fff; }
.att-quick-btns { display: flex; gap: 8px; }
.att-quick-btns button { flex: 1; }

/* ---------- Chips / Pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.pill-open { background: #fde8e8; color: var(--red); }
.pill-paid { background: #e6f4ea; color: var(--success); }
.amount { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Auswertung Summen ---------- */
.totals { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.total-box { background: var(--card); border-radius: var(--radius); padding: 14px 8px; text-align: center; }
.total-box .val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.total-box .lbl { font-size: 12px; color: var(--muted); }
.bar { height: 8px; background: var(--border); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.tab {
  flex: 1; border: none; background: none; padding: 8px 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 21px; color: var(--muted);
}
.tab span { font-size: 10px; }
.tab.active { color: var(--blue); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 20; }
.modal-card {
  background: #fff; width: 100%; border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom));
  max-height: 90vh; overflow-y: auto; animation: slideup .2s ease;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-card h2 { margin: 0 0 14px; font-size: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 13px; font-size: 17px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions button { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Mehrfachauswahl der Spieler (Strafen erfassen) */
.chip-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 42vh; overflow-y: auto; padding: 2px;
}
.chip {
  padding: 10px 14px; border-radius: 22px; border: 1px solid var(--border);
  background: #fff; font-size: 15px; color: var(--text);
}
.chip b { font-variant-numeric: tabular-nums; margin-right: 2px; }
.chip.sel { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Links-Seite */
.link-item { flex: 1; text-decoration: none; color: inherit; display: block; min-width: 0; }
.link-item .sub { word-break: break-all; }
