/* ==============================================
   DTM — STYLESHEET
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
    --bg:          #0d1117;
    --surface:     #161b22;
    --surface-2:   #21262d;
    --surface-3:   #2d333b;
    --border:      rgba(255,255,255,0.08);
    --border-hi:   rgba(255,255,255,0.16);
    --text:        #e6edf3;
    --text-dim:    #adbac7;
    --text-muted:  #7d8590;

    --teal:        #2dd4bf;
    --teal-bg:     rgba(45,212,191,0.1);
    --teal-border: rgba(45,212,191,0.25);

    --red:         #f43f5e;
    --red-bg:      rgba(244,63,94,0.1);
    --red-border:  rgba(244,63,94,0.25);

    --gold:        #f59e0b;
    --gold-bg:     rgba(245,158,11,0.1);
    --gold-border: rgba(245,158,11,0.3);

    --silver:      #94a3b8;
    --amber:       #fbbf24;

    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   14px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
    --shadow:      0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
}

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    padding: 12px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1400px; margin: 0 auto; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }

h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.2em;
}
h1 span { color: var(--red); }

.live-badge { text-align: center; }
.live-badge span {
    background: var(--red);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
    animation: pulse 2s infinite;
}
.toernooi-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.stats-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78em;
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s;
}
.stats-badge:hover { background: rgba(45,212,191,0.18); color: var(--teal); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.timestamp { text-align: center; color: var(--text-muted); margin-bottom: 28px; font-size: 0.85em; }

/* ── Links ── */
a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.15s, opacity 0.15s;
}
a:hover { color: #5ee8d4; }

.text-link {
    color: var(--teal);
    text-decoration: none;
    position: relative;
    padding-bottom: 1px;
}
.text-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 1px;
    background: var(--teal);
    transition: width 0.2s ease;
}
.text-link:hover { color: #5ee8d4; }
.text-link:hover::after { width: 100%; }

.poule-link {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.poule-link:hover { color: #fb6f86; }

/* ── Badges ── */
.badge-spelvorm {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 5px;
}
.badge-baan {
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    color: var(--teal);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.76em;
    font-weight: 600;
    white-space: nowrap;
}
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    border-radius: 20px;
    color: var(--teal);
    font-size: 0.88em;
    margin-bottom: 20px;
}
.guest-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.88em;
    margin-bottom: 20px;
}
.ronde-badge { padding: 4px 12px; border-radius: 20px; font-weight: 600; font-size: 0.88em; }
.a-ronde .ronde-badge { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border); }
.b-ronde .ronde-badge { background: rgba(148,163,184,0.1); color: var(--silver); border: 1px solid rgba(148,163,184,0.25); }
.status-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.76em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-gepland  { background: rgba(251,191,36,0.15); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }
.status-actief   { background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-border); }
.status-voltooid { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--teal);
    color: #0d1117;
}
.btn-primary:hover {
    background: #5ee8d4;
    color: #0d1117;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45,212,191,0.35);
}
.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--teal-bg);
    color: var(--teal);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius-sm);
    font-size: 0.82em;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-small:hover {
    background: rgba(45,212,191,0.2);
    color: #e6edf3;
    border-color: var(--teal);
}
.btn-small-success {
    background: var(--teal-bg);
    color: var(--teal);
    border: 1px solid var(--teal-border);
}
.btn-small-success:hover {
    background: rgba(45,212,191,0.2);
    color: #e6edf3;
    border-color: var(--teal);
}
.btn-small-warning {
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid var(--gold-border);
}
.btn-small-warning:hover {
    background: rgba(245,158,11,0.2);
    color: #e6edf3;
    border-color: var(--gold);
}
.btn-large {
    padding: 11px 22px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    font-family: inherit;
}
.btn-success {
    background: var(--teal);
    color: #0d1117;
}
.btn-success:hover {
    background: #5ee8d4;
    color: #0d1117;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45,212,191,0.3);
}
.btn-danger {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.btn-danger:hover {
    background: #fb6f86;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(244,63,94,0.3);
}
.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-hi);
}
.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-hi);
}
.btn-icon {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 1.1em;
    transition: transform 0.15s, opacity 0.15s;
    padding: 4px;
}
.btn-icon:hover { transform: scale(1.2); opacity: 0.8; }
.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 10px 22px;
    background: var(--red);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all 0.15s;
}
.back-link:hover {
    color: #fff;
    background: #fb6f86;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244,63,94,0.35);
}
.btn-close {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-close:hover { background: rgba(244,63,94,0.2); transform: scale(1.1); }

.knockout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--gold);
    color: #0d1117;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.15s;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.knockout-btn:hover {
    background: #fbbf24;
    color: #0d1117;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245,158,11,0.4);
}
.score-invoer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 22px;
    background: var(--teal);
    color: #0d1117;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all 0.15s;
}
.score-invoer-link:hover {
    background: #5ee8d4;
    color: #0d1117;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45,212,191,0.3);
}

/* Quick-match-style compact buttons (kept for reuse) */
.btn-k {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    font-family: inherit; font-size: 0.82em; font-weight: 600;
    text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.btn-k-primary { background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-border); }
