:root {
    --color-ink-900: 237, 242, 249;
    --color-ink-800: 214, 224, 238;
    --color-ink-700: 163, 178, 200;
    --color-ink-500: 124, 141, 167;
    --color-ink-300: 148, 163, 184;
    --color-ink-200: 55, 70, 95;
    --color-ink-100: 36, 48, 70;
    --color-ink-50: 23, 32, 52;
    --color-brand-700: 16, 185, 100;
    --color-brand-600: 22, 163, 74;
    --color-brand-500: 21, 128, 61;
    --color-warning: 234, 179, 8;
    --color-danger: 239, 68, 68;
    --color-info: 56, 189, 248;
    --color-primary: 59, 130, 246;
    --color-dark: 15, 23, 42;
    --color-light: 248, 250, 252;
    --bg-elevated: #131d35;
    --bg-surface: #0a0f1c;
    --bg-surface-2: #101a30;
    --border-default: rgba(148, 163, 184, 0.22);
    --border-strong: rgba(148, 163, 184, 0.4);
    --glow-brand: 0 0 0 3px rgba(34, 197, 94, 0.14);
    --shadow-soft: 0 14px 30px rgba(2, 6, 16, 0.45);
    --shadow-card: 0 10px 22px rgba(2, 6, 16, 0.4);
    --topbar-height: 72px;
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    box-sizing: border-box;
}

.air-datepicker-global-container {
    z-index: 1060 !important;
}

html {
    min-height: 100%;
    background: #0a0f1c;
    /* Voorkomt dubbeltik-zoom op iOS Safari, zonder pinch-zoom te blokkeren
       (dat laatste zou de toegankelijkheid schaden). */
    touch-action: manipulation;
}

