:root {
    /* Refined Color Palette */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-subject: #ffffff;
    /* White */

    --bg-slot-open: #f1f5f9;
    /* Slate 100 */
    --border-slot-open: #e2e8f0;
    /* Slate 200 */

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #f8fafc;
    /* Slate 50 */

    /* Brand Colors */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-dark: #4f46e5;
    /* Indigo 600 */

    --success: #10b981;
    /* Emerald 500 */
    --success-hover: #059669;
    /* Emerald 600 */

    --badge-bg: #0ea5e9;
    /* Sky 500 */

    --accent-1: #ec4899;
    /* Pink 500 */
    --accent-2: #8b5cf6;
    /* Violet 500 */

    /* Spacing System */
    --space-2xs: 0.25rem;
    /* 4px */
    --space-xs: 0.5rem;
    /* 8px */
    --space-sm: 0.75rem;
    /* 12px */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2.5rem;
    /* 40px */
    --space-2xl: 4rem;
    /* 64px */

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Card gap - één plek voor de afstand tussen cards */
    --gap-cards-admin:  0.5rem;   /* compact admin UI */
    --gap-cards-public: 1.25rem;  /* ruimer publiek */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: var(--space-2xl);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
}

.header-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.logo-img {
    max-width: 120px;
    height: auto;
    border-radius: var(--radius-md);
}

h1 {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-align: center;
    letter-spacing: -0.025em;
    color: var(--primary);   /* was een kleurverloop van primair naar accent; vervallen 28-10-2026 */
}

#main-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    text-align: center;
    color: var(--accent-1);
    display: inline-block;
    width: 100%;
}

/* Subject Container: een raster van even brede kaarten (29-10-2026). Eerder hing de breedte af
   van het aantal tijdsloten (1, 2 of 3+), waardoor kaarten ongelijk waren en de laatste soms breed;
   met een tijdslot per regel is dat niet meer nodig. */
#subjects-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--gap-cards-public);
    align-items: stretch;
}

.subject-card {
    background-color: var(--bg-subject);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-slot-open);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

@media (hover: hover) {
    .subject-card:hover {
        box-shadow: var(--shadow-lg);
    }
}

.subject-url-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.45rem 1.1rem;
    border-radius: 99px;
    border: none;
    color: var(--on-primary, #fff);
    background: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}

@media (hover: hover) {
    .subject-url-btn:hover {
        opacity: 0.88;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        transform: translateY(-1px);
    }
}

/* Grid Layout */
.grid-container {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-md);
    grid-template-columns: 1fr;
}

/* Specific class for 2 columns (Admin) */
.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

/* Specific class for 1 column (Frontend) */
.grid-cols-1 {
    grid-template-columns: 1fr;
}

/* .grid.gap-6 removed to prevent conflicts with utility classes */

.subject-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    /* Een titel loopt terug in plaats van af te breken met "..." (29-10-2026). */
    overflow-wrap: anywhere;
    text-wrap: balance;
}

/* Subject card top row wrapper: titel + datum/tags naast elkaar, wrappen als titel te lang is */
.subject-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 0.75rem;
    min-width: 0;
}
.subject-card-header .subject-title {
    margin-bottom: 0;
    flex: 0 0 auto;
    max-width: 100%;
}

/* Meta-groep: datum + tags altijd bij elkaar, nooit intern breken */
.subject-meta-group {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
}

/* Als één kaart op een rij de meta naar regel 2 wraps, zet alle kaarten op die rij ook op regel 2 */
.subject-card--meta-wrap .subject-card-header .subject-title {
    flex: 0 0 100%;
}