.btn-k-primary:hover { background: rgba(45,212,191,0.22); color: #e6edf3; }
.btn-k-success { background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-border); }
.btn-k-success:hover { background: rgba(45,212,191,0.22); color: #e6edf3; }
.btn-k-danger  { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.btn-k-danger:hover  { background: rgba(244,63,94,0.22); color: #e6edf3; }
.btn-k-ghost   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-k-ghost:hover   { color: var(--text-dim); border-color: var(--border-hi); }
.btn-k-soft    { background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-style: italic; font-size: 0.76em; cursor: pointer; }
.btn-k-soft:hover    { color: var(--text-dim); border-color: var(--border-hi); }

/* ── Forms ── */
.admin-form {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.form-card h3 {
    color: var(--teal);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--teal-border);
    font-size: 1em;
}
.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.88em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.15);
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
}
.score-input {
    width: 80px;
    height: 58px;
    font-size: 1.7em;
    text-align: center;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.score-input:focus {
    border-color: var(--teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45,212,191,0.15);
}

/* Modern form styles */
.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.action-header h3 { color: var(--teal); margin: 0; font-size: 1em; }

.create-form {
    border: 1px solid var(--teal-border);
    background: rgba(45,212,191,0.04);
}
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--teal-border);
}
.form-header h4 { color: var(--teal); margin: 0; font-size: 1em; }

.modern-form { max-width: none; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.form-field { display: flex; flex-direction: column; }
.form-field label {
    margin-bottom: 6px;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.88em;
}
.form-field input,
.form-field select {
    padding: 10px 12px;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field select option,
.form-group select option,
.tournament-selector select option,
.tournament-selector-admin select option {
    background: var(--surface);
    color: var(--text);
}
.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.15);
}
.form-checkbox { margin: 18px 0; }
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text);
}
.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
    cursor: pointer;
}
.checkmark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border-hi);
    border-radius: 4px;
    transition: all 0.15s;
}
.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--teal);
    border-color: var(--teal);
}
.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0d1117;
    font-weight: 700;
    font-size: 12px;
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th {
    background: rgba(244,63,94,0.15);
    border-bottom: 1px solid var(--red-border);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}
td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92em;
    color: var(--text-dim);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); color: var(--text); }
.rank-1 { background: linear-gradient(90deg, rgba(245,158,11,0.12) 0%, transparent 100%); }
.rank-2 { background: linear-gradient(90deg, rgba(148,163,184,0.1) 0%, transparent 100%); }
.rank-3 { background: linear-gradient(90deg, rgba(180,120,60,0.1) 0%, transparent 100%); }
.punten { font-weight: 700; color: var(--teal); }

/* ── Messages ── */
.message {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    text-align: center;
    font-weight: 500;
    font-size: 0.92em;
    border: 1px solid;
}
.message.success { background: var(--teal-bg);  border-color: var(--teal-border); color: var(--teal); }
.message.warning { background: var(--gold-bg);  border-color: var(--gold-border); color: var(--gold); }
.message.error   { background: var(--red-bg);   border-color: var(--red-border);  color: var(--red);  }
.admin-only-notice {
    background: var(--red-bg);
    border: 1px dashed var(--red-border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    color: var(--red);
    margin: 20px 0;
    font-size: 0.9em;
}

/* ── QR Code ── */
.qr-code { background: #fff; padding: 5px; border-radius: var(--radius-sm); }
.qr-container {
    background: #fff;
    padding: 14px;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 18px 0;
}
.qr-container img { display: block; }
.qr-label { color: var(--text-muted); font-size: 0.82em; margin-top: 8px; text-align: center; }

/* ── Tournament selector ── */
.tournament-selector,
.tournament-selector-admin {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 20px;
    text-align: center;
}
.tournament-selector select,
.tournament-selector-admin select {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-hi);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
}
.tournament-selector-admin select { margin-right: 10px; }
.tournament-selector select:focus,
.tournament-selector-admin select:focus {
    outline: none;
    border-color: var(--teal);
}

/* ── Admin layout ── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 24px;
}
.user-info span { color: var(--teal); font-weight: 600; }
.logout-btn {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
    padding: 7px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    transition: all 0.15s;
}
.logout-btn:hover { background: var(--red); color: #fff; }

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 10px 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88em;
    font-family: inherit;
    transition: all 0.15s;
    text-decoration: none;
}
.tab-btn:hover  { background: var(--surface-3); color: var(--text); border-color: var(--border-hi); }
.tab-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.tab-content        { display: none; }
.tab-content.active { display: block; }
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.nav-tab {
    padding: 8px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-tab:hover  { background: var(--surface-2); color: var(--text); border-color: var(--border-hi); }
.nav-tab.active { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.danger-zone {
    margin-top: 40px;
    padding: 20px;
    border: 1px dashed var(--red-border);
    border-radius: var(--radius-lg);
    background: var(--red-bg);
}
.danger-zone h4 { color: var(--red); margin-bottom: 14px; }

/* ── Deelnemers ── */
.deelnemer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin-top: 18px;
}
.deelnemer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--teal);
    border-radius: var(--radius);
}
.deelnemer-item .naam { font-weight: 600; word-break: break-word; max-width: 200px; font-size: 0.92em; }
.deelnemer-item .nummer { color: var(--text-muted); font-size: 0.82em; }