body {
    margin: 0;
    font-family: 'Manrope', ui-sans-serif, system-ui, Segoe UI, Roboto, Arial, sans-serif;
    color: rgb(var(--color-ink-900));
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    background: linear-gradient(180deg, #0a0f1c 0%, #0c1425 100%);
    padding-bottom: var(--safe-bottom);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: #0a0f1c;
    z-index: -1;
}

/* iOS Safari safe-area fixes */
/* Voorkom ongewenst dim-effect bij modals/dropdowns op iOS Safari */
@supports (-webkit-touch-callout: none) {
    .modal {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }
    .modal-backdrop, .offcanvas-backdrop {
        background: transparent !important;
        background-color: transparent !important;
    }
    /* Offcanvas moet zichtbaar blijven met achtergrond */
    .offcanvas {
        background: #111c33 !important;
    }
}
@supports (-webkit-touch-callout: none) {
    html, body {
        height: 100%;
        min-height: -webkit-fill-available;
        background: #0a0f1c !important;
        overflow-x: hidden;
    }

    body::before {
        display: none !important;
    }

    body {
        position: relative;
        background: #0a0f1c !important;
        min-height: -webkit-fill-available;
    }

    .app-shell {
        min-height: -webkit-fill-available;
        position: relative;
        z-index: 1;
    }

    .app-body {
        min-height: calc(100svh - var(--topbar-height));
        padding-bottom: 0;
    }

    .app-main {
        padding-bottom: 2.5rem;
        min-height: calc(100svh - var(--topbar-height));
        background: #0a0f1c;
    }

    /* Voorkom dim-effect bij overlays op iOS Safari */
    .dropdown-menu, .modal, .offcanvas {
        background-attachment: scroll !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}
    .offcanvas {
        top: var(--topbar-height);
        bottom: 0;
        height: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidepanel {
        height: auto;
        min-height: -webkit-fill-available;
    }

    .sidepanel-body {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    /* Replace gradient with solid + fixed overlay for iOS */
    .app-main {
        background: linear-gradient(180deg, #0a0f1c 0%, #0c1425 100%);
    }

    /* Remove masking bar; rely on native safe-area fill */
}

/* iOS bottom safe-area background fill */
@supports (padding: env(safe-area-inset-bottom)) {
    body::after {
        content: "";
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: env(safe-area-inset-bottom);
        background: #0a0f1c;
        z-index: -1;
    }
}

body.bg-light {
    background: linear-gradient(180deg, #0a0f1c 0%, #0c1425 100%);
}

a {
    color: rgb(var(--color-brand-600));
    text-decoration: none;
}

a:hover {
    color: rgb(var(--color-brand-500));
}

.brand-wordmark {
    font-family: 'Space Grotesk', 'Manrope', ui-sans-serif, system-ui, sans-serif;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Typography helpers */
.h1 { font-size: 2.2rem; font-weight: 700; }
.h2 { font-size: 1.9rem; font-weight: 700; }
.h3 { font-size: 1.5rem; font-weight: 700; }
.h4 { font-size: 1.25rem; font-weight: 700; }
.h5 { font-size: 1.05rem; font-weight: 700; }
.h6 { font-size: 0.95rem; font-weight: 700; }
.fs-2 { font-size: 2rem; }
.fs-3 { font-size: 1.75rem; }
.fs-4 { font-size: 1.5rem; }
.fs-5 { font-size: 1.25rem; }
.fs-6 { font-size: 1rem; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: 0.85rem; }

.text-muted { color: rgba(var(--color-ink-700), 1); }
.text-secondary { color: rgba(var(--color-ink-700), 1); }
.text-success { color: rgb(var(--color-brand-600)); }
.text-danger { color: rgb(var(--color-danger)); }
.text-warning { color: rgb(var(--color-warning)); }
.text-info { color: rgb(var(--color-info)); }
.text-primary { color: rgb(var(--color-primary)); }
.text-dark { color: rgb(var(--color-dark)); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.text-nowrap { white-space: nowrap; }

.bg-light { background: var(--bg-surface); }
.bg-white { background: var(--bg-elevated) !important; }
.bg-dark { background-color: rgb(var(--color-dark)); }
.bg-success { background-color: rgb(var(--color-brand-500)); }
.bg-primary { background-color: rgb(var(--color-primary)); }
.bg-warning { background-color: rgb(var(--color-warning)); }
.bg-danger { background-color: rgb(var(--color-danger)); }
.bg-info { background-color: rgb(var(--color-info)); }
.bg-secondary { background-color: rgb(var(--color-ink-300)); }
.bg-opacity-10 { --bg-opacity: 0.1; }

.bg-success, .bg-primary, .bg-warning, .bg-danger, .bg-info, .bg-secondary {
    background-color: rgba(var(--bg-color, 0, 0, 0), var(--bg-opacity, 1));
}
.bg-success { --bg-color: var(--color-brand-500); }
.bg-primary { --bg-color: var(--color-primary); }
.bg-warning { --bg-color: var(--color-warning); }
.bg-danger { --bg-color: var(--color-danger); }
.bg-info { --bg-color: var(--color-info); }
.bg-secondary { --bg-color: var(--color-ink-500); }

/* Spacing utilities */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 2rem; padding-bottom: 2rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pb-3 { padding-bottom: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Layout */
.app-shell {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-body {
    display: flex;
    min-height: calc(100svh - var(--topbar-height));
    padding-bottom: var(--safe-bottom);
}

.app-main {
    flex: 1;
    padding: 1.5rem 1.5rem 2.5rem;
    padding-bottom: calc(2.5rem + var(--safe-bottom));
    animation: pageFadeIn 0.18s ease-out;
    background: transparent;
}

.app-main .container,
.app-main .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--row-gap, 1rem);
    width: 100%;
}

.row.g-2 { --row-gap: 0.5rem; }
.row.g-3 { --row-gap: 1rem; }
.row.g-4 { --row-gap: 1.5rem; }

.col-12 { grid-column: span 12; }
.col-10 { grid-column: span 10; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-1 { grid-column: span 1; }

/* Centered columns for single-card layouts */
.col-centered {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .col-centered.col-md-10 { grid-column: 2 / span 10; }
}

@media (min-width: 992px) {
    .col-centered.col-lg-10 { grid-column: 2 / span 10; }
    .col-centered.col-lg-8 { grid-column: 3 / span 8; }
}

@media (min-width: 1200px) {
    .col-centered.col-xl-8 { grid-column: 3 / span 8; }
    .col-centered.col-xl-6 { grid-column: 4 / span 6; }
}

/* Mobile-first: any breakpoint-only column should full-span by default */
[class*="col-sm-"],
[class*="col-md-"],
[class*="col-lg-"],
[class*="col-xl-"] {
    grid-column: span 12;
}

@media (min-width: 576px) {
    .col-sm-6 { grid-column: span 6; }
}

@media (min-width: 768px) {
    .col-md-2 { grid-column: span 2; }
    .col-md-3 { grid-column: span 3; }
    .col-md-4 { grid-column: span 4; }
    .col-md-6 { grid-column: span 6; }
    .col-md-8 { grid-column: span 8; }
    .col-md-10 { grid-column: span 10; }
}

@media (min-width: 992px) {
    .col-lg-3 { grid-column: span 3; }
    .col-lg-4 { grid-column: span 4; }
    .col-lg-6 { grid-column: span 6; }
    .col-lg-8 { grid-column: span 8; }
    .col-lg-10 { grid-column: span 10; }
}

@media (min-width: 1200px) {
    .col-xl-6 { grid-column: span 6; }
    .col-xl-8 { grid-column: span 8; }
}

.d-flex { display: flex; }
.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.position-relative { position: relative; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

@media (min-width: 576px) {
    .d-sm-inline { display: inline; }
    .d-sm-inline-flex { display: inline-flex; }
}

@media (min-width: 768px) {
    .d-md-inline { display: inline; }
    .d-md-inline-flex { display: inline-flex; }
    .d-md-none { display: none; }
}

/* Width utilities */
.w-100 { width: 100%; }

/* Navbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1250;
    padding: 0.85rem 1.5rem;
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: #131d35;
    color: rgb(var(--color-ink-900));
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-left {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-right {
    flex: 0 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: rgb(var(--color-ink-900));
    text-decoration: none;
    font-weight: 600;
    min-width: 0;
    max-width: 100%;
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px;
}

.brand-club-name {
    display: inline-block;
    min-width: 0;
    max-width: min(34vw, 180px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #131d35;
    color: rgb(var(--color-ink-800));
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 1rem; }

.btn-primary {
    background: rgb(var(--color-brand-600));
    color: #fff;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.btn-success {
    background: rgb(var(--color-brand-500));
    color: #fff;
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.2);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    color: #fff;
}

.btn-secondary {
    background: #131d35;
    color: rgb(var(--color-ink-800));
    border-color: rgba(148, 163, 184, 0.4);
}

.btn-outline-success {
    border-color: rgba(34, 197, 94, 0.45);
    color: rgb(var(--color-brand-700));
    background: rgba(34, 197, 94, 0.08);
}

.btn-outline-primary {
    border-color: rgba(var(--color-primary), 0.45);
    color: rgb(var(--color-primary));
    background: rgba(var(--color-primary), 0.08);
}

.btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.4);
    color: rgba(var(--color-ink-800), 1);
    background: #131d35;
}

.btn-outline-danger {
    border-color: rgba(var(--color-danger), 0.5);
    color: rgb(var(--color-danger));
    background: rgba(var(--color-danger), 0.08);
}

.btn-outline-light {
    border-color: rgba(148, 163, 184, 0.4);
    color: rgb(var(--color-ink-800));
    background: #131d35;
}

.btn-group {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.btn-group-sm .btn { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.table .btn {
    height: 34px;
    min-width: 34px;
    padding: 0 0.6rem;
}

.table .btn i {
    line-height: 1;
}

.table .btn + .btn {
    margin-left: 0.35rem;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
    width: 100%;
}

.table .badge {
    min-width: 88px;
    justify-content: center;
}

/* Forms */
.form-label {
    display: block;
    font-weight: 600;
    color: rgb(var(--color-ink-700));
    margin-bottom: 0.35rem;
}

.form-control,
.form-select,
.form-range {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    padding: 0.65rem 0.85rem;
    background: #0d1628;
    color: rgb(var(--color-ink-900));
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    /* Formuliervelden hebben geen font-size uit de body-stylesheet, maar hun
       eigen (kleinere) UA-default. Onder 16px zoomt iOS Safari automatisch
       in bij focus, dus die ondergrens expliciet forceren. */
    font-size: 16px;
}

/* Native datum-/tijdvelden: voorkom iOS-eigenaardigheden (gecentreerde tekst, eigen breedte) */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="month"].form-control {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    min-height: 44px;
    text-align: left;
}
input[type="date"].form-control::-webkit-date-and-time-value,
input[type="time"].form-control::-webkit-date-and-time-value {
    text-align: left;
    margin: 0;
}

.form-control:hover,
.form-select:hover {
    border-color: rgba(148, 163, 184, 0.5);
}

.form-control::placeholder,
.form-select::placeholder,
.form-range::placeholder {
    color: rgba(var(--color-ink-700), 0.85);
}

.form-control:focus,
.form-select:focus,
.form-range:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.75);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.form-select-sm { font-size: 0.85rem; padding: 0.4rem 0.6rem; }
.form-control-sm { font-size: 0.85rem; padding: 0.4rem 0.6rem; }

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: rgb(var(--color-brand-500));
}

.form-check-label {
    font-weight: 600;
    color: rgb(var(--color-ink-700));
}

/* Cards */
.card {
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--shadow-card);
    width: 100%;
}

.card-body { padding: 1.5rem; }

.shadow-sm { box-shadow: var(--shadow-card); }
.shadow { box-shadow: var(--shadow-soft); }
.border-0 { border: 0 !important; }
.border { border: 1px solid var(--border-default); }
.border-bottom { border-bottom: 1px solid var(--border-default); }
.border-top { border-top: 1px solid var(--border-default); }

.rounded { border-radius: 0.75rem; }
.rounded-circle { border-radius: 999px; }
img.rounded-circle {
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* Table */
.table-responsive { overflow-x: auto; border-radius: 1rem; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #131d35;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}
.table th,
.table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    vertical-align: middle;
}

.table thead {
    background: rgba(19, 29, 53, 0.92);
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(var(--color-ink-700), 1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
}
.table-light { background: rgba(19, 29, 53, 0.92); }
.table-hover tbody tr:hover { background: rgba(34, 197, 94, 0.09); }
.align-middle th,
.align-middle td { vertical-align: middle; }
.table td:last-child,
.table th:last-child {
    text-align: right;
}

@media (max-width: 480px) {
    .brand-club-name {
        display: none;
    }
}

@media (max-width: 640px) {
    /* Ook de compacte formuliervelden op 16px houden op mobiel, anders
       zoomt iOS Safari alsnog in bij focus. */
    .form-control-sm,
    .form-select-sm {
        font-size: 16px;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.6rem;
    }

    .table td {
        white-space: nowrap;
    }

    .table td:first-child {
        white-space: normal;
    }

    .table .btn {
        height: 30px;
        min-width: 30px;
        padding: 0 0.45rem;
    }

    .table .badge {
        min-width: 72px;
        font-size: 0.7rem;
    }

    .table-stacked thead {
        display: none;
    }

    .table-stacked tbody tr {
        display: block;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.25);
        border-radius: 1rem;
        background: #131d35;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    .table-stacked tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.4rem 0;
        border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
        text-align: left;
    }

    .table-stacked tbody td:last-child {
        border-bottom: 0;
    }

    .table-stacked tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(var(--color-ink-500), 1);
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .table-stacked .table-actions {
        justify-content: flex-start;
        width: auto;
    }

    /* Teams: hele kaart is tikbaar naar de teampagina, dus geen aparte
       actieknoppen meer op de kaart (bewerken/verwijderen staan op de
       teampagina zelf). */
    .teams-table-card .teams-row-actions {
        display: none;
    }
    .teams-table-card .table-stacked tbody tr.teams-row-link {
        cursor: pointer;
    }
    .players-table-card .table-stacked tbody tr.players-row-link {
        cursor: pointer;
    }

    /* Teams: kaartkop met naam + pijltje i.p.v. label/waarde-rij, duidelijker
       herkenbaar als tikbare kaart dan platte tekst. */
    .teams-table-card .teams-name-cell {
        display: flex;
        padding: 0 0 0.65rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }
    .teams-table-card .teams-name-cell::before {
        display: none;
    }
    .teams-table-card .teams-name-link {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        width: 100%;
    }
    .teams-table-card .teams-name-text {
        flex: 1;
        font-size: 1.05rem;
        font-weight: 700;
    }
    .teams-table-card .teams-name-chevron {
        display: inline-block;
        color: rgba(148, 163, 184, 0.7);
        font-size: 0.9rem;
    }

    /* Spelersbeoordelingen (wedstrijd bewerken): naam bovenaan als kaartkop
       i.p.v. label/waarde-rij, en rating/goals/assists naast elkaar als
       compacte mini-stats i.p.v. drie losse volle-breedte rijen. */
    .player-ratings-table .player-ratings-name-cell {
        padding: 0 0 0.65rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }
    .player-ratings-table .player-ratings-name-cell::before {
        display: none;
    }

    .player-ratings-table td[data-label="Aanwezig"] {
        flex-wrap: wrap;
    }
    .player-ratings-table td[data-label="Aanwezig"] .absence-reason {
        flex: 1 0 100%;
    }

    .player-ratings-table tbody tr {
        display: flex;
        flex-wrap: wrap;
    }
    .player-ratings-table td[data-label="Speler"],
    .player-ratings-table td[data-label="Aanwezig"],
    .player-ratings-table td[data-label="Notities"] {
        flex: 1 0 100%;
    }
    .player-ratings-table td[data-label="Rating"],
    .player-ratings-table td[data-label="Goals"],
    .player-ratings-table td[data-label="Assists"] {
        flex: 1 1 33.33%;
        flex-direction: column;
        justify-content: center;
        gap: 0.3rem;
        border-bottom: none;
        padding: 0.5rem 0.25rem;
    }
    .player-ratings-table td[data-label="Rating"]::before,
    .player-ratings-table td[data-label="Goals"]::before,
    .player-ratings-table td[data-label="Assists"]::before {
        font-size: 0.65rem;
    }
    .player-ratings-table td[data-label="Rating"] .stat-input,
    .player-ratings-table td[data-label="Goals"] .stat-input,
    .player-ratings-table td[data-label="Assists"] .stat-input {
        width: 4.5rem;
        margin: 0 auto;
    }
    .player-ratings-table td[data-label="Notities"] {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
    .player-ratings-table td[data-label="Notities"] input {
        width: 100%;
    }
}

.teams-name-chevron {
    display: none;
}
.table-bordered th,
.table-bordered td {
    border: 1px solid rgba(71, 85, 105, 0.45);
}

/* Dashboard: volgende-training-banner */
.next-training-banner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    text-decoration: none;
    background: linear-gradient(90deg, rgba(21, 128, 61, 0.25) 0%, rgba(34, 197, 94, 0.12) 60%, rgba(15, 118, 110, 0.15) 100%);
    border: 1px solid rgba(34, 197, 94, 0.45);
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.next-training-banner:hover {
    border-color: rgba(34, 197, 94, 0.75);
    transform: translateY(-1px);
}
.next-training-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.next-training-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}
.next-training-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4ade80;
}
.next-training-title {
    color: rgb(var(--color-ink-900));
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-training-meta {
    color: rgb(var(--color-ink-500));
    font-size: 0.82rem;
}
.next-training-chevron {
    color: rgb(var(--color-ink-500));
    flex-shrink: 0;
}
.next-training-banner--live {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.28) 0%, rgba(239, 68, 68, 0.12) 60%, rgba(15, 23, 42, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
}
.next-training-banner--live:hover {
    border-color: rgba(239, 68, 68, 0.8);
}
.next-training-banner--live .next-training-icon {
    background: rgba(239, 68, 68, 0.22);
    color: #f87171;
}
.next-training-banner--live .next-training-label {
    color: #f87171;
}

/* Live wedstrijd badge/pil (sidebar + topbar) */
.sidepanel-live-badge,
.topbar-live-pill {
    animation: live-badge-pulse 1.6s ease-in-out infinite;
}
@keyframes live-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(var(--color-ink-900));
    background: #131d35;
    border: 1px solid rgba(148, 163, 184, 0.35);
    line-height: 1;
    vertical-align: middle;
}

.badge.bg-success { color: #04120b; background: rgba(var(--color-brand-500), 0.65); }
.badge.bg-primary { color: #071322; background: rgba(var(--color-primary), 0.6); }
.badge.bg-warning { color: #211204; background: rgba(var(--color-warning), 0.65); }
.badge.bg-danger { color: #1f0a0a; background: rgba(var(--color-danger), 0.7); }
.badge.bg-secondary { color: rgb(var(--color-ink-900)); background: rgba(var(--color-ink-300), 0.45); }
.badge.bg-info { color: #04121a; background: rgba(var(--color-info), 0.65); }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid transparent;
    border-left-width: 4px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #17233f;
    color: rgb(var(--color-ink-900));
    box-shadow: 0 12px 24px rgba(2, 6, 16, 0.35);
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert > i:first-child {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
    border-left-color: rgba(34, 197, 94, 0.75);
}

.alert-success > i:first-child { color: rgb(34, 197, 94); }

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    border-left-color: rgba(239, 68, 68, 0.75);
}

.alert-danger > i:first-child { color: rgb(239, 68, 68); }

.alert-warning {
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(234, 179, 8, 0.32);
    border-left-color: rgba(234, 179, 8, 0.75);
}

.alert-warning > i:first-child { color: rgb(234, 179, 8); }

.alert-info {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    border-left-color: rgba(56, 189, 248, 0.75);
}

.alert-info > i:first-child { color: rgb(56, 189, 248); }

.alert-link { color: rgb(var(--color-brand-600)); font-weight: 600; }

/* Close button */
.btn-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: rgba(148, 163, 184, 0.15);
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-close::before,
.btn-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: rgba(226, 232, 240, 0.9);
}

.btn-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.btn-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.btn-close-white {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.4);
}

.btn-close-white::before,
.btn-close-white::after {
    background: rgba(226, 232, 240, 0.9);
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    color: rgba(var(--color-ink-700), 1);
    margin-right: 0.5rem;
}

.breadcrumb-item a {
    color: rgb(var(--color-brand-600));
}

.breadcrumb-item.active { color: rgba(var(--color-ink-700), 1); }

/* Nav pills */
.nav { list-style: none; padding: 0; margin: 0; }
.nav-pills .nav-link {
    padding: 0.6rem 0.9rem;
    border-radius: 0.75rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:hover {
    background: rgba(34, 197, 94, 0.12);
}

.nav-link.active {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(var(--color-ink-900));
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    padding: 0.5rem;
    background: #131d35;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.3);
    display: none;
    z-index: 1200;
    list-style: none;
    margin: 0;
}

.dropdown-menu-end { right: 0; left: auto; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-header { font-size: 0.75rem; color: rgba(var(--color-ink-700), 1); text-transform: uppercase; padding: 0.4rem 0.75rem; }
.dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.65rem;
    color: rgb(var(--color-ink-900));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dropdown-item:hover { background: rgba(34, 197, 94, 0.12); }
.dropdown-item.active { background: rgba(34, 197, 94, 0.2); color: rgb(var(--color-brand-600)); }
.dropdown-item.text-success { color: rgb(var(--color-brand-600)); }
.dropdown-divider { height: 1px; background: rgba(148, 163, 184, 0.3); margin: 0.4rem 0; }

/* Offcanvas */
.offcanvas {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    height: calc(100svh - var(--topbar-height));
    width: 264px;
    transform: translateX(-110%);
    color: #e2e8f0;
    transition: transform 0.3s ease;
    z-index: 1300;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
    padding-bottom: var(--safe-bottom);
}

.offcanvas.is-open { transform: translateX(0); }

/* Sidepanel — donker, modern paneel */
.sidepanel {
    background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
    width: 264px;
    display: flex;
    flex-direction: column;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.sidepanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    flex: 0 0 auto;
    background: transparent;
}

.sidepanel-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.5);
}

.sidepanel-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.08);
    color: rgba(226, 232, 240, 0.75);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidepanel-toggle:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
}

.sidepanel-toggle i {
    font-size: 0.85rem;
    transition: transform 0.25s ease;
}

.sidepanel-aftrap {
    padding: 0.7rem 0.85rem 0;
    flex: 0 0 auto;
}

.sidepanel-aftrap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(185, 28, 28, 0.9));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
}

.sidepanel-aftrap-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.35);
}

.sidepanel-aftrap-btn--live {
    animation: live-badge-pulse 1.6s ease-in-out infinite;
}

.sidepanel-body {
    padding: 0.9rem 0.85rem 1rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidepanel-body::-webkit-scrollbar { width: 6px; }
.sidepanel-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.sidepanel-body .nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidepanel-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.42);
    padding: 0 0.75rem;
    margin: 1.1rem 0 0.35rem;
}