/* Datumbadge onder de activiteitstitel */
.subject-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-1);
    background: color-mix(in srgb, var(--accent-1, #ef4444) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-1, #ef4444) 30%, transparent);
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Slot Grid */
.slot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    margin-top: 0.25rem;
}



/* Slot Card (29-10-2026, naar Henri's schets in Figma): plat in de kaart, zonder eigen vlak.
   Bovenaan de tijd, dan per inschrijving een pil over de volle breedte en per vrije plaats een
   gestippelde pil "+ Inschrijven" (bij vol: "+ Reservelijst"). Tussen tijdsloten een dunne lijn. */
.slot-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.slot-card + .slot-card {
    border-top: 1px solid var(--border-slot-open);
    padding-top: 0.875rem;
}

/* Inschrijvingen als regels (29-10-2026): naam vet, de opmerking (ouder/verzorger van) gedempt
   erachter, het kruisje rechts. Een vrije plaats is een gestippelde regel met "+ Vrije plaats";
   klikken schrijft je in. Pillen naast elkaar liepen rafelig terug bij lange namen. */
.slot-card .spots-container { flex-direction: column; gap: 4px; }
.spot-chip {
    display: flex; align-items: center; gap: 6px;
    width: 100%; min-height: 34px;
    padding: 0 5px 0 14px; border-radius: 99px;   /* pilvorm (Henri, 29-10-2026) */
    background: color-mix(in srgb, var(--badge-bg) 10%, white);
    color: var(--text-main);
    font-size: 0.875rem;
    cursor: pointer; text-align: left; font-family: inherit;
}
.spot-chip-naam { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.spot-chip-opm { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.spot-chip-x {
    flex: 0 0 auto; margin-left: auto; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
}
@media (hover: hover) { .spot-chip-x:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-main); } }
.spot-chip--reserve {
    background: transparent;
    border: 1px dashed color-mix(in srgb, var(--badge-bg) 40%, white);
}
.spot-chip--leeg {
    background: transparent;
    border: 1.5px dashed color-mix(in srgb, var(--text-muted) 40%, white);
    color: var(--text-muted); font-weight: 500;
}
@media (hover: hover) {
    .spot-chip--leeg:hover {
        border-color: var(--success);
        color: var(--success);
        background: color-mix(in srgb, var(--success) 6%, white);
    }
}
.spot-chip--ingetrokken {
    background: transparent; cursor: default;
    border: 1px solid var(--border-slot-open);
    color: var(--text-muted);
}
.spot-chip--ingetrokken .spot-chip-naam { font-weight: 500; text-decoration: line-through; }
.spot-chip-meer { font-size: 0.8rem; color: var(--text-muted); padding-left: 15.5px; }   /* lijnt uit met de tekst in de pil: 14px opvulling plus 1,5px rand */
.slot-card > .slot-time { flex-wrap: wrap; column-gap: var(--space-xs); row-gap: 0; }
.slot-card > .slot-time > span:first-child { white-space: nowrap; }

.spots-container:empty { display: none; }

.slot-time {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    color: var(--text-main);
}

/* Spots Container */
.spots-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Unified Spot Item (Button & Badge) */
.spot-item {
    width: 100%;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s;
    min-height: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Open Spot (Button) */
.spot-item.open {
    background: var(--bg-success, var(--success));
    color: var(--on-success, #fff);
    cursor: pointer;
}

@media (hover: hover) {
    .spot-item.open:hover {
        background: var(--bg-success-hover, var(--success-hover));
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    }
}

/* Filled Spot (Badge) */
.spot-item.filled {
    background: var(--bg-badge, var(--badge-bg));
    color: var(--on-badge, #fff);
    justify-content: space-between;
    cursor: default;
}

/* Allow hovering on filled spots (e.g. for delete button or just visual feedback) */
.spot-item.filled:hover {
    background: var(--bg-badge-hover, var(--badge-hover));
}

/* Soft "Toch aanmelden" spot - target already met but still accepting */
.spot-item.soft {
    background: color-mix(in srgb, var(--success, #10b981) 70%, transparent);
    color: var(--on-success, #fff);
    cursor: pointer;
    font-size: 0.85rem;
    border: none;
}
@media (hover: hover) {
    .spot-item.soft:hover {
        background: var(--bg-success, var(--success, #10b981));
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    }
}

/* Reserve Spot (Badge) - active registrations beyond the target */
.spot-item.reserve {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: var(--badge-bg, #0ea5e9);
    justify-content: space-between;
    cursor: pointer;
}
@media (hover: hover) {
    .spot-item.reserve:hover {
        background: rgba(14, 165, 233, 0.22);
    }
}

/* Slot count indicator - full-width pill chip (status bar at top of slot card) */
.slot-count {
    display: block;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--border-slot-open);
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
}

/* Available slots chip - green tint */
.slot-count--available {
    color: var(--success, #10b981);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Target-met message inside a slot card - same pill style as slot-count */
.slot-target-met {
    display: block;
    width: 100%;
    padding: 4px 10px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--success, #10b981) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--success, #10b981) 30%, transparent);
    color: var(--success, #10b981);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
}

/* Badge-inhoud: naam en opmerking stromen inline.
   Past het op één regel → één regel.
   Past het niet → opmerking wraps naar regel 2. */
.spot-name {
    display: inline;
}

/* Naam-rij is ook inline zodat opmerking er direct achter kan */
.spot-name-row {
    display: inline;
}

/* Reserve-label inline naast naam */
.spot-reserve {
    font-size: 0.72rem;
    opacity: 0.75;
    display: inline;
    margin-left: 2px;
}

/* Separator: zichtbaar als opmerking op dezelfde regel staat (JS bepaalt) */
.spot-sep {
    display: inline;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Opmerking: inline-block zodat hij als geheel op één regel blijft
   of in zijn geheel naar regel 2 gaat - nooit halverwege afgebroken.
   Als de opmerking te lang is mag hij doorlopen op meerdere regels. */
.spot-comment {
    display: inline;
    white-space: normal;
    word-break: break-word;
    font-size: 0.8rem;
    opacity: 0.8;
    font-style: italic;
    vertical-align: baseline;
}

.spot-wrapper {
    position: relative;
    width: 100%;
}

/* Registration Delete Button (Absolute in wrapper) */
.btn-delete-registration {
    position: absolute;
    right: 12px;
    /* Adjusted from 8px to 12px per request */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--on-badge, #fff);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.8rem;
    z-index: 20;
}

.btn-delete-registration:hover {
    background: rgba(255, 255, 255, 0.4);
}

.spot-item.reserve + .btn-delete-registration {
    background: rgba(14, 165, 233, 0.5);
    color: white;
}

.spot-item.reserve + .btn-delete-registration:hover {
    background: rgba(14, 165, 233, 0.7);
}

/* ── Tag Filter Bar ─────────────────────────────────────── */
#tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.15rem;
}

.tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tag-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tag-filter-btn.tag-filter-all-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary, #fff);
}

.tag-filter-btn.tag-filter-tag-active {
    background: var(--tag-color, #6366f1);
    border-color: var(--tag-color, #6366f1);
    color: var(--tag-tekst, #fff);   /* contrastkleur bij de tagkleur, gezet door app.js */
}

.tag-filter-btn.tag-filter-none-active {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: white;
}

/* ── Terug-knop ─────────────────────────────────────────── */
.back-to-overview {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.15s;
}

.back-to-overview:hover {
    color: var(--primary);
}

/* Generic/Admin Delete Button */
.btn-delete {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.8rem;
    flex-shrink: 0;
    /* Restore relative/flex behavior for Admin */
    position: relative;
    margin-left: var(--space-xs);
}

.btn-delete:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.glass-card {
    background: white !important;
    border: 1px solid var(--border-slot-open) !important;
    box-shadow: var(--shadow-lg) !important;
    color: var(--text-main);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    width: 100%;
}

/* ... existing styles ... */

.glass-card h2 {
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--border-slot-open);
}

/* ... */

/* Tailwind-like Utilities for Admin Layout */
.bg-gray-50 {
    background-color: #f9fafb;
}

.text-gray-900 {
    color: #111827;
}

.font-sans {
    font-family: 'Outfit', sans-serif;
}

.max-w-7xl {
    max-width: 80rem;
}

.max-w-2xl {
    max-width: 42rem;
}

/* Added for Modal */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.m-0 {
    margin: 0 !important;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.font-bold {
    font-weight: 700;
}

.h-full {
    height: 100%;
}

.mb-8 {
    margin-bottom: 2rem;
}

.gap-8 {
    gap: 2rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.w-24 {
    width: 6rem;
}

.h-10 {
    height: 2.5rem;
}

.p-1 {
    padding: 0.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-red-600 {
    color: #dc2626;
}

.text-indigo-600 {
    color: #4f46e5;
}

.text-emerald-500 {
    color: #10b981;
}

.text-amber-500 {
    color: #f59e0b;
}

.hover\:text-red-700:hover {
    color: #b91c1c;
}

.hover\:bg-red-50:hover {
    background-color: #fef2f2;
}

/* Grid Responsive - Simplified naming to avoid escaping issues */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .md-grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Gradients for Text */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

.text-transparent {
    color: transparent;
}

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-indigo-600 {
    --tw-gradient-from: #4f46e5;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(79, 70, 229, 0));
}

.to-purple-600 {
    --tw-gradient-to: #9333ea;
}

.glass-card h2 {
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--border-slot-open);
}

.glass-card p {
    color: var(--text-muted);
}

.glass-card label {
    color: var(--text-main);
}

.glass-card input,
.glass-card textarea {
    background: white;
    border: 1px solid var(--border-slot-open);
    color: var(--text-main);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    width: 100%;
    font-family: inherit;
}

.glass-card input[type="radio"],
.glass-card input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
}

.glass-card textarea {
    resize: vertical;
    /* Only vertical resize */
}

.glass-card input:focus,
.glass-card textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Modal: flex column, overflow hidden clips to border-radius */
.modal-overlay .glass-card {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    padding: 0;
}

/* Scrollable content area inside modal */
.modal-body {
    overflow-y: auto;
    flex: 0 1 auto;
    padding: 1.25rem 1.5rem;
}

/* Action buttons - always visible at bottom, same look as reg-table sticky column */
.modal-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--border-slot-open);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-slot-open);
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-slot-open);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-primary {
    background: var(--bg-primary, var(--primary));
    color: var(--on-primary, #fff);
    border: none;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--bg-primary-hover, var(--primary-dark));
}

.hidden {
    display: none !important;
}


.gap-4 {
    gap: var(--space-md);
}

.text-muted {
    color: var(--text-muted);
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.font-normal {
    font-weight: 400;
}


/* Dashboard */
#progress-dashboard {
    margin-bottom: 1.5rem;
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    text-align: center;
}

/* Een kalender zonder voortgang (algemeen): geen kaart, een korte intro onder de titel. */
.dashboard-card.dashboard-intro {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.25rem;
}
.dashboard-intro #dashboard-main-title { font-size: 1.15rem; margin-bottom: 0.25rem; }

/* Dashboard titel krijgt accent-2 kleur */
#dashboard-main-title {
    color: var(--accent-2);
}

/* Vetgedrukte markdown tekst: primary kleur, geen extra vet gewicht */
.dashboard-card strong,
.subject-card strong,
.slot-card strong {
    color: var(--primary);
    font-weight: 600;
}

.progress-container {
    background: #e2e8f0;
    border-radius: 9999px;
    height: 12px;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    /* Het enige kleurverloop dat bleef (Henri, 28-10-2026): van primair naar accent, spectraal
       gemengd door app.js (--verloop-voortgang); dit gewone verloop is de terugval. */
    background: var(--verloop-voortgang, linear-gradient(90deg, var(--primary), var(--accent-1)));
    border-radius: 9999px;
    transition: width 1s ease-in-out;
    width: 0%;
}

.progress-text {
    display: none;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    text-align: center;
    flex-wrap: wrap;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (min-width: 640px) {
    .dashboard-card {
        padding: 3rem;
    }
}


.registration-content {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 1.4;
}

/* =========================================
   Semantic Classes (Replaces Utilities)
   ========================================= */

/* Minimal Utilities */
.mb-2 {
    margin-bottom: var(--space-xs);
}

.mb-6 {
    margin-bottom: var(--space-lg);
}

.text-center {
    text-align: center;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

.text-sm {
    font-size: 0.875rem;
}

/* Typography */
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.text-error {
    color: #ef4444;
}

.text-bold {
    font-weight: 700;
}

.text-italic {
    margin-bottom: 2rem;
}

.app-footer {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: var(--space-2xl);
    border-top: 1px solid var(--border-slot-open);
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Layout & Spacing */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.w-full {
    width: 100%;
}

/* Keeping w-full as it's a very standard helper */

/* Forms */
.form-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    margin-bottom: 0.375rem;
}

@media (min-width: 768px) {
    .form-section {
        grid-template-columns: 1fr 1fr;
    }

    .form-group.full-width {
        grid-column: span 2;
    }
}

.form-group {
    margin-bottom: 0.875rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

/* Hint/annotation inside a form-label (e.g. "(optioneel)") stays lowercase */
.form-label .text-muted {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Modals */
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Specific Components */
.cancelled-container {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-slot-open);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.cancelled-registration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fef2f2;
    /* bg-red-50 */
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.cancelled-details {
    font-size: 0.875rem;
    /* text-sm */
}

.cancelled-date {
    font-size: 0.75rem;
    /* text-xs */
    color: #f87171;
    /* text-red-400 */
    font-style: italic;
    margin-top: 0.25rem;
}

.btn-danger-sm {
    font-size: 0.75rem;
    /* text-xs */
    background-color: #ef4444;
    /* bg-red-500 */
    color: white;
    padding: 0.5rem 0.75rem;
    /* px-3 py-2 */
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger-sm:hover {
    background-color: #dc2626;
}

.new-slot-container {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-slot-open);
}

/* Custom Color Picker Styling */
input[type="color"].color-picker-input {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    height: 40px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

input[type="color"].color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"].color-picker-input::-webkit-color-swatch {
    border: 1px solid var(--border-slot-open);
    border-radius: var(--radius-sm);
}

input[type="color"].color-picker-input::-moz-color-swatch {
    border: 1px solid var(--border-slot-open);
    border-radius: var(--radius-sm);
}

/* Utilities needed for Admin Modal */
.flex {
    display: flex;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

#dashboard-main-text {
    white-space: pre-line;
}

.shrink-0 {
    flex-shrink: 0;
}

/* Header Layout */
.app-header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    width: 100%;
}

.header-col-left {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.header-col-right {
    flex-shrink: 0;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.header-col-center {
    flex-grow: 1;
    text-align: center;
    min-width: 0;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 640px) {
    .header-col-center {
        padding-top: 2rem;
        padding-bottom: 0;
    }
}

.logo-img-header {
    width: 104px;
    height: 104px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
    padding: 4px;
    border: 1px solid var(--border-slot-open);
    box-shadow: var(--shadow-sm);
}

/* Iconen onder het blok rechts (printen, hulp, mail, inloggen) */
.header-actions {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* Calendar Badge */
.calendar-badge {
    background: white;
    border: 1px solid var(--border-slot-open);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    box-sizing: border-box;
    box-shadow: var(--shadow-md);
}

.cal-day {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 0.9;
    color: var(--text-main);
    letter-spacing: -2px;
}

.cal-month {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-1);
    line-height: 1;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .logo-img-header {
        width: 72px;
        height: 72px;
    }

    .calendar-badge {
        width: 72px;
        height: 72px;
        padding: 0.35rem;
    }

    .cal-day {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    /* "ACTIVITEITEN" en een lange maandnaam passen zo in het vlak van 72px */
    .cal-month {
        font-size: 0.5rem;
        letter-spacing: 0;
        max-width: 100%;
    }

    /* Vier iconen zijn breder dan de rechterkolom: rechts uitlijnen, anders vallen ze buiten beeld */
    .header-actions {
        left: auto;
        right: 0;
        transform: none;
    }
}

.grow {
    flex-grow: 1;
}

.grid {
    display: grid !important;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Semantic form helpers */
.form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.panel-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.justify-end {
    justify-content: flex-end;
}

.cursor-pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-md {
    max-width: 28rem;
}

/* Tailwind-like Utilities for Admin Layout */
.bg-gray-50 {
    background-color: #f9fafb;
}

.text-gray-900 {
    color: #111827;
}

.font-sans {
    font-family: 'Outfit', sans-serif;
}

.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.font-bold {
    font-weight: 700;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.w-24 {
    width: 6rem;
}

.h-10 {
    height: 2.5rem;
}

.p-1 {
    padding: 0.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-red-600 {
    color: #dc2626;
}

.text-indigo-600 {
    color: #4f46e5;
}

.text-emerald-500 {
    color: #10b981;
}

.text-amber-500 {
    color: #f59e0b;
}

.hover\:text-red-700:hover {
    color: #b91c1c;
}

.hover\:bg-red-50:hover {
    background-color: #fef2f2;
}

/* Admin Input Definition */
.admin-input {
    background-color: white;
    border: 1px solid var(--border-slot-open);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Updated Admin Card */
.admin-card {
    background: white !important;
    border: 1px solid var(--border-slot-open) !important;
    box-shadow: var(--shadow-md) !important;
    color: var(--text-main);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    height: 100%;
}

/* Gradients for Text - existing */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

.text-transparent {
    color: transparent;
}

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-indigo-600 {
    --tw-gradient-from: #4f46e5;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(79, 70, 229, 0));
}

.to-purple-600 {
    --tw-gradient-to: #9333ea;
}

/* Final Layout Overrides */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

@media (min-width: 1000px) {
    .md-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .md-grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .gap-8 {
        gap: 2rem !important;
    }
}

.w-10 {
    width: 2.5rem;
}

.h-10 {
    height: 2.5rem;
}

/* Utilities for Custom Color Picker Wrapper */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.opacity-0 {
    opacity: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.rounded-md {
    border-radius: 6px;
}

.overflow-hidden {
    overflow: hidden;
}

.border-gray-300 {
    border-color: #cbd5e1;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon-only:hover {
    color: var(--on-primary, #fff);   /* was de hoofdkleur op de hoofdkleur: onzichtbaar */
    background-color: var(--bg-primary);
}

/* User Requested Adjustments */
#main-title {
    font-size: 3rem !important;
}

.logo-title {
    font-size: 3rem !important;
}

/* Remove underlines just in case */
.btn-secondary,
a.btn-secondary {
    text-decoration: none !important;
}

@media (max-width: 640px) {

    #main-title,
    .logo-title {
        font-size: 2rem !important;
    }
}

.max-w-sm {
    max-width: 24rem;
}

.justify-center {
    justify-content: center;
}

/* Fix font size consistency */
button.btn-secondary,
a.btn-secondary {
    font-family: inherit;
    line-height: 1.4;
}

#main-subtitle {
    white-space: nowrap !important;
    max-width: 100%;
}

/* De kalendertitel loopt terug, gebalanceerd over twee regels; met nowrap schoof hij op een
   telefoon onder het datum- of aantalblok rechts (29-10-2026). */
#main-title,
.logo-title {
    max-width: 100%;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

/* Dynamic scaling to prevent cutoff */
#main-title,
.logo-title {
    font-size: clamp(1.2rem, 5vw, 3rem) !important;
}

#main-subtitle {
    font-size: clamp(0.75rem, 3vw, 1.5rem) !important;
}

/* Prevent iOS text zoom on focus */
@media screen and (max-width: 768px) {

    input,
    select,
    textarea,
    .admin-input {
        font-size: 16px !important;
    }
}

/* Ensure flex-between is defined and allows wrapping */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nowrap {
    white-space: nowrap;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =========================================
   Landing Page Event Cards
   ========================================= */

.landing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-cards-public);
}

@media (max-width: 540px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }
}

.landing-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--border-slot-open);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    text-decoration: none !important;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}

@media (hover: hover) {
    .landing-event-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
        border-color: var(--primary);
    }
}

.landing-event-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.landing-event-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.landing-event-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.landing-event-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--accent-1);
    font-weight: 600;
    margin-top: 0.25rem;
}

.landing-event-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

@media (hover: hover) {
    .landing-event-card:hover .landing-event-arrow {
        color: var(--primary);
        transform: translateX(3px);
    }
}

/* ── Tags ──────────────────────────────────────────────────────────────── */

/* Badge op publieke pagina en in admin-preview */
.tag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;   /* app.js zet de contrastkleur bij de tagkleur */
    white-space: nowrap;
    line-height: 1.5;
    vertical-align: middle;
    border: 1px solid transparent;
}

/* Balk met meerdere tag-badges naast de activiteitstitel */
.subject-tag-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
    align-items: center;
}

/* Markdown rendered links - nooit halverwege een woord afbreken;
   als de URL niet op één regel past, korten we af met … */
.md-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, white);
    border-radius: 99px;
    padding: 0.1em 0.6em;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.md-link:hover {
    background: color-mix(in srgb, var(--primary) 18%, white);
}

/* =========================================================================
   Afdrukken - vrijwilligerskalender (event.php)
   Toont per activiteit de tijdsloten met de ingeschreven vrijwilligers.
   Doel: een leesbare rooster-afdruk zonder interactieve elementen.
   - Activiteiten worden nooit over een paginagrens gesplitst.
   - Meerdere activiteiten mogen samen op één pagina, ook naast elkaar,
     volgens dezelfde breedte-regels als op het scherm (>=640px).
   ========================================================================= */
@media print {
    /* Achtergrondkleuren/borders meenemen zodat de kaarten herkenbaar blijven */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: #fff !important;
    }

    .container {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Navigatie / interactieve chrome weglaten */
    .back-to-overview,
    .header-actions,
    .app-footer,
    #progress-dashboard,
    #tag-filter-bar,
    .subject-url-btn,
    .modal-overlay {
        display: none !important;
    }

    /* Aanmeld-/status-elementen weglaten: geen inschrijfknoppen, reservelijsten,
       "plaatsen vrij"-chips, doelbereikt-chips, verwijderknoppen of ingetrokken-lijst */
    .spot-item.open,
    .slot-count,
    .slot-target-met,
    .btn-delete-registration,
    .cancelled-container,
    .spot-wrapper:has(.spot-item.reserve) {
        display: none !important;
    }

    /* Ingeschreven vrijwilligers zonder klik-affordance tonen */
    .spot-item.filled {
        cursor: default !important;
        box-shadow: none !important;
    }
    .spot-item.filled .registration-content {
        padding-right: 0 !important;
    }

    /* Geen schaduwen/animaties op papier */
    .subject-card,
    .slot-card {
        box-shadow: none !important;
        transition: none !important;
    }

    /* Side-by-side layout via inline-block i.p.v. flex.
       Reden: browsers negeren `break-inside: avoid` op FLEX-items bij het printen
       (bekend Chromium/WebKit-gedrag), waardoor activiteiten alsnog over een
       paginagrens werden gesplitst. Op inline-block wordt het wel gerespecteerd.
       De kaarten worden via appendChild toegevoegd (geen witruimte-tekstnodes
       ertussen), dus ze sluiten zonder inline-block-gaten aan. */
    #subjects-container {
        display: block;
    }
    .subject-card {
        display: inline-block;
        vertical-align: top;
        box-sizing: border-box;
        margin: 0 1% 1rem 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    /* Breedtes als percentages (geen calc/rem-mix) zodat een rij altijd past en
       nooit voortijdig wrapt; ~1% marge dient als tussenruimte.
       1 slot  -> ~1/3 breed (max 3 naast elkaar)
       2 sloten -> ~2/3 breed
       3+ sloten -> volledige breedte */
    .subject-card--col-1 { width: 32%; }
    .subject-card--col-2 { width: 65.5%; }
    .subject-card--col-3 { width: 100%; margin-right: 0; }

    /* Sloten binnen een brede kaart naast elkaar, net als op het scherm.
       3 kolommen (i.p.v. 2) houdt lange activiteiten lager, zodat ze vaker
       binnen één pagina passen. */
    .subject-card--col-3 .slot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .subject-card--col-2 .slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