/* ── Stats ── */
.stats-box {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.stat-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 22px;
    border-radius: var(--radius);
    text-align: center;
}
.stat-item .value { font-size: 1.8em; font-weight: 700; color: var(--teal); }
.stat-item .label { color: var(--text-muted); font-size: 0.82em; margin-top: 2px; }
.stats-section {
    margin-top: 36px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.stat-card h2 {
    color: var(--red);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--red-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}
.stat-card.gold h2 { color: var(--gold); border-color: var(--gold-border); }
.stat-card h4 { color: var(--red); margin-bottom: 10px; font-size: 0.95em; }
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    margin-right: 10px;
    flex-shrink: 0;
}
.stat-rank.rank-1     { background: var(--gold); color: #0d1117; }
.stat-rank.rank-2     { background: var(--silver); color: #0d1117; }
.stat-rank.rank-3     { background: #cd7f32; color: #0d1117; }
.stat-rank.rank-other { background: var(--surface-3); color: var(--text-muted); }
.stat-name  { flex: 1; font-weight: 600; font-size: 0.92em; }
.stat-poule { color: var(--text-muted); font-size: 0.82em; margin-left: 10px; }
.stat-value { font-size: 1.2em; font-weight: 700; color: var(--teal); }
.stat-value.gold { color: var(--gold); }
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.overview-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}
.overview-stat .icon  { font-size: 2em; margin-bottom: 8px; }
.overview-stat .value { font-size: 1.8em; font-weight: 700; color: var(--teal); }
.overview-stat .label { color: var(--text-muted); font-size: 0.82em; }
.overview-stat.highlight .value { color: var(--gold); }

/* ── Poule indeling ── */
.poule-indeling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.poule-kolom {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--teal);
    border-radius: var(--radius);
    padding: 12px;
}
.poule-kolom h4 { color: var(--teal); margin: 0 0 10px 0; font-size: 0.9em; }
.poule-deelnemer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    margin-bottom: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 2px solid var(--teal);
    border-radius: var(--radius-sm);
    gap: 6px;
}
.poule-deelnemer-naam { font-size: 0.84em; flex: 1; min-width: 0; word-break: break-word; }
.poule-verplaats-select {
    background: var(--surface-3);
    border: 1px solid var(--border-hi);
    color: var(--text);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.74em;
    max-width: 88px;
    cursor: pointer;
    font-family: inherit;
}
.poule-verplaats-select:focus { outline: none; border-color: var(--teal); }
.poule-verplaats-select option { background: var(--surface); color: var(--text); }

/* ── Progress ── */
.progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    padding: 0 4px;
}
.progress-label   { color: var(--text-muted); font-size: 0.76em; white-space: nowrap; }
.progress-fraction { color: var(--text-muted); font-size: 0.76em; white-space: nowrap; }
.progress-bar-container {
    flex: 1;
    height: 3px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--teal);
    border-radius: 2px;
    transition: width 0.5s ease;
}
.progress-text { display: none; }
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
    margin: 18px 0;
}
.progress-bar .fill {
    height: 100%;
    background: var(--teal);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ── Toernooi navigatie ── */
.toernooi-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.nav-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88em;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-back:hover { color: var(--teal); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.82em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-hi); }
.nav-link-gold { border-color: var(--gold-border); color: var(--gold); background: var(--gold-bg); }
.nav-link-gold:hover { background: rgba(245,158,11,0.18); color: var(--gold); }

/* ── Toernooi body layout ── */
.toernooi-main {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    align-items: start;
    margin-top: 10px;
}
.toernooi-standen .poules-grid { margin-bottom: 0; }
.toernooi-schema .speelschema-section { margin-top: 0; }
@media (max-width: 860px) {
    .toernooi-main { grid-template-columns: 1fr; }
    .toernooi-schema .speelschema-section { margin-top: 28px; }
}