.sidepanel-body .nav > .nav-item:first-child .nav-link {
    margin-top: 0.1rem;
}

.sidepanel .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.52rem 0.75rem;
    color: rgba(226, 232, 240, 0.78);
    background: transparent;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.sidepanel .nav-link:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #ffffff;
}

.sidepanel .nav-link.active {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(21, 128, 61, 0.95));
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

.sidepanel .nav-link.active .sidepanel-link-icon {
    color: #ffffff;
}

.sidepanel-link-icon {
    width: 1.25rem;
    text-align: center;
    font-size: 1.02rem;
    flex: 0 0 1.25rem;
    color: rgba(226, 232, 240, 0.6);
}

.sidepanel .nav-link:hover .sidepanel-link-icon {
    color: #ffffff;
}

.sidepanel .nav-link .badge {
    margin-left: auto;
}

/* Gebruikersblok onderin */
.sidepanel-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0.85rem calc(0.8rem + var(--safe-bottom));
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.45);
}

.sidepanel-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.sidepanel-user:hover {
    background: rgba(148, 163, 184, 0.12);
}

.sidepanel-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.9), rgba(21, 128, 61, 0.9));
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.sidepanel-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidepanel-user-name {
    color: #f1f5f9;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidepanel-user-role {
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.75rem;
    font-weight: 600;
}

