/* Bambini-App styles – adapted from architecture/mockup-reference.html.
   Differences from the mock-up: the real app is a multi-page server app,
   so the bottom nav uses <a> links (.navlink) instead of buttons, and there
   is no .screen/.roleswitch SPA machinery. Design tokens, cards, forms,
   buttons etc. are kept 1:1 with the mock-up. */

:root {
  --pitch: #025296;
  --pitch-deep: #011B31;
  --ink: #16222E;
  --muted: #56687A;
  --bg: #EEF2F7;
  --card: #FFFFFF;
  --line: #D9E2EC;
  --kit: #FFFFFF;
  --rot: #D14B4B;
  --gelb: #E0A32E;
  --gruen: #2F8F57;
  --radius: 14px;
  --display: 'Arial Rounded MT Bold', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --body: system-ui, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(160deg, #0E2B47, #050E18);
  font-family: var(--body);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}
.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px #0006;
}
@media (min-width: 500px) {
  .phone { min-height: calc(100vh - 48px); margin: 24px 0; border-radius: 32px; overflow: hidden; }
}

/* App bar */
.appbar { background: var(--pitch-deep); color: #fff; padding: 14px 16px 12px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.badge { width: 40px; height: 40px; border-radius: 50%; background: var(--kit); color: var(--pitch-deep); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 15px; font-weight: 700; flex: none; border: 2px solid #fff3; overflow: hidden; }
.badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.appbar h1 { font-family: var(--display); font-size: 18px; margin: 0; line-height: 1.15; letter-spacing: .2px; }
.appbar .sub { font-size: 11.5px; opacity: .75; margin-top: 1px; }
.rtag { margin-left: auto; flex: none; background: #ffffff22; color: #fff; border: 1px solid #ffffff40; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; }

/* Content */
main { flex: 1; overflow-y: auto; padding: 16px 16px 96px; }
h2 { font-family: var(--display); font-size: 20px; margin: 6px 0 14px; text-wrap: balance; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
p { line-height: 1.5; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.evhead { display: flex; align-items: flex-start; gap: 10px; }
.evwhen { flex: none; width: 52px; text-align: center; background: var(--bg); border-radius: 10px; padding: 7px 4px; }
.evwhen .d { font-family: var(--display); font-size: 17px; line-height: 1; }
.evwhen .m { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 3px; }
.evtitle { font-weight: 700; font-size: 15px; line-height: 1.3; }
.evmeta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.chip { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; vertical-align: 1px; }
.chip.training { background: #DCE8F5; color: var(--pitch); }
.chip.spiel { background: var(--pitch); color: #fff; }
.chip.abgesagt { background: #F4DEDE; color: var(--rot); }
.cancelled .evtitle { text-decoration: line-through; color: var(--muted); }

/* Kid toggle rows */
.kidrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.kidname { font-weight: 600; font-size: 14px; }
.kidrow .seg { margin-left: auto; display: flex; background: var(--bg); border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: transparent; font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 99px; cursor: pointer; color: var(--muted); min-height: 40px; min-width: 40px; font-family: var(--body); }
.seg button.zu.on { background: var(--gruen); color: #fff; }
.seg button.ab.on { background: var(--rot); color: #fff; }

/* Helper lists */
.slot { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.slot:last-child { border-bottom: 0; }
.slot .t { flex: 1; min-width: 0; }
.slot .who { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.slot .cnt { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.slot .cnt.full { color: var(--gruen); }
.btn { border: 0; border-radius: 10px; font-weight: 700; font-size: 13px; padding: 10px 14px; cursor: pointer; font-family: var(--body); min-height: 40px; }
.btn.small { padding: 7px 12px; min-height: 40px; font-size: 12px; }
.btn.pri { background: var(--pitch); color: #fff; }
.btn.sec { background: #DCE8F5; color: var(--pitch); }
.btn.danger { background: #F4DEDE; color: var(--rot); }
.btn.ghost { background: transparent; color: var(--pitch-deep); text-decoration: underline; padding: 6px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { display: block; width: 100%; margin-top: 10px; }

/* Ampel */
.ampel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.ampel .dot { width: 9px; height: 9px; border-radius: 50%; }
.ampel.rot { background: #FBEAEA; color: var(--rot); } .ampel.rot .dot { background: var(--rot); }
.ampel.gelb { background: #FAF0DC; color: #9A6E15; } .ampel.gelb .dot { background: var(--gelb); }
.ampel.gruen { background: #E5F2E9; color: var(--gruen); } .ampel.gruen .dot { background: var(--gruen); }

/* Event card vertical rhythm (CSP-safe: classes only, no inline styles) */
.evampel { margin-top: 8px; }
.evaction { display: inline-block; margin-top: 12px; }
.evcoaches { margin-top: 10px; }

/* Trainer lists */
.tl-row { display: flex; align-items: center; gap: 10px; }
.tl-row .grow { flex: 1; min-width: 0; }
.arrow { color: var(--muted); flex: none; }
.person { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.person:last-child { border-bottom: 0; }
.person .com { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; max-width: 45%; }
.stat { display: flex; gap: 8px; margin: 10px 0; }
.stat div { flex: 1; background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.stat b { font-family: var(--display); font-size: 20px; display: block; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* WhatsApp box */
.wabox { background: #E9F6EC; border: 1px solid #CBE5D2; border-radius: 10px; padding: 12px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.5; font-family: ui-monospace, Consolas, monospace; }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 700; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 14px; background: #fff; font-family: var(--body);
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: 13px; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--pitch); }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 10px; padding: 9px 11px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; overflow: hidden; }
.linkbox span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

/* Status pills family list */
.pill { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.pill.ok { background: #E5F2E9; color: var(--gruen); }
.pill.warn { background: #FAF0DC; color: #9A6E15; }

/* Diff table */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; }
.tag.neu { background: #E5F2E9; color: var(--gruen); }
.tag.upd { background: #FAF0DC; color: #9A6E15; }
.tag.err { background: #FBEAEA; color: var(--rot); }
.old { color: var(--muted); text-decoration: line-through; font-size: 11px; display: block; }
.tablewrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }

/* Upload zone */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); font-size: 13px; background: #fff; cursor: pointer; }
.drop b { color: var(--pitch-deep); }

/* Banner */
.banner { background: #FFF7E4; border: 1px solid #F0DFAF; border-radius: var(--radius); padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; margin-bottom: 14px; line-height: 1.4; }
.banner button { flex: none; }

/* Calendar buttons */
.calbtn { display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 10px; font-family: var(--body); text-align: left; }
.calbtn .ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--display); font-size: 15px; flex: none; }
.calbtn small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 1px; }

/* Bottom nav (real app: <a> links, multi-page navigation) */
nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #fff; border-top: 1px solid var(--line); display: flex; padding: 6px 0 max(8px, env(safe-area-inset-bottom)); z-index: 20; }
@media (min-width: 500px) { nav { bottom: 24px; border-radius: 0 0 32px 32px; overflow: hidden; } }
nav a.navlink { flex: 1; border: 0; background: none; font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 40px; font-family: var(--body); text-decoration: none; }
nav a.navlink svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a.navlink.on { color: var(--pitch-deep); }
nav a.navlink.on svg { stroke-width: 2.3; }

/* Toast + modal */
#toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; font-size: 13px; padding: 11px 18px; border-radius: 99px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 88%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#modal { position: fixed; inset: 0; background: #0007; display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
#modal.show { display: flex; }
.mbox { background: #fff; border-radius: 18px; padding: 20px; max-width: 340px; width: 100%; }
.mbox h4 { margin: 0 0 8px; font-size: 16px; font-family: var(--display); }
.mbox p { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.mbox .row { display: flex; gap: 8px; justify-content: flex-end; }
.mbox input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 14px; margin: 0 0 16px; font-family: var(--body); }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #177490; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
a { color: var(--pitch-deep); }