/* ── Baan planning ── */
.baan-planning {
    background: var(--surface);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin: 0 0 16px 0;
}
.baan-planning h3 { color: var(--teal); margin: 0 0 12px 0; font-size: 0.88em; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.baan-rijen { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.baan-item {
    background: var(--surface-2);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.baan-nr {
    font-size: 1.8em;
    font-weight: 900;
    color: var(--teal);
    line-height: 1;
    min-width: 32px;
    text-align: center;
    padding-top: 1px;
    flex-shrink: 0;
}
.baan-content { flex: 1; min-width: 0; }
.baan-item .baan-poule   { color: var(--text-muted); font-size: 0.72em; margin-bottom: 4px; }
.baan-item .baan-spelers { font-weight: 600; font-size: 0.9em; line-height: 1.4; color: var(--text); }
.baan-item .baan-schrijver { color: var(--gold); font-size: 0.76em; margin-top: 4px; }
.baan-acties { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.vrije-spelers { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.vrije-spelers-label { font-size: 0.72em; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.vrije-spelers-namen { display: flex; flex-wrap: wrap; gap: 5px; }
.vrije-speler { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 0.82em; color: var(--text-dim); }
.baan-schrijver-btn {
    display: inline-block; padding: 4px 10px;
    background: var(--teal-bg); border: 1px solid var(--teal-border);
    color: var(--teal); border-radius: var(--radius-sm);
    font-size: 0.78em; font-weight: 600; text-decoration: none;
    transition: background 0.15s;
}
.baan-schrijver-btn:hover { background: rgba(45,212,191,0.2); }
.baan-scherm-btn {
    display: inline-block; padding: 4px 10px;
    background: var(--red-bg); border: 1px solid var(--red-border);
    color: var(--red); border-radius: var(--radius-sm);
    font-size: 0.78em; font-weight: 600; text-decoration: none;
    transition: background 0.15s;
}
.baan-scherm-btn:hover { background: rgba(244,63,94,0.2); color: var(--red); }
.schrijver-link-klein {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: var(--teal-bg); border: 1px solid var(--teal-border);
    border-radius: var(--radius-sm); text-decoration: none;
    font-size: 0.9em; flex-shrink: 0; transition: background 0.15s;
}
.schrijver-link-klein:hover { background: rgba(45,212,191,0.22); }

/* ── Poules & wedstrijden ── */
.poules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 20px;
}
.section-card h3 { margin-bottom: 12px; }
.section-card .leeg { color: var(--text-muted); }

/* ── Persoonlijk schema ── */
.schema-lijst  { display: flex; flex-direction: column; gap: 8px; }
.schema-item   { display: flex; align-items: center; justify-content: space-between;
                 background: var(--surface-2); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 10px 14px; }
.schema-item-naam { font-weight: 600; }
.schema-item-meta { font-size: .8em; color: var(--text-muted); margin-top: 2px; }
.schema-item-status { text-align: right; font-size: .85em; color: var(--text-muted); }
.schema-baan        { color: var(--teal); font-weight: 600; }
.schema-eerstvolgende { color: var(--amber); }

.poule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
}
.poule-card h2 {
    color: var(--red);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--red-border);
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.speelschema-section { margin-top: 36px; }
.speelschema-section h2 { text-align: center; margin-bottom: 22px; color: var(--teal); font-size: 1.1em; }
.wedstrijd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.wedstrijd-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.wedstrijd-card h3 { color: var(--teal); margin-bottom: 12px; font-size: 0.95em; font-weight: 600; }
.wedstrijd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88em;
}
.wedstrijd:last-child { border-bottom: none; }
.wedstrijd-nummer {
    background: var(--red);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8em;
    margin-right: 10px;
    flex-shrink: 0;
}
.wedstrijd-spelers { flex: 1; color: var(--text-dim); }
.wedstrijd-score {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    min-width: 48px;
    text-align: center;
    color: var(--red);
}
.wedstrijd-score.geen-score { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
.wedstrijd-op-baan { background: rgba(233,69,96,0.05); border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.badge-volgende-baan {
    background: rgba(233,69,96,0.15);
    color: var(--red);
    border: 1px solid rgba(233,69,96,0.35);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.72em;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 6px;
}
.schrijver { color: var(--gold); font-size: 0.78em; margin-left: 8px; }
.winner    { color: var(--teal); font-weight: 700; }
.loser     { color: var(--text-muted); }
.vs        { color: var(--red); margin: 0 5px; font-size: 0.8em; }

/* ── Knockout ── */
.knockout-banner {
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin: 28px 0;
    animation: glow 2.5s ease-in-out infinite;
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,0.2); }
    50%       { box-shadow: 0 0 24px rgba(245,158,11,0.5); }
}
.knockout-banner h2 { color: var(--gold); margin: 0 0 10px 0; font-size: 1.4em; }
.knockout-banner p  { color: var(--text-dim); margin-bottom: 18px; font-size: 0.92em; }
.knockout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 28px;
}
@media (max-width: 900px) {
    .knockout-container { grid-template-columns: 1fr; }
}
.ronde-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.ronde-card.a-ronde { border-top: 3px solid var(--gold); }
.ronde-card.b-ronde { border-top: 3px solid var(--silver); }
.ronde-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.ronde-header h2 { margin: 0; font-size: 1.1em; }
.fase-section { margin-bottom: 22px; }
.fase-header {
    color: var(--teal);
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--teal-border);
}
.knockout-match {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
}
.knockout-match.completed { border-left: 3px solid var(--teal); }
.knockout-match.pending   { border-left: 3px solid var(--red); }
.knockout-match.waiting   { border-left: 3px solid var(--surface-3); opacity: 0.55; }
.match-players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 1.1em;
    font-weight: 600;
}
.player-name        { font-weight: 600; flex: 1; min-width: 80px; }
.player-name.winner { color: var(--teal); }
.player-name.loser  { color: var(--text-muted); }
.vs-badge           { color: var(--red); margin: 0 10px; font-weight: 700; }
.match-score {
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--teal);
    margin: 8px 0;
}
.match-number {
    background: var(--red);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88em;
    margin-right: 14px;
    flex-shrink: 0;
}
.winner-banner {
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    margin-bottom: 18px;
}
.winner-banner.b-ronde {
    background: rgba(148,163,184,0.08);
    border-color: rgba(148,163,184,0.25);
}
.winner-banner h3         { color: var(--gold); margin: 0 0 8px 0; font-size: 1em; }
.winner-banner.b-ronde h3 { color: var(--silver); }
.winner-name { font-size: 1.7em; font-weight: 700; }
.trophy      { font-size: 2.5em; margin-bottom: 8px; }
.status-box {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    margin-bottom: 28px;
}
.status-box.ready { background: var(--teal-bg); border-color: var(--teal-border); }
.generate-section { text-align: center; margin: 28px 0; }
.preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 18px;
}
.preview-card h3 { color: var(--teal); margin-bottom: 14px; font-size: 0.95em; }
.split-preview   { display: flex; gap: 18px; flex-wrap: wrap; }
.split-column    { flex: 1; min-width: 140px; }
.split-column h4 { margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid; font-size: 0.9em; }
.split-column.a-side h4 { color: var(--gold); border-color: var(--gold-border); }
.split-column.b-side h4 { color: var(--silver); border-color: rgba(148,163,184,0.25); }
.split-player           { padding: 4px 8px; margin: 3px 0; border-radius: var(--radius-sm); font-size: 0.88em; }
.split-column.a-side .split-player { background: var(--gold-bg); }
.split-column.b-side .split-player { background: rgba(148,163,184,0.08); }
.tbd { color: var(--text-muted); font-style: italic; }

