/* VfR Klosterreichenbach — Design-Tokens und Grundstile des Turnierplaners.
   Abgeleitet aus dem Skill vfr-klosterreichenbach-design (Archivo, Crimson, Navy, Lucide-Stil). */
@font-face { font-family: 'Archivo'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 900; font-style: normal; font-display: swap; src: url('/fonts/archivo-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 400; font-style: italic; font-display: swap; src: url('/fonts/archivo-latin-400-italic.woff2') format('woff2'); }

:root {
  --brand: #C8102E; --brand-strong: #AB0D27; --brand-tint: #fcebed;
  --ink-900: #161d27; --ink: #232C3A; --ink-700: #36414f;
  --paper: #F7F9FB; --panel: #EEF1F5; --card: #ffffff;
  --line: #E1E6EC; --line-strong: #cdd5de;
  --muted: #7F8C9F; --body: #404856; --faint: #9aa6b4;
  --success: #1F8A3B; --success-tint: #e7f4ec; --warning: #F2A900; --warning-tint: #fdf1d6; --danger: #AB0D27; --info: #2563a8; --info-tint: #e7eff7;
  --night: #0E0F12;
  --radius-sm: 3px; --radius: 6px; --radius-lg: 10px; --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(18,18,18,.06); --shadow: 0 2px 8px rgba(18,18,18,.08); --shadow-lg: 0 8px 24px rgba(18,18,18,.12);
  --sidebar-w: 248px; --font: 'Archivo','Helvetica Neue',Arial,system-ui,sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 900; letter-spacing: -.02em; line-height: 1.08; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: 2.2rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.1rem; }
a { color: var(--brand-strong); text-decoration: none; } a:hover { text-decoration: underline; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.sub { color: var(--muted); font-style: italic; margin-top: -.2em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
button, .btn { font-family: var(--font); font-weight: 700; font-size: .95rem; cursor: pointer; border: 0; border-radius: var(--radius); padding: 10px 18px; background: var(--brand); color: #fff; transition: filter .12s, transform .08s, box-shadow .12s; }
button:hover, .btn:hover { filter: brightness(.93); }
button:active, .btn:active { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--panel); filter: none; }
.btn-ink { background: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
input, select, textarea { font-family: var(--font); font-size: .95rem; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
label { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 4px; }
.field { margin-bottom: 14px; } .field .hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: var(--pill); background: var(--ink); color: #fff; }
.badge.gray { background: var(--panel); color: var(--ink); } .badge.red { background: var(--brand); } .badge.green { background: var(--success); } .badge.amber { background: var(--warning); color: var(--ink); } .badge.blue { background: var(--info); }

/* ---- App-Shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 22px 20px 10px; font-weight: 900; font-size: 1.5rem; letter-spacing: -.03em; }
.sidebar .logo b { color: var(--brand); }
.onboard { margin: 8px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.onboard .bar { height: 6px; border-radius: var(--pill); background: var(--line); overflow: hidden; margin-top: 6px; }
.onboard .bar i { display: block; height: 100%; background: var(--brand); }
.nav { padding: 4px 12px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--ink); font-weight: 600; font-size: .92rem; margin-bottom: 2px; position: relative; }
.nav a:hover { background: var(--panel); text-decoration: none; }
.nav a.active { background: var(--panel); }
.nav a.active::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--brand); }
.nav a svg { width: 18px; height: 18px; stroke: currentColor; }
.nav .cta { background: var(--brand); color: #fff; justify-content: center; margin: 8px 0; }
.nav .cta:hover { filter: brightness(.93); background: var(--brand); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 22px; height: 56px; }
.topbar .title { font-weight: 800; font-size: 1.05rem; }
.topbar .spacer { flex: 1; }
.topbar .icons { display: flex; gap: 6px; }
.topbar .icons button { background: rgba(255,255,255,.1); color: #fff; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; }
.topbar .icons button svg { width: 18px; height: 18px; stroke: currentColor; }
.ctxbar { background: var(--brand); color: #fff; font-size: .85rem; padding: 7px 22px; }
.content { padding: 26px 28px; max-width: 1200px; width: 100%; }
.crest-tr { position: absolute; top: 12px; right: 18px; width: 54px; opacity: .9; }

/* ---- Tabellen ---- */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.data tr:hover td { background: var(--paper); }
.pill-count { display: inline-block; min-width: 70px; text-align: center; border-radius: var(--pill); padding: 2px 8px; font-weight: 700; font-size: .8rem; color: #fff; }

/* ---- Stat-Karten ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { background: var(--panel); border-radius: var(--radius); padding: 18px; border-top: 4px solid var(--brand); }
.stat .num { font-size: 2.6rem; font-weight: 900; color: var(--brand); line-height: 1; }
.stat .lbl { font-weight: 700; margin-top: 6px; }

/* ---- Feature-Kacheln (Dashboard) ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.icontile { width: 56px; height: 56px; border-radius: var(--pill); background: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.icontile svg { width: 26px; height: 26px; stroke: #fff; }

/* ---- Modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(14,15,18,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); max-width: 820px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal .head { position: sticky; top: 0; background: var(--panel); padding: 16px 22px; display: flex; align-items: center; border-bottom: 1px solid var(--line); z-index: 1; }
.modal .head h3 { margin: 0; }
.modal .body { padding: 22px; }
.modal .foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 14px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.modal .x { margin-left: auto; background: transparent; color: var(--ink); width: 32px; height: 32px; padding: 0; }

/* ---- Banner ---- */
.banner { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 22px 26px; font-weight: 800; font-size: 1.15rem; text-align: center; }
.banner.ink { background: var(--ink); }

/* ---- Toast ---- */
.toasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 340px; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--success); }

/* ---- Turnierplan ---- */
.phase-title { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; }
.phase-title h3 { margin: 0; }
.match { display: grid; grid-template-columns: 34px 1fr auto 1fr 56px; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.match:hover { background: var(--paper); }
.match.active { border-left-color: var(--brand); background: var(--brand-tint); }
.match .nr { color: var(--muted); font-size: .8rem; }
.match .ta { text-align: right; } .match .tb { text-align: left; }
.match .score { font-weight: 800; white-space: nowrap; }
.match .score input { width: 42px; text-align: center; padding: 4px; display: inline-block; }
.match .meta { color: var(--muted); font-size: .78rem; }

/* ---- Suche-Karten ---- */
.search-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.search-card h4 { margin: 0 0 8px; }

/* ---- Login ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .hero { background: var(--ink) url('/assets/sportplatz-willkommen.jpg') center/cover; position: relative; }
.auth .hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(14,15,18,.82), rgba(171,13,39,.5)); }
.auth .hero .cap { position: absolute; left: 36px; bottom: 36px; right: 36px; color: #fff; z-index: 1; }
.auth .form-wrap { display: grid; place-items: center; padding: 30px; }
.auth .form-wrap .inner { width: 100%; max-width: 380px; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 24px; padding: 30px 28px; background: var(--ink); color: var(--text-on-ink, #aeb7c2); margin-top: auto; }
.footer-links h5 { color: #fff; margin: 0 0 10px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.footer-links a { color: #aeb7c2; display: block; font-size: .85rem; padding: 2px 0; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .content { padding: 18px 16px; }
  .auth { grid-template-columns: 1fr; } .auth .hero { display: none; }
  .menu-btn { display: grid !important; }
  .match { grid-template-columns: 26px 1fr auto 1fr; } .match .meta.feld { display: none; }
}
.menu-btn { display: none; background: rgba(255,255,255,.1); color: #fff; width: 36px; height: 36px; padding: 0; place-items: center; }

/* Icons in Buttons klein und bündig */
button svg, .btn svg { width: 15px; height: 15px; vertical-align: -2px; stroke: currentColor; }
.icontile svg, .topbar .icons button svg, .nav a svg, .menu-btn svg { width: unset; height: unset; }
.icontile svg { width: 26px; height: 26px; }
.nav a svg { width: 18px; height: 18px; }
.topbar .icons button svg, .menu-btn svg { width: 18px; height: 18px; }
a.btn svg { width: 15px; height: 15px; }