.sidepanel-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    color: rgba(226, 232, 240, 0.65);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidepanel-logout:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1400;
    padding: 1.5rem;
}

.modal.is-open { display: flex; }

.modal-dialog {
    width: min(520px, 100%);
    max-height: 90vh;
}

.modal-dialog-centered { align-self: center; }

.modal-content {
    background: #131d35;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
}

.modal-header,
.modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(19, 29, 53, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.modal-body { padding: 1.5rem; }

body.modal-open,
body.offcanvas-open {
    overflow: hidden;
    /* iOS Safari: position fixed voorkomt scroll-through achter overlay */
    position: fixed;
    width: 100%;
    /* top wordt via JS gezet om scroll-positie te behouden */
}

/* Pagination */
.pagination {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: rgb(var(--color-ink-800));
    background: #131d35;
}

.page-item.active .page-link {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(var(--color-brand-700));
    border-color: rgba(34, 197, 94, 0.45);
}

/* List group */
.list-group { list-style: none; padding: 0; margin: 0; }
.list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.4);
}

.list-group-flush .list-group-item {
    border-radius: 0;
}

.list-group-item-action:hover { background: rgba(56, 255, 140, 0.08); }

/* Page header animation */
.page-header {
    margin-bottom: 1.5rem;
    animation: none;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

/* Uniforme paginakoppen: overal dezelfde donkere titel, ongeacht de
   (historisch wisselende) markup per pagina. */
.app-main h1 {
    color: rgb(var(--color-ink-900)) !important;
    letter-spacing: -0.01em;
    font-weight: 800;
}

.page-subtitle {
    color: rgba(var(--color-ink-500), 1);
    margin-top: 0.35rem;
    margin-bottom: 1rem;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeIn {
    from { opacity: 0.01; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .app-main {
        animation: none;
    }
}

/* Floating mobile back button */
.mobile-back-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgb(var(--color-brand-500));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(56, 255, 140, 0.25);
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-back-btn:hover {
    background-color: rgb(var(--color-brand-600));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(56, 255, 140, 0.3);
}

/* Statistics page */
.statistics-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.statistics-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.statistics-modern .stats-kpi-grid .card {
    background: #131d35;
    border-color: rgba(148, 163, 184, 0.3);
}

.statistics-modern .btn {
    border-radius: 9px;
}

.statistics-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.statistics-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

.statistics-modern .stats-export-btn {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.22);
    color: rgba(34, 197, 94, 0.92);
    font-weight: 600;
    box-shadow: none;
}

.statistics-modern .stats-export-btn:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.statistics-modern .stats-export-btn i {
    opacity: 0.85;
}

.statistics-modern .form-select {
    border-radius: 9px;
    border-color: rgba(148, 163, 184, 0.4);
    min-width: 220px;
}

.statistics-modern .stats-kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.statistics-modern .stats-kpi-icon-glyph {
    color: #22c55e;
}

.statistics-modern .stats-kpi-grid .fs-4 {
    letter-spacing: -0.02em;
}

.statistics-modern .stats-panels .card-title {
    letter-spacing: -0.01em;
}

.statistics-modern .list-group-item {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.statistics-modern .list-group-item:last-child {
    border-bottom: 0;
}

.statistics-modern .stats-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    font-weight: 700;
}

.statistics-modern .stats-table thead th {
    background: #18223b;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.statistics-modern .stats-table td {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.statistics-modern .stats-pill {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #18223b;
    color: rgb(var(--color-ink-800));
    font-weight: 700;
}

.statistics-modern .stats-pill.is-home {
    border-left: 3px solid #22c55e;
}

.statistics-modern .stats-pill.is-away {
    border-left: 3px solid #1d4ed8;
}

.statistics-modern .stats-result.is-win {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.25);
}

.statistics-modern .stats-result.is-loss {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.2);
}