/* ── Admin user management ── */
.admin-users-list { margin-bottom: 18px; }
.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--teal);
    border-radius: var(--radius);
    margin-bottom: 7px;
}
.admin-user-item strong { color: var(--teal); }
.admin-user-item .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    margin-left: 8px;
}

/* ── Poule page ── */
.poule-header { text-align: center; margin-bottom: 28px; }
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 18px 0;
    flex-wrap: wrap;
}
.stat-box {
    text-align: center;
    padding: 14px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat-box .number { font-size: 1.8em; font-weight: 700; color: var(--teal); }
.stat-box .label  { color: var(--text-muted); font-size: 0.82em; margin-top: 2px; }
.poule-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 18px 0;
    flex-wrap: wrap;
}
.poule-nav-btn {
    padding: 8px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.88em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.poule-nav-btn:hover  { background: var(--surface-2); color: var(--text); }
.poule-nav-btn.active { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.next-match {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 18px 0;
    text-align: center;
}
.next-match h3        { color: var(--red); margin-bottom: 8px; font-size: 0.95em; }
.next-match .players  { font-size: 1.2em; font-weight: 700; }
.next-match .schrijver { color: var(--gold); margin-top: 8px; font-size: 0.88em; }

/* ── Score page ── */
.score-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
}
.score-form.completed { opacity: 0.6; border-left: 3px solid var(--teal); }
.score-form.pending   { border-left: 3px solid var(--red); }
.score-form-op-baan.pending { border-left: 3px solid var(--red); background: rgba(233,69,96,0.06); box-shadow: 0 0 0 1px rgba(233,69,96,0.2); }
.score-form.volgende-wedstrijd {
    border-left: 3px solid var(--gold);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
    animation: pulseHighlight 1.2s ease-out;
}
@keyframes pulseHighlight {
    0%   { box-shadow: 0 0 0 5px rgba(245,158,11,0.4); }
    100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.25); }
}
.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.score-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.score-separator { font-size: 1.8em; color: var(--red); font-weight: 700; }
.player-label    { text-align: center; color: var(--text-muted); font-size: 0.85em; margin-top: 4px; }
.submit-btn      { width: 100%; padding: 13px; margin-top: 14px; font-size: 1.05em; }
.existing-score {
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    padding: 14px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--teal);
}
.poule-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 28px;
}
.poule-select-btn {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-size: 1.2em;
    font-weight: 700;
    transition: all 0.15s;
}
.poule-select-btn:hover {
    background: var(--red-bg);
    border-color: var(--red-border);
    color: var(--text);
    transform: translateY(-2px);
}
.schrijver-info {
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-top: 10px;
    color: var(--gold);
    font-size: 0.88em;
}
.extra-toggle {
    width: 100%;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius);
    color: var(--teal);
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    font-family: inherit;
}
.extra-toggle:hover        { background: rgba(45,212,191,0.18); }
.extra-toggle .arrow       { transition: transform 0.2s; font-style: normal; }
.extra-toggle.open .arrow  { transform: rotate(180deg); }
.extra-panel {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid var(--teal);
}
.extra-panel.open { display: block; }
.extra-player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.extra-player-row:last-of-type { margin-bottom: 0; }
.extra-player-name { font-weight: 600; font-size: 0.92em; min-width: 100px; flex: 1; }
.extra-field-group { display: flex; align-items: center; gap: 6px; }
.extra-input {
    width: 60px;
    height: 42px;
    font-size: 1.1em;
    text-align: center;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text);
    font-family: inherit;
}
.extra-input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 2px rgba(45,212,191,0.15); }
.extra-label    { font-size: 0.76em; font-weight: 600; color: var(--text-muted); }
.extra-save-btn { width: 100%; margin-top: 12px; padding: 9px; font-size: 0.92em; }
.extra-feedback { text-align: center; margin-top: 8px; font-size: 0.88em; color: var(--teal); min-height: 1.2em; }

