/* =====================================================================
   TOURNADA — gedeelde stijl (landing + beheer)
   ===================================================================== */
:root {
  --indigo: #4f46e5;
  --indigo-d: #3730a3;
  --amber: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.05);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--indigo); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }

/* ---- Layout helpers ---- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hide { display: none !important; }

/* ---- Topbar ---- */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand .logo { width: 30px; height: 30px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  background: var(--indigo); color: #fff; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--indigo); border-color: var(--line); }
.btn.ghost:hover { background: #f1f5f9; filter: none; }
.btn.amber { background: var(--amber); color: #3b2600; }
.btn.danger { background: #fff; color: var(--err); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; filter: none; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo); border-color: var(--indigo); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: center; width: 1%; white-space: nowrap; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge.concept { background: #f1f5f9; color: #475569; }
.badge.gepubliceerd { background: #dcfce7; color: #166534; }
.badge.bezig { background: #fef3c7; color: #92400e; }
.badge.afgelopen { background: #e0e7ff; color: #3730a3; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0; overflow-x: auto; }
.tab { padding: 10px 14px; border: none; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

/* ---- Toast ---- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; animation: pop .2s ease; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ---- Landing ---- */
.hero { padding: 80px 0 60px; text-align: center; background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.hero.hero-foto { background: linear-gradient(rgba(15,23,42,.5), rgba(15,23,42,.66)), var(--hero-foto, none); background-size: cover; background-position: center; color: #fff; padding: 96px 0 84px; }
.hero.hero-foto h1 { color: #fff; }
.hero.hero-foto .lead { color: rgba(255,255,255,.92); }
.hero.hero-foto .pill { background: rgba(255,255,255,.22); color: #fff; }
.hero.hero-foto .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); background: transparent; }
.hero.hero-foto .btn.ghost:hover { background: rgba(255,255,255,.14); }
.sfeer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sfeer-grid img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; display: block; }
@media (max-width: 700px) { .sfeer-grid { grid-template-columns: repeat(2, 1fr); } .sfeer-grid img { height: 140px; } }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 14px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.pill { display: inline-block; background: #e0e7ff; color: var(--indigo-d); font-weight: 700; font-size: .8rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 20px; }
.section { padding: 56px 0; }
.section h2 { font-size: 1.8rem; margin: 0 0 8px; }
.feature { padding: 22px; }
.feature .ico { font-size: 1.8rem; }
.feature h3 { margin: 10px 0 6px; font-size: 1.15rem; }
.eco { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.eco .card { border-top: 4px solid var(--indigo); }
.eco .card.sportrs { border-top-color: var(--amber); }
.eco .card.commentada { border-top-color: #0ea5e9; }
footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }

/* ---- Publieke toernooipagina ---- */
.t-hero { background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-d) 100%); color: #fff; padding: 40px 0 34px; }
.t-hero.met-foto { background-size: cover; background-position: center; }
.t-hero .badge { background: rgba(255,255,255,.2); color: #fff; margin-bottom: 12px; }
.t-hero h1 { margin: 0; font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.t-meta { margin: 10px 0 0; opacity: .92; font-size: 1.02rem; }
.t-blokken { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.t-blok h2 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin: 0 0 10px; }
.t-blok .t-ico { font-size: 1.5rem; line-height: 1; }
.t-content { color: #334155; }
.t-content h3 { font-size: 1.12rem; margin: 16px 0 6px; }
.t-content h4 { font-size: 1rem; margin: 12px 0 4px; }
.t-content p { margin: 0 0 10px; }
.t-content ul { margin: 0 0 10px; padding-left: 20px; }
.t-content li { margin: 3px 0; }
.t-content a { color: var(--indigo); }
.t-score { text-align: center; font-weight: 700; white-space: nowrap; padding: 10px 14px; }

/* Verslag-foto's (publiek) */
.verslag-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }
.verslag-fotos figure { margin: 0; }
.verslag-fotos img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; display: block; }
.verslag-fotos figcaption { font-size: .82rem; color: #64748b; margin-top: 5px; }

/* Verslag-foto's (beheer) */
.v-foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0; }
.v-foto { position: relative; }
.v-foto img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.v-foto input { width: 100%; margin-top: 4px; font-size: .8rem; padding: 4px 6px; }
.v-foto-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(15,23,42,.72); color: #fff; cursor: pointer; line-height: 1; font-size: 15px; }

/* ---- Toernooikaart met banner ---- */
.t-kaart { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.t-banner { height: 130px; background-size: cover; background-position: center; background-color: #eef2ff; }
.t-banner.leeg { background: linear-gradient(135deg, var(--indigo), var(--indigo-d)); display: flex; align-items: center; justify-content: center; }
.t-banner.leeg svg { width: 46px; height: 46px; color: rgba(255,255,255,.55); }
.t-kaart-body { padding: 16px; }
.kosten-badge { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.kosten-badge.gratis { background: #dcfce7; color: #166534; }
.kosten-badge.betaald { background: #fef3c7; color: #92400e; }

/* ---- Teamlogo ---- */
.team-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: -6px; margin-right: 7px; }
.team-logo-groot { width: 34px; height: 34px; object-fit: contain; }
.team-logo-ph { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; vertical-align: -6px; margin-right: 7px; color: #cbd5e1; }
.team-logo-ph svg { width: 16px; height: 16px; }

/* ---- Wedstrijd-events ---- */
.ev-lijst { list-style: none; padding: 0; margin: 0 0 10px; }
.ev-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .9rem; }
.ev-marker { width: 12px; height: 12px; display: inline-block; flex: 0 0 auto; }
.ev-marker.ev-doelpunt { background: var(--indigo); border-radius: 50%; }
.ev-marker.ev-geel { background: #facc15; border-radius: 3px; }
.ev-marker.ev-rood { background: #dc2626; border-radius: 3px; }
.ev-del { margin-left: auto; border: none; background: none; color: var(--err); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.ev-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev-form select, .ev-form input { padding: 6px 8px; }

/* ---- Sponsoren ---- */
.sponsor-band { margin: 34px 0; }
.sponsor-band h2 { margin: 0 0 16px; }
.sponsor-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: center; }
.sponsor { display: inline-flex; align-items: center; }
.sponsor img { max-height: 56px; max-width: 160px; object-fit: contain; }
.sponsor span { font-weight: 700; color: var(--muted); }

/* ---- WYSIWYG-editor ---- */
.wysiwyg { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wy-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.wy-bar button { border: 1px solid transparent; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: .85rem; color: var(--ink); }
.wy-bar button:hover { background: #e2e8f0; }
.wy-edit { padding: 12px 14px; min-height: 120px; outline: none; line-height: 1.55; }
.wy-edit:focus { background: #fff; }
.wy-edit h3 { font-size: 1.1rem; margin: 10px 0 4px; }
.wy-edit ul { padding-left: 20px; }
.wy-edit a { color: var(--indigo); }

/* ---- Blok-iconen (strakke SVG) ---- */
.t-blok .t-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: #eef2ff; color: var(--indigo); flex: 0 0 auto; }
.blok-ico { display: inline-flex; align-items: center; color: var(--indigo); }
.feature .ico svg { width: 30px; height: 30px; color: var(--indigo); }
.eco-ico { color: var(--indigo); }
.eco-ico svg { width: 22px; height: 22px; vertical-align: -4px; }
.t-meta .meta-ico { width: 17px; height: 17px; vertical-align: -3px; opacity: .95; }
.meta-sep { opacity: .55; }

/* ---- Cookiebalk ---- */
.cookiebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--ink); color: #fff; padding: 14px 20px; display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; box-shadow: 0 -4px 20px rgba(15,23,42,.15); }
.cookiebar a { color: #c7d2fe; }
.cookiebar .cb-btns { display: flex; gap: 8px; }
.cb-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.cb-btn.cb-ja { background: var(--indigo); color: #fff; }
.cb-btn.cb-nee { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }

@media (max-width: 640px) {
  .field-row { flex-direction: column; }
  .hero { padding: 56px 0 40px; }
}