.statistics-modern .stats-result.is-draw {
    background: rgba(202, 138, 4, 0.1);
    color: #a16207;
    border-color: rgba(202, 138, 4, 0.25);
}

/* Calendar page */
.calendar-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.calendar-modern .calendar-title-icon {
    color: #22c55e;
}

.calendar-modern .calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.calendar-modern .calendar-nav-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    flex: 1 1 100%;
    order: -1;
    text-align: center;
}

.calendar-modern .calendar-nav-title h4 {
    font-size: 1.1rem;
}

.calendar-modern .calendar-nav-controls {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

@media (min-width: 576px) {
    .calendar-modern .calendar-nav-title {
        flex: 0 1 auto;
        order: 0;
    }
    .calendar-modern .calendar-nav-title h4 {
        font-size: 1.5rem;
    }
    .calendar-modern .calendar-nav-controls {
        width: auto;
    }
}

.calendar-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.calendar-modern .table-responsive {
    border-radius: inherit;
}

.calendar-modern .btn {
    border-radius: 9px;
}

.calendar-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.calendar-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

/* Mobiele agenda-lijst */
.calendar-modern .calendar-agenda-day {
    display: flex;
    gap: 0.75rem;
    background: linear-gradient(180deg, #17233f 0%, #131e38 100%);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
}
.calendar-modern .calendar-agenda-day.is-today {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}
.calendar-modern .calendar-agenda-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 0.3rem;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    flex-shrink: 0;
    align-self: flex-start;
}
.calendar-modern .calendar-agenda-daynum {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #4ade80;
    line-height: 1.1;
}
.calendar-modern .calendar-agenda-dayname {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgb(var(--color-ink-500));
}
.calendar-modern .calendar-agenda-events {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.calendar-modern .calendar-agenda-event {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.5rem;
    align-items: center;
    text-decoration: none;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.06);
}
.calendar-modern .calendar-agenda-event i { grid-row: span 2; font-size: 0.95rem; }
.calendar-modern .calendar-agenda-event.is-match i { color: #fbbf24; }
.calendar-modern .calendar-agenda-event.is-training i,
.calendar-modern .calendar-agenda-event.is-program i { color: #4ade80; }
.calendar-modern .calendar-agenda-title {
    color: rgb(var(--color-ink-900));
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-modern .calendar-agenda-meta {
    color: rgb(var(--color-ink-500));
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-modern .calendar-grid-table {
    table-layout: fixed;
}

.calendar-modern .calendar-grid-table thead th {
    background: #18223b;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.calendar-modern .calendar-weekend-col {
    background: #f1f5f9;
}

.calendar-modern .calendar-day-cell {
    height: 120px;
    vertical-align: top;
    padding: 0.5rem;
    background: #131d35;
}

.calendar-modern .calendar-empty-cell {
    background: #18223b;
}

.calendar-modern .calendar-today {
    background: rgba(34, 197, 94, 0.08);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.calendar-modern .calendar-event-badge {
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-weight: 700;
}

.calendar-modern .calendar-event-badge.is-match {
    background: rgba(202, 138, 4, 0.12);
    color: #854d0e;
    border-color: rgba(202, 138, 4, 0.25);
}

.calendar-modern .calendar-event-badge.is-training {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.25);
}

.calendar-modern .calendar-event-badge.is-program {
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
    border-color: rgba(29, 78, 216, 0.25);
}

.calendar-modern .list-group-item {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.calendar-modern .list-group-item:last-child {
    border-bottom: 0;
}

.calendar-modern .calendar-list-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.calendar-modern .calendar-list-icon-glyph {
    color: #22c55e;
}

.calendar-modern .calendar-meta-badge {
    background: #18223b;
    color: rgb(var(--color-ink-800));
    border-color: rgba(148, 163, 184, 0.35);
}

/* History page */
.history-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.history-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.history-modern .history-season-card {
    border-color: rgba(148, 163, 184, 0.3);
}

.history-modern .history-kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 132px;
}

.history-modern .history-kpi-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.history-modern .history-kpi-glyph {
    color: #22c55e;
}

.history-modern .card-header {
    background: #131d35 !important;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.history-modern .card-body {
    padding: 1.15rem 1.2rem;
}

.history-modern .btn {
    border-radius: 9px;
}

.history-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.history-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

.history-modern .history-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.5rem;
}


.flatpickr-current-month .numInputWrapper input::selection {
    background: rgba(34, 197, 94, 0.2);
}

.flatpickr-weekdays {
    background: #131d35;
}

.history-modern .history-insight-pill {
    justify-content: flex-start;
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: #18223b;
    color: rgb(var(--color-ink-900));
    font-weight: 700;
}

.history-modern .history-kpi-card {
    padding: 1rem 0.9rem;
}

.history-modern .list-group-item {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.history-modern .list-group-item:last-child {
    border-bottom: 0;
}

.history-modern .history-event-badge {
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #18223b;
    color: rgb(var(--color-ink-900));
}

.history-modern .history-event-badge.is-match {
    border-left: 3px solid #ca8a04;
}

.history-modern .history-event-badge.is-training {
    border-left: 3px solid #22c55e;
}

.history-modern .table thead th {
    background: #18223b;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Teams page */
.teams-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.teams-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.teams-modern .btn {
    border-radius: 9px;
}

.teams-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.teams-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

.team-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    border-radius: 11px;
    padding: 0.5rem 0.95rem;
}

.teams-modern .teams-create-btn {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.22);
    color: rgba(34, 197, 94, 0.92);
    font-weight: 600;
    box-shadow: none;
}

.teams-modern .teams-create-btn:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.teams-modern .teams-filter-card .card-body,
.teams-modern .teams-table-card .card-body {
    padding: 1.15rem 1.2rem;
}

.teams-modern .table thead th {
    background: #18223b;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.teams-modern .badge.bg-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.teams-modern .badge.bg-secondary {
    background: #18223b;
    color: rgb(var(--color-ink-800));
    border: 1px solid rgba(148, 163, 184, 0.32);
}

/* Players page */
.players-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.players-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.players-modern .btn {
    border-radius: 9px;
}

.players-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.players-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

.players-modern .players-create-btn {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.22);
    color: rgba(34, 197, 94, 0.92);
    font-weight: 600;
}

.players-modern .players-create-btn:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.players-modern .players-filter-card .card-body,
.players-modern .players-table-card .card-body {
    padding: 1.15rem 1.2rem;
}

.players-modern .page-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.players-modern .players-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.players-modern .players-mobile-action {
    display: inline-flex;
}

.players-modern .players-desktop-action {
    display: none;
}

.players-modern .table thead th {
    background: #18223b;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.players-modern .badge.bg-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.players-modern .badge.bg-secondary {
    background: #18223b;
    color: rgb(var(--color-ink-800));
    border: 1px solid rgba(148, 163, 184, 0.32);
}

/* Staff: mobiele kaartweergave i.p.v. generieke label/waarde-stacking */
.staff-cards-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .staff-table-desktop {
        display: none;
    }
    .staff-cards-mobile {
        display: block;
    }
}

.staff-cards-mobile .d-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.staff-card-mobile {
    background: #131d35;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.9rem;
    padding: 1.25rem;
}

.staff-card-mobile-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.staff-card-mobile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.staff-card-mobile-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgb(var(--color-ink-900));
    background: linear-gradient(160deg, rgba(34, 197, 94, 0.28), rgba(16, 185, 100, 0.06) 70%), #14213a;
    border: 2px solid rgba(34, 197, 94, 0.5);
}

.staff-card-mobile-info {
    flex: 1;
    min-width: 0;
}

.staff-card-mobile-info .fw-semibold {
    margin-bottom: 0.2rem;
}

.staff-card-mobile-meta {
    margin-top: 0.9rem;
    line-height: 1.5;
}

.staff-card-mobile-meta + .staff-card-mobile-meta {
    margin-top: 0.35rem;
}

.staff-card-mobile-meta i {
    color: #4ade80;
    margin-right: 0.3rem;
}

.staff-card-mobile-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.2);
}