/* ── Cookie banner ── */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    animation: slide-up 0.25s ease;
}
@keyframes slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
#cookie-banner.hidden { display: none; }
.cookie-tekst { flex: 1; min-width: 200px; font-size: 0.84em; color: var(--text-muted); line-height: 1.5; }
.cookie-tekst a { color: var(--teal); }
.cookie-acties { display: flex; gap: 8px; flex-shrink: 0; }
.btn-cookie-accept {
    padding: 7px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    background: var(--teal); color: #0d1117; font-weight: 700; font-size: 0.84em;
    font-family: inherit; transition: background 0.15s;
}
.btn-cookie-accept:hover { background: #5ee8d4; }
.btn-cookie-decline {
    padding: 7px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-hi);
    cursor: pointer; background: transparent; color: var(--text-muted); font-size: 0.84em;
    font-family: inherit; transition: all 0.15s;
}
.btn-cookie-decline:hover { color: var(--text-dim); border-color: var(--border-hi); }

/* ── Algemene voorwaarden ── */
.av-container { max-width: 740px; margin: 0 auto; padding: 36px 20px 56px; }
.av-header { margin-bottom: 32px; }
.av-header h1 { font-size: 1.7em; margin-bottom: 8px; text-align: left; }
.av-header .av-meta { color: var(--text-muted); font-size: 0.82em; }
.av-sectie { margin-bottom: 28px; }
.av-sectie h2 { font-size: 1em; color: var(--teal); margin-bottom: 10px; border-bottom: 1px solid var(--teal-border); padding-bottom: 6px; font-weight: 600; }
.av-sectie p, .av-sectie li { color: var(--text-dim); font-size: 0.9em; line-height: 1.75; }
.av-sectie ul { margin-left: 20px; margin-top: 6px; }
.av-sectie li { margin-bottom: 4px; }
.av-back { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: 0.86em; margin-bottom: 26px; text-decoration: none; }
.av-back:hover { color: #5ee8d4; }

/* ── Landing page helpers ── */
.sectie-header { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.sectie-header h2 { margin: 0; font-size: 1em; font-weight: 600; color: var(--text-dim); }
.count-badge {
    background: var(--teal-bg);
    color: var(--teal);
    border: 1px solid var(--teal-border);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.76em;
    font-weight: 700;
}
.empty-state {
    text-align: center;
    padding: 28px;
    color: var(--text-muted);
    border: 1px dashed var(--border-hi);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.88em;
}
.empty-state p { margin: 0; }
.online-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--teal);
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 5px rgba(45,212,191,0.6);
}

/* ── A/B-ronde scheiding in poule standen ── */
.rij-a-ronde td, tr.ko-a td { background: var(--teal-bg); }
.rij-b-ronde td, tr.ko-b td { background: var(--red-bg); }
.rij-a-ronde td:first-child, tr.ko-a td:first-child { border-left: 3px solid var(--teal); padding-left: 9px; }
.rij-b-ronde td:first-child, tr.ko-b td:first-child { border-left: 3px solid var(--red);  padding-left: 9px; }
tr.grens-a-b td { border-bottom: 2px solid var(--border-hi); }

/* ── Verbinding status ── */
.verbinding-status { text-align: center; margin-bottom: 12px; }
.verbinding-status span {
    display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 0.78em; font-weight: 600;
}
.verbinding-live span {
    background: var(--teal-bg); border: 1px solid var(--teal-border); color: var(--teal);
}
.verbinding-polling span {
    background: rgba(255,193,7,0.12); border: 1px solid rgba(255,193,7,0.35); color: #FFC107;
    animation: pulse 1.5s infinite;
}

/* ── Kolom legenda ── */
.kolom-legenda { font-size: 0.68em; color: var(--text-muted); margin-top: 6px; text-align: right; line-height: 1.5; }

/* ── Inschrijving toelichting ── */
.inschrijving-toelichting {
    font-size: .78em; color: var(--text-muted); margin-top: 5px; line-height: 1.4;
}

/* ── Speler nav ── */
.speler-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--teal-bg);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius);
    padding: 8px 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.speler-nav-naam { color: var(--teal); font-size: .88em; font-weight: 600; }
.speler-nav-links { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Push toggle button ── */
.btn-push-toggle {
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 12px; min-height: 36px; font-size: .82em; cursor: pointer; font-family: inherit;
    transition: border-color .2s, background .2s; color: var(--text-muted);
}
.btn-push-toggle:hover   { background: rgba(255,255,255,.06); border-color: var(--border-hi); }
.btn-push-toggle.aan     { color: var(--teal); border-color: var(--teal-border); }
.btn-push-toggle.aan:hover { background: var(--teal-bg); }
.push-toggle-sub { font-size: .68em; color: var(--text-muted); text-align: center; }

/* ── Bannners (winnaar / afgerond) ── */
.banner-winnaar {
    background: linear-gradient(135deg, rgba(255,215,0,.18), rgba(255,165,0,.1));
    border: 2px solid var(--gold); border-radius: var(--radius-lg);
    padding: 28px 24px; text-align: center; margin-bottom: 24px;
}
.banner-winnaar-trofee { font-size: 2.8em; line-height: 1; margin-bottom: 8px; }
.banner-winnaar-label  { font-size: .85em; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.banner-winnaar-naam   { font-size: 2em; font-weight: 800; margin-bottom: 4px; }
.banner-winnaar-sub    { color: var(--text-muted); font-size: .88em; }
.banner-afgerond       { background: linear-gradient(135deg, var(--teal-bg), rgba(78,204,163,.07)); border: 1px solid var(--teal-border); border-radius: var(--radius-lg); padding: 20px 24px; text-align: center; margin-bottom: 24px; }
.banner-afgerond h2    { color: var(--teal); margin: 0 0 6px; }
.banner-afgerond p     { color: var(--text-muted); margin: 0; font-size: .9em; }
.knockout-banner.teal  { background: linear-gradient(135deg, rgba(78,204,163,.2), rgba(78,204,163,.1)); border-color: var(--teal); animation: none; }
.knockout-banner.teal h2 { color: var(--teal); }

/* ── Account sectie ── */
.account-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.account-naam   { color: var(--teal); font-weight: 600; }
.account-email  { color: var(--text-muted); font-size: .85em; margin-left: 8px; }
.account-logout { color: var(--red); font-size: .9em; text-decoration: none; }
.account-logout:hover { text-decoration: underline; }

/* ── Form hulpklassen ── */
.form-hint { color: var(--text-muted); font-size: .85em; }
.btn-full   { width: 100%; padding: 12px; margin-top: 8px; }

/* ── Speler stats modal ── */
.speler-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.speler-modal-box     { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,.6); }
.speler-modal-sluit   { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 1.4em; cursor: pointer; line-height: 1; z-index: 1; transition: color .15s; }
.speler-modal-sluit:hover { color: var(--text); }
.speler-modal-inhoud  { padding: 28px; }
.modal-laden  { text-align: center; color: var(--text-dim); padding: 40px 0; }
.modal-fout   { text-align: center; color: var(--red); padding: 30px; }
.modal-leeg   { color: var(--text-dim); font-size: .85em; margin: 0; }
.modal-kop     { margin-bottom: 20px; }
.modal-kop-naam { font-size: 1.35em; font-weight: bold; margin-bottom: 4px; }
.modal-kop-sub  { color: var(--text-muted); font-size: .85em; }
.modal-sectie          { margin-bottom: 22px; }
.modal-sectie-titel    { font-size: .75em; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.modal-stat-grid       { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 22px; }
.modal-schrijver-grid  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.modal-box             { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 6px; text-align: center; }
.modal-box.teal        { background: var(--teal-bg); border-color: var(--teal-border); }
.modal-box.rood        { background: var(--red-bg);  border-color: var(--red-border); }
.modal-box-val         { font-size: 1.5em; font-weight: bold; }
.modal-box-val.teal    { color: var(--teal); }
.modal-box-val.rood    { color: var(--red); }
.modal-box-val.dim     { color: var(--text-muted); }
.modal-box-lbl         { font-size: .75em; color: var(--text-muted); margin-top: 2px; }
.modal-tabel           { width: 100%; border-collapse: collapse; font-size: .85em; }
.modal-tabel thead tr  { font-size: .82em; border-bottom: 1px solid var(--border); }
.modal-tabel thead th  { padding: 4px 6px; color: var(--text-dim); font-weight: 600; text-align: left; }
.modal-tabel thead th.r, .modal-tabel td.r { text-align: right; }
.modal-tabel thead th.c, .modal-tabel td.c { text-align: center; }
.modal-tabel td        { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.04); }
.modal-finish-badge    { display: inline-block; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border); border-radius: 6px; padding: 2px 9px; font-size: .85em; font-weight: bold; margin: 2px; }
.uitslag-w { color: var(--teal); font-weight: bold; }
.uitslag-g { color: var(--text-muted); font-weight: bold; }
.uitslag-v { color: var(--red); font-weight: bold; }
/* ── Baan-planning leeg ── */
.baan-leeg { color: var(--text-dim); font-size: .9em; padding: 6px 0; }

/* ── Spelwijze link ── */
.spelwijze-link-wrapper { text-align: right; margin-bottom: 10px; }
.spelwijze-link {
    background: none; border: 1px solid var(--teal-border); border-radius: 20px;
    color: var(--teal); cursor: pointer; font-size: .82em; padding: 8px 16px;
    min-height: 36px;
    transition: background .2s, border-color .2s;
}
.spelwijze-link:hover { background: var(--teal-bg); border-color: var(--teal); }