.staff-card-mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgb(var(--color-ink-700));
    text-decoration: none;
}

.staff-card-mobile-contact-item i {
    color: #4ade80;
}

.staff-card-mobile-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.staff-card-mobile-actions .btn {
    flex: 1;
}

/* Assessments page */
.assessments-modern .h3 {
    color: rgb(var(--color-ink-900));
    letter-spacing: -0.01em;
}

.assessments-modern .card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.assessments-modern .btn {
    border-radius: 9px;
}

.assessments-modern .btn-outline-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.assessments-modern .btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

/* Zonder dit lopen "Aftrap"/"Wedstrijd"/"Training" op smalle schermen door de
   rand heen i.p.v. netjes door te lopen naar een tweede regel (zie ook de
   zelfde fix bij .players-modern). */
.assessments-modern .page-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.assessments-modern .assessments-filter-card .card-body,
.assessments-modern .assessments-table-card .card-body {
    padding: 1.15rem 1.2rem;
}

.assessments-modern .table thead th {
    background: #18223b;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.assessments-modern .assessment-create-card .card-body {
    padding: 1.15rem 1.2rem;
}

.assessments-modern .assessment-create-card .btn {
    border-radius: 9px;
}

.assessments-modern .assessment-create-card .bg-light {
    background: #111c33 !important;
}