/* ── Spelwijze modal ── */
.spelwijze-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.spelwijze-overlay[hidden] { display: none; }
.spelwijze-box {
    background: var(--surface); border: 1px solid var(--teal-border); border-radius: var(--radius-lg);
    padding: 32px 28px; max-width: 560px; width: 100%; max-height: 85vh;
    overflow-y: auto; position: relative;
}
.spelwijze-box h2 { color: var(--teal); margin: 0 0 20px; font-size: 1.3em; }
.spelwijze-box h3 { color: var(--text); font-size: 1em; margin: 20px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.spelwijze-box h3:first-of-type { margin-top: 0; }
.spelwijze-box p { color: var(--text-dim); font-size: .9em; line-height: 1.6; margin: 0 0 10px; }
.spelwijze-lijst { color: var(--text-dim); font-size: .9em; line-height: 1.8; padding-left: 20px; margin: 0 0 10px; }
.spelwijze-lijst li { margin-bottom: 4px; }
.spelwijze-lijst strong { color: var(--text); }
.spelwijze-lijst ol { margin-top: 4px; padding-left: 18px; }
.spelwijze-sluit {
    position: absolute; top: 14px; right: 18px; background: none; border: none;
    color: var(--text-muted); font-size: 1.5em; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.spelwijze-sluit:hover { color: var(--text); }
body.spelwijze-open { overflow: hidden; }

/* ── Mobile (≤ 600px) ── */
@media (max-width: 600px) {
    body { padding: 8px 10px; }
    h1 { font-size: 1.7em; }

    .toernooi-kaart {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .toernooi-kaart > div:last-child {
        width: 100%;
        justify-content: flex-start !important;
    }

    .poule-nav { flex-wrap: wrap; }
    .stat-box  { padding: 10px; min-width: 60px; }
    .wedstrijd { flex-wrap: wrap; gap: 5px; }

    .tabs { gap: 2px; }
    .tab-btn { padding: 8px 12px; font-size: 0.82em; }

    .poules-grid { grid-template-columns: 1fr; }
    .wedstrijd-grid { grid-template-columns: 1fr; }
}

/* =================================================================
   ADMIN SIDEBAR LAYOUT
   ================================================================= */

body.admin-body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: rgba(8, 8, 20, 0.98);
    border-right: 1px solid var(--teal-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(45,212,191,0.2) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(45,212,191,0.1);
}

.sidebar-brand h2 {
    color: var(--teal);
    font-size: 1.05em;
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
}

/* Tournament picker */
.sidebar-tournament-picker {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar-tournament-picker label {
    display: block;
    font-size: 0.68em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: bold;
}

.sidebar-tournament-picker select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--teal-border);
    color: var(--text-dim);
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.82em;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-tournament-picker select:focus,
.sidebar-tournament-picker select:hover {
    border-color: var(--teal);
}

/* Mini stats in sidebar */
.sidebar-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.sms-item {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 7px 6px;
    text-align: center;
    font-size: 0.72em;
    color: var(--text-muted);
    line-height: 1.4;
}

.sms-item strong {
    display: block;
    font-size: 1.5em;
    color: var(--teal);
    font-weight: bold;
    line-height: 1.1;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 4px;
    scrollbar-width: none;
}

.sidebar-section {
    margin-bottom: 2px;
}

.sidebar-section-label {
    display: block;
    font-size: 0.63em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 18px 3px;
    font-weight: bold;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88em;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    margin-right: 6px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-link:hover {
    background: var(--surface-2);
    color: var(--text);
    border-left-color: var(--teal-border);
}

.sidebar-link.active {
    background: var(--teal-bg);
    color: var(--teal);
    border-left-color: var(--teal);
    font-weight: bold;
}

.sidebar-link .sli {
    font-size: 1em;
    min-width: 18px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-live-btn {
    display: block;
    text-align: center;
    background: var(--teal-bg);
    color: var(--teal);
    border: 1px solid var(--teal-border);
    border-radius: var(--radius-sm);
    padding: 7px;
    text-decoration: none;
    font-size: 0.82em;
    font-weight: bold;
    transition: all 0.2s;
}

.sidebar-live-btn:hover {
    background: rgba(45,212,191,0.22);
    border-color: var(--teal);
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sidebar-username {
    color: var(--text-muted);
    font-size: 0.78em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.sidebar-logout {
    background: var(--red-bg);
    color: var(--red);
    padding: 4px 9px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.78em;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: var(--red);
    color: #fff;
}

/* ── Main content area ── */
.admin-main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
    overflow-x: hidden;
}

/* Mobile topbar */
.admin-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 8, 20, 0.97);
    padding: 12px 15px;
    margin: -28px -32px 20px;
    border-bottom: 1px solid var(--teal-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-hamburger {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: all 0.2s;
}

.sidebar-hamburger:hover {
    background: var(--surface-2);
}

.topbar-title {
    color: var(--teal);
    font-weight: bold;
    font-size: 0.9em;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
}

.topbar-logout {
    color: var(--red);
    text-decoration: none;
    font-size: 1.1em;
    padding: 4px 6px;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: none;
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .admin-topbar {
        display: flex;
    }

    .admin-main {
        padding: 60px 15px 15px;
    }
}