@media (min-width: 768px) {
    .mobile-back-btn { display: none !important; }
}

@media (min-width: 1024px) {
    /* De hamburger in de topbar is alleen voor mobiel; op desktop zit de
       toggle ín het menu zelf. */
    .menu-toggle { display: none; }
    .sidepanel-toggle { display: inline-flex; }

    .offcanvas.sidepanel {
        position: sticky;
        top: 0;
        transform: none;
        height: calc(100svh - var(--topbar-height));
        width: 264px;
        flex: 0 0 264px;
        z-index: 1200;
        transition: width 0.25s ease, flex-basis 0.25s ease;
    }

    /* Ingeklapte rail */
    body.sidebar-collapsed .offcanvas.sidepanel {
        width: 76px;
        flex-basis: 76px;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-header {
        justify-content: center;
        padding: 0.85rem 0.5rem;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-title {
        display: none;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-toggle i {
        transform: rotate(180deg);
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-body {
        padding: 0.8rem 0.55rem 1rem;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .nav-link {
        justify-content: center;
        padding: 0.6rem;
        gap: 0;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-aftrap {
        padding: 0.7rem 0.55rem 0;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-aftrap-btn {
        padding: 0.6rem;
        gap: 0;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .nav-label {
        display: none;
    }

    /* Sectiekop wordt een subtiele scheidslijn */
    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-heading {
        font-size: 0;
        padding: 0;
        margin: 0.7rem 0.9rem;
        border-top: 1px solid rgba(148, 163, 184, 0.18);
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-link-icon {
        margin: 0;
        font-size: 1.15rem;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .nav-link .badge {
        position: absolute;
        top: 2px;
        right: 2px;
        margin: 0;
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .nav-item {
        position: relative;
    }

    /* Footer: alleen avatar, gecentreerd */
    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-footer {
        flex-direction: column;
        gap: 0.4rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-user {
        padding: 0.25rem;
        justify-content: center;
    }

    body.sidebar-collapsed .offcanvas.sidepanel .sidepanel-user-info {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .statistics-modern .stats-toolbar {
        align-items: flex-start !important;
    }

    .statistics-modern .form-select {
        min-width: 170px;
    }

    .calendar-modern .calendar-day-cell {
        height: 95px;
    }

    .history-modern .history-insights {
        grid-template-columns: 1fr;
    }
}

.history-modern .page-header [aria-label="Terug"],
.teams-modern .page-header [aria-label="Terug"],
.players-modern .page-header [aria-label="Terug"] {
    display: none !important;
}

@media (max-width: 767.98px) {
    .players-modern .page-header-actions {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
        gap: 0.4rem;
    }

    .players-modern .players-header-action {
        display: none !important;
    }

    .players-modern .players-mobile-action {
        display: inline-flex !important;
        flex: 0 0 auto;
        justify-content: center;
        font-size: 0.82rem;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .players-modern .players-mobile-action:hover {
        background: rgba(34, 197, 94, 0.1);
    }
}

@media (min-width: 768px) {
    .players-modern .players-mobile-action {
        display: none;
    }

    .players-modern .players-desktop-action {
        display: inline-flex;
    }
}

/* ---------------------------------------------------------------------------
   Donker thema — afwerking
--------------------------------------------------------------------------- */
::selection {
    background: rgba(34, 197, 94, 0.35);
    color: #ffffff;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 999px;
}
*::-webkit-scrollbar-track { background: transparent; }

:is(a, button, .btn, .form-control, .form-select):focus-visible {
    outline: 2px solid rgba(34, 197, 94, 0.55);
    outline-offset: 2px;
}

.card-header {
    padding: 1rem 1.5rem;
    background: rgba(148, 163, 184, 0.05);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px 12px 0 0;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: rgba(148, 163, 184, 0.05);
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 0 0 12px 12px;
}

hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* Formulier-widgets in donker */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%238ea0bc' d='M1.5 5.5l6.5 6 6.5-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

input[type="date"], input[type="time"], input[type="datetime-local"] {
    color-scheme: dark;
}

/* Air-datepicker op donker */
.air-datepicker {
    --adp-background-color: #131d35;
    --adp-background-color-hover: #1d2942;
    --adp-color: #edf2f9;
    --adp-color-secondary: #8ea0bc;
    --adp-accent-color: #22c55e;
    --adp-color-current-date: #4ade80;
    --adp-border-color: rgba(148, 163, 184, 0.25);
    --adp-border-color-inner: rgba(148, 163, 184, 0.16);
    --adp-nav-color: #c3d0e2;
    --adp-color-other-month: #55688a;
    --adp-day-name-color: #4ade80;
    --adp-cell-background-color-selected: #16a34a;
    --adp-cell-background-color-selected-hover: #15803d;
}

.sidepanel-avatar-photo {
    object-fit: cover;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.topbar-greeting {
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .d-lg-inline { display: inline; }
}

/* ---- Gedeelde aanmaak/bewerk-kaart (zelfde look als speler/team aanmaken) ---- */
.create-shell {
    max-width: 1040px;
    margin: 0 auto;
}

.create-shell--narrow {
    max-width: 720px;
}

.create-header {
    margin-bottom: 1rem;
}

.create-subtitle {
    color: #8ea0bc;
    font-size: 0.95rem;
}

.create-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.create-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #15803d 0%, #22c55e 50%, #0f766e 100%);
}

.create-form-panel {
    background: linear-gradient(180deg, #17233f 0%, #131e38 100%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.9rem;
    overflow: hidden;
}

.create-panel-header {
    padding: 0.9rem 1.2rem;
}

.team-context-banner {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.team-context-label {
    letter-spacing: 0.06em;
}

/* Staf-chips: hergebruikt op teamdetail en op de beoordeling-aanmaakschermen */
.staff-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 2rem;
    padding: 0.25rem 0.6rem 0.25rem 0.3rem;
    font-size: 0.85rem;
    line-height: 1.3;
    border: 1px solid transparent;
}

.staff-chip .staff-chip-avatar {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    flex: 0 0 auto;
}

.staff-chip .staff-chip-role {
    font-size: 0.72rem;
    opacity: 0.75;
}

.staff-chip-hoofd     { background: rgba(34, 197, 94, 0.22);  border-color: rgba(34, 197, 94, 0.6); font-weight: 600; }
.staff-chip-assistent { background: rgba(56, 189, 248, 0.16); border-color: rgba(56, 189, 248, 0.45); }
.staff-chip-leider    { background: rgba(148, 163, 184, 0.16); border-color: rgba(148, 163, 184, 0.5); }

.create-section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #4ade80;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Wachtwoordveld naast een genereer-knop mag krimpen i.p.v. overlopen */
.password-generate-row .form-control {
    min-width: 0;
    font-size: 0.9rem;
}

/* ---- Keuze-chips: multi-select zonder Ctrl-klik (checkboxen als tikbare pillen) ---- */
.choice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.choice-chip {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.choice-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-chip span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #0d1628;
    color: rgba(var(--color-ink-700), 1);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.choice-chip span::before {
    content: "+";
    font-weight: 700;
    opacity: 0.6;
}

.choice-chip:hover span {
    border-color: rgba(34, 197, 94, 0.45);
    transform: translateY(-1px);
}

.choice-chip input:checked + span {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.55);
    color: #4ade80;
}

.choice-chip input:checked + span::before {
    content: "\2713";
    opacity: 1;
}

.choice-chip input:focus-visible + span {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.choice-chip span small {
    font-weight: 500;
    opacity: 0.75;
}

/* Rode variant van de create-kaart voor verwijder-/gevaarschermen */
.create-card--danger::before {
    background: linear-gradient(90deg, #991b1b 0%, #ef4444 50%, #b91c1c 100%);
}

/* ==========================================================================
   Chat-widget (rechtsonder) — intern berichtensysteem
   ========================================================================== */
.chat-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1400;
}

.chat-widget-bubble {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgb(var(--color-brand-600)), rgb(var(--color-brand-500)));
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 10px 24px rgba(2, 6, 16, 0.45);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease;
}
.chat-widget-bubble:hover { transform: translateY(-2px); }

.chat-widget-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: 360px;
    max-width: calc(100vw - 2rem);
    height: 480px;
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    background: #131d35;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(2, 6, 16, 0.5);
    flex-direction: column;
    overflow: hidden;
}
.chat-widget-panel:not(.d-none) { display: flex; }

.chat-widget-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(160deg, rgb(var(--color-brand-600)), rgb(var(--color-brand-500)));
    color: #fff;
    flex-shrink: 0;
}
.chat-widget-title { font-weight: 700; flex: 1 1 auto; font-size: 0.95rem; }
.chat-widget-header button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-widget-header button:not(.d-none) { display: inline-flex; }
.chat-widget-header button:hover { background: rgba(255, 255, 255, 0.28); }

.chat-widget-body {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-empty-state {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(var(--color-ink-500), 1);
    text-align: center;
    padding: 2rem 1rem;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.chat-empty-state i { font-size: 1.8rem; color: rgba(34, 197, 94, 0.5); }

.chat-thread-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.chat-bubble {
    max-width: 78%;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.86rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble-other {
    align-self: flex-start;
    background: #1d2942;
    color: rgb(var(--color-ink-900));
    border-bottom-left-radius: 0.25rem;
}
.chat-bubble-own {
    align-self: flex-end;
    background: rgb(var(--color-brand-600));
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}
.chat-bubble-time {
    font-size: 0.65rem;
    opacity: 0.65;
    margin-top: 0.2rem;
    display: block;
}
.chat-bubble-content p { margin: 0 0 0.4rem; }
.chat-bubble-content p:last-child { margin-bottom: 0; }
.chat-bubble-content ul { margin: 0 0 0.4rem; padding-left: 1.1rem; }
.chat-bubble-content ul:last-child { margin-bottom: 0; }
.chat-bubble-content li { margin-bottom: 0.15rem; }
.chat-bubble-typing { opacity: 0.7; font-style: italic; }
.chat-bubble-error { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.4); }

.chat-thread-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.6rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
}
.chat-thread-input {
    flex: 1 1 auto;
    resize: none;
    max-height: 90px;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.75rem;
    padding: 0.5rem 0.7rem;
    color: rgb(var(--color-ink-900));
    /* 16px, anders zoomt iOS Safari in bij focus */
    font-size: 16px;
    font-family: inherit;
}
.chat-thread-send {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: rgb(var(--color-brand-600));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-thread-send:disabled { opacity: 0.5; }

@media (max-width: 480px) {
    .chat-widget { right: 0.75rem; bottom: 0.75rem; }
    .chat-widget-panel {
        width: calc(100vw - 1.5rem);
        height: calc(100vh - 6rem);
        height: calc(100dvh - 6rem);
    }
}
