/* --- 1. VARIABELEN & THEMA --- */
/* Palette 1: Modern Purple - Light Mode */
:root {
    /* Primary Colors */
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --secondary: #A78BFA;
    --accent: #F97316;

    /* Status Colors */
    --success: #047857;
    --danger: #DC2626;
    --warning: #B45309;
    --info: #0369A1;
    --pending: #7C3AED;

    /* Background & Text */
    --radius: 12px;
    --bg: #FAF5FF;
    --bg-alt: rgba(124, 58, 237, 0.05);
    --card-bg: #FFFFFF;
    --text: #4C1D95;
    --text-muted: #6D28D9;
    --border: #E9D5FF;
    --nav-bg: #FFFFFF;
    --input-bg: #FFFFFF;
    --input-text: #4C1D95;

    /* Shadows */
    --shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.1);
    --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.08);
    --shadow-lg: 0 20px 40px rgba(124, 58, 237, 0.15);

    /* Utility */
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --primary-light: rgba(124, 58, 237, 0.1);
}

/* Palette 1: Modern Purple - Dark Mode */
[data-theme="dark"] {
    /* Primary Colors */
    --primary: #A78BFA;
    --primary-dark: #7C3AED;
    --secondary: #7C3AED;
    --accent: #FB923C;

    /* Status Colors */
    --success: #10B981;
    --danger: #F87171;
    --warning: #FBBF24;
    --info: #38BDF8;
    --pending: #C4B5FD;

    /* Background & Text */
    --bg: #1E1B4B;
    --bg-alt: rgba(167, 139, 250, 0.08);
    --card-bg: #27224D;
    --text: #F3F4F6;
    --text-muted: #A78BFA;
    --border: #6D28D9;
    --nav-bg: #27224D;
    --input-bg: #1E1B4B;
    --input-text: #F3F4F6;

    /* Shadows */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* --- 2. BASIS & UTILITIES --- */
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html { overflow-y: scroll; } /* Voorkomt verspringen header */
body { 
    font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text); 
    margin: 0; line-height: 1.5; transition: background-color 0.3s; overflow-x: hidden;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Utility Spacing */
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }

/* Utility Text Styles */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-pending { color: var(--pending); }
.label-upper { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 4px; }

/* Utility Layout */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap-gap { flex-wrap: wrap; gap: 15px; }
.d-inline { display: inline; }
.d-flex { display: flex; }
.overflow-x-auto { overflow-x: auto; }
.hidden { display: none; }
.section-sep {
    border-top: 2px solid var(--border);
    padding-top: 20px;
    margin-top: 25px;
    transition: border-color var(--transition);
}

.section-sep:hover {
    border-top-color: var(--primary);
}

/* Grid Utilities */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.form-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* Page Header Pattern */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.page-header h1, .page-header h2 { margin: 0; }

/* Alert/Flash Messages */
.alert-flash { border-radius: 8px; padding: 12px 20px; font-weight: 600; margin-bottom: 20px; border: 1px solid; }
.alert-flash.success { background: rgba(4, 120, 87, 0.12); color: #065f46; border-color: #047857; }
.alert-flash.danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); border-color: var(--danger); }
.alert-flash.info { background: rgba(124, 58, 237, 0.1); color: var(--primary); border-color: var(--primary); }
.alert-flash.warning { background: rgba(180, 83, 9, 0.1); color: var(--warning); border-color: var(--warning); }

/* Stat Cards */
.stat-card { background: var(--card-bg); padding: 20px; border-left: 5px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card-number { font-size: 1.8rem; font-weight: 900; color: var(--text); }
.stat-card-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }

/* Data Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 14px; background: var(--bg-alt); text-align: left; font-weight: 600; color: var(--text); border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr { border-top: none; }
.data-table tbody tr:hover { background: rgba(124, 58, 237, 0.04); transition: background 0.2s; }
.data-table .text-center { text-align: center; }
.data-table .text-right { text-align: right; }

/* Status Badges for Hours Table */
.badge-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-status.status-ingediend {
    background: rgba(59, 130, 246, 0.12);
    color: #0c4a6e;
    border: 1px solid #0ea5e9;
}

.badge-status.status-goedgekeurd {
    background: rgba(4, 120, 87, 0.12);
    color: #065f46;
    border: 1px solid #047857;
}

.badge-status.status-afgekeurd {
    background: rgba(220, 38, 38, 0.12);
    color: #7f1d1d;
    border: 1px solid #dc2626;
}

.badge-status.status-datum {
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Dark mode badge enhancements */
[data-theme="dark"] .badge-status.status-ingediend {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    border: 1px solid #3b82f6;
}

[data-theme="dark"] .badge-status.status-goedgekeurd {
    background: rgba(4, 120, 87, 0.2);
    color: #a7f3d0;
    border: 1px solid #047857;
}

[data-theme="dark"] .badge-status.status-afgekeurd {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid #dc2626;
}

[data-theme="dark"] .badge-status.status-betaald {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid #a855f7;
}

[data-theme="dark"] .badge-status.status-uitbetaald {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid #22c55e;
}

/* Enhanced status pills (for BEVESTIGD, etc) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid;
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
}

.status-pill.bevestigd {
    color: #047857;
    border-color: #047857;
    background: rgba(4, 120, 87, 0.1);
}

.status-pill.aangevraagd {
    color: #3b82f6;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.status-pill.afgewezen {
    color: #dc2626;
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.status-pill.pending {
    color: #8b5cf6;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

/* Action buttons for hours table */
.btn-approve-hours {
    background: rgba(4, 120, 87, 0.1);
    color: #047857;
    border: 1px solid #047857;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-approve-hours:hover {
    background: rgba(4, 120, 87, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.2);
}

.btn-reject-hours {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-reject-hours:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* Grid Layouts */
.detail-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; }
.profile-grid { display: grid; grid-template-columns: 350px 1fr; gap: 25px; }
.admin-grid { display: grid; grid-template-columns: 1fr 350px; gap: 20px; }
.planning-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.filter-form { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; }
.action-col { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* Accent Cards */
.accent-card { background: var(--bg-alt); border-left: 4px solid var(--primary); border-radius: 8px; padding: 15px; }
.accent-card.accent-warning { border-left-color: var(--warning); }
.accent-card.accent-danger { border-left-color: var(--danger); }
.accent-card.accent-success { border-left-color: var(--success); }

/* Form Grids */
.role-time-grid { display: grid; grid-template-columns: 1fr 100px 100px 100px; gap: 8px; align-items: center; }

/* Icon Buttons */
.icon-btn { background: none; border: none; cursor: pointer; padding: 8px; color: var(--text); font-size: 1rem; transition: all 0.2s; }
.icon-btn:hover { color: var(--primary); }
.icon-btn.text-danger { color: var(--danger); }
.icon-btn.text-danger:hover { color: #991b1b; }

/* Matrix Table */
.matrix-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.matrix-table th { padding: 12px; text-align: center; border-left: 1px solid var(--border); min-width: 60px; }
.matrix-table th.sticky { position: sticky; left: 0; background: var(--bg-alt); z-index: 10; min-width: 120px; text-align: left; }
.matrix-table td { padding: 8px; text-align: center; border-left: 1px solid var(--border); }
.matrix-table td.sticky { position: sticky; left: 0; background: var(--card-bg); z-index: 9; text-align: left; font-weight: 600; }

/* Swap Request Cards */
.swap-card { padding: 12px; border: 1px solid var(--border); border-radius: 6px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }

/* Announcement Cards */
.announcement-card { padding: 20px; background: var(--card-bg); border-left: 6px solid; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 15px; }

/* License Banners */
.license-banner { border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; border: 1px solid; }
.license-banner.success { background: #f0fdf4; border-color: #047857; color: #065f46; }
.license-banner.warning { background: #fefce8; border-color: #B45309; color: #78350f; }
.license-banner.danger { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

/* Priority Task Styles (from admin.php) */
.prio-hoog { background: rgba(220, 38, 38, 0.1); color: var(--danger); border: 1px solid var(--danger); padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.prio-medium { background: rgba(180, 83, 9, 0.1); color: var(--warning); border: 1px solid var(--warning); padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.prio-laag { background: rgba(4, 120, 87, 0.1); color: var(--success); border: 1px solid var(--success); padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }

[data-theme="dark"] .prio-hoog { background: #450a0a; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .prio-medium { background: #451a03; color: #FBBF24; border-color: #78350f; }
[data-theme="dark"] .prio-laag { background: #064e3b; color: #a7f3d0; border-color: #065f46; }

/* Task Row Status Indicators */
.row-open { border-left: 4px solid #dc2626; }
.row-bezig { border-left: 4px solid #f97316; }
.row-afgerond { border-left: 4px solid #047857; opacity: 0.6; }

/* Status Dots */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.status-dot-open { background: #dc2626; }
.status-dot-bezig { background: #f97316; }
.status-dot-afgerond { background: #047857; }

/* Preference Assignment Button */
.btn-pref-assign { background: var(--primary); color: white; border: none; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.btn-pref-assign:hover { background: var(--primary-dark); }
.btn-pref-assign.assigned { background: var(--success); opacity: 0.7; cursor: default; }

/* Profile Avatar */
.profile-avatar-large { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 3px solid var(--primary); }

/* Calculation Box */
.calc-box { background: var(--bg-alt); padding: 10px; border-radius: 8px; border-left: 4px solid var(--primary); margin-top: 8px; font-size: 0.85rem; }

/* Travel Options */
.reis-optie { display: none; }
.reis-optie.active { display: block; }

/* News Item Styling */
.news-item { border-bottom: 1px solid var(--border); padding: 10px 0; }
.news-item:last-child { border: none; }

/* Edit Trigger */
.edit-trigger { cursor: pointer; transition: 0.2s; padding: 5px; border-radius: 4px; }
.edit-trigger:hover { background: var(--bg-alt); transform: scale(1.1); }

/* --- 3. NAVIGATIE --- */
.nav-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px; background-color: var(--nav-bg);
    border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0;
    margin-bottom: 0; box-shadow: var(--shadow); position: relative;
    min-height: 65px;
}

#nav-mobile-check { display: none; }
.nav-mobile-btn { display: none; cursor: pointer; padding: 10px; z-index: 100; }
.nav-mobile-btn span, .nav-mobile-btn span::before, .nav-mobile-btn span::after {
    display: block; width: 22px; height: 2px; background: var(--text); position: relative; transition: 0.3s;
}
.nav-mobile-btn span::before { content: ''; position: absolute; top: -7px; }
.nav-mobile-btn span::after { content: ''; position: absolute; bottom: -7px; }

.nav-left, .nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-left { flex-shrink: 1; min-width: 0; }
.nav-item {
    text-decoration: none; color: var(--text-muted); font-weight: 600;
    font-size: 0.82rem; padding: 6px 10px; border-radius: 6px; white-space: nowrap;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active { background-color: var(--bg); color: var(--primary); }

/* Dropdown Menu */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { background: none; border: none; cursor: pointer; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: var(--shadow);
    min-width: 160px; z-index: 1000;
}
.nav-dropdown:hover .nav-dropdown-menu { display: flex; flex-direction: column; }
.nav-dropdown-item {
    padding: 8px 12px; color: var(--text-muted); text-decoration: none;
    font-size: 0.8rem; white-space: nowrap;
    transition: all 0.2s;
}
.nav-dropdown-item:hover { background-color: var(--bg); color: var(--primary); }
.nav-dropdown-divider { height: 1px; background-color: var(--border); margin: 4px 0; }

.nav-divider { width: 1px; height: 20px; background-color: var(--border); margin: 0 2px; flex-shrink: 0; }

/* Username: clickable link, always one line, truncate long names with ellipsis */
.nav-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    flex-shrink: 1;
    text-decoration: none;
    transition: color var(--transition);
}

.nav-user-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Mobile profile icon link */
.show-mobile {
    display: none;
}

.theme-toggle-btn {
    background: var(--border); border: none; border-radius: 10px; 
    width: 32px; height: 32px; display: flex; align-items: center; 
    justify-content: center; cursor: pointer; color: var(--text);
}
.btn-logout { background-color: var(--danger); color: white !important; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; text-decoration: none; }

/* --- NOTIFICATIE BEL FIX --- */
.nav-item-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* De badge zelf */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--nav-bg); /* Zorgt dat hij mooi afsteekt tegen de knop */
    pointer-events: none; /* Klikken gaat door naar de bel-knop */
    
    /* Cruciaal: als er geen getal is, blijft de badge onzichtbaar 
       maar de 'ruimte' in de DOM verandert niet meer */
    transition: transform 0.2s ease;
}

/* Als de badge leeg is, verberg hem dan netjes zonder de layout te breken */
.notification-badge:empty {
    display: none;
}


/* --- 4. GRID & SECTIES --- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; margin-bottom: 50px; }
.section-title {
    display: flex; align-items: center; gap: 15px; margin: 40px 0 20px;
    padding-bottom: 10px; border-bottom: 2px solid var(--border); color: var(--text);
}
.section-title span.count-badge { background: var(--primary); color: white; padding: 2px 12px; border-radius: 20px; font-size: 0.9rem; font-weight: 700; }

/* --- 5. CARDS & EVENTS --- */
.card { background-color: var(--card-bg); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; box-shadow: var(--shadow); }
.event-card-custom {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.event-card-custom:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

/* Categorie Kleuren */
.cat-oefening { border-top: 5px solid #3b82f6 !important; }
.cat-evenement { border-top: 5px solid #10b981 !important; }
.cat-cursus { border-top: 5px solid #B45309 !important; }
.cat-overig { border-top: 5px solid #6b7280 !important; }

/* --- 6. FORMULIEREN & SELECTS --- */
input, select, textarea, .form-control, .form-control-custom {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; background-color: var(--input-bg); color: var(--input-text);
    font-size: 0.95rem; font-family: inherit; outline: none; transition: all 0.2s ease; box-sizing: border-box; display: block;
}

/* Specifieke Select Fix voor uitlijning en pijl */
select.form-control, select.form-control-custom {
    height: 42px;
    appearance: none;
    cursor: pointer;
    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 24 24' fill='none' stroke='%237C3AED' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.8rem !important;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    background-color: var(--input-bg);
}

textarea:focus { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

select:hover:not(:disabled) {
    border-color: var(--primary);
}

[data-theme="dark"] select, [data-theme="dark"] select option { background-color: var(--card-bg) !important; color: var(--text) !important; }

[data-theme="dark"] select.form-control,
[data-theme="dark"] select.form-control-custom {
    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 24 24' fill='none' stroke='%23A78BFA' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
}

.label-small { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.8rem; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; }

/* --- 7. BUTTONS & ACTIONS --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 20px; border-radius: 10px; font-weight: 600;
    font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; border: none; text-decoration: none;
}
.btn-primary { background-color: var(--primary); color: white !important; box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15); }
.btn-secondary { background-color: var(--bg-alt); color: var(--text) !important; border: 1px solid var(--border); }
.btn-danger { background-color: var(--danger); color: white !important; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-primary:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-secondary:focus { outline: 2px solid var(--text-muted); outline-offset: 2px; }

/* Responsive button width */
@media (max-width: 640px) {
    .btn { padding: 12px 16px; font-size: 0.9rem; width: auto; }
    .btn-sm { padding: 9px 12px; }
}

/* Moderne vierkante knoppen (Admin) */
.btn-square, .btn-delete-adaptive {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s ease; font-size: 1.1rem; text-decoration: none;
}
.btn-square { background: var(--bg-alt); color: var(--text); }
.btn-square:hover { background: var(--primary); color: white !important; transform: translateY(-2px); }

.btn-delete-adaptive { background: rgba(220, 38, 38, 0.1); color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }
.btn-delete-adaptive:hover { background: #dc2626; color: white !important; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); transform: translateY(-2px); }

/* --- 8. PERSONEEL & CATEGORIE PILLS --- */
.cat-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
    position: relative; display: inline-flex; align-items: center; padding: 6px 14px;
    border-radius: 50px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
    border: 2px solid var(--border); background: var(--bg-alt); color: var(--text-muted);
    transition: all 0.2s ease;
}
.cat-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.cat-pill::before { content: '○'; margin-right: 8px; }
.cat-pill:has(input:checked)::before { content: '✓'; }

.pill-irgames:has(input:checked) { background-color: rgba(124, 58, 237, 0.15); border-color: #7C3AED; color: #7C3AED; }
.pill-impact:has(input:checked) { background-color: rgba(220, 38, 38, 0.15); border-color: #dc2626; color: #dc2626; }
.pill-living:has(input:checked) { background-color: rgba(4, 120, 87, 0.15); border-color: #047857; color: #047857; }

/* --- 9. PROGRESS BAR --- */
.progress-container { margin-top: auto; padding-top: 15px; }
.progress-bar-bg { width: 100%; background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }

/* --- 10. LOGIN SPECIFIEK --- */
.login-body {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px; background-color: var(--bg);
}
.login-wrapper { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; animation: fadeIn 0.5s ease-out; }
.login-header { display: flex; justify-content: space-between; align-items: center; padding: 0 5px; }
.login-footer { margin-top: 20px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

.btn-primary.w-100 { 
    background-color: var(--primary) !important; padding: 14px; border-radius: 12px; font-weight: 700; 
}
.btn-primary.w-100:hover { background-color: var(--primary-dark) !important; }

/* --- 11. TABELLEN & RESPONSIVENESS --- */
.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background-color: var(--bg-alt); text-transform: uppercase; font-size: 0.75rem; padding: 12px; color: var(--text-muted); border-bottom: 2px solid var(--border); text-align: left; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }

@media (max-width: 1024px) {
    .nav-mobile-btn { display: block; }
    .hide-mobile { display: none !important; }
    .show-mobile { display: flex !important; }
    .nav-left {
        display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
        width: 100%; background: var(--nav-bg); border: 1px solid var(--border);
        border-radius: 0 0 var(--radius) var(--radius); padding: 15px; z-index: 999;
        box-shadow: var(--shadow); align-items: stretch; gap: 5px;
    }
    #nav-mobile-check:checked ~ .nav-left { display: flex; }
    
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr { display: block; }
    .table-responsive thead tr { position: absolute; top: -9999px; left: -9999px; }
    .table-responsive tr { border: 1px solid var(--border); margin-bottom: 15px; border-radius: 8px; background: var(--card-bg); overflow: hidden; }
    .table-responsive td { border: none; border-bottom: 1px solid var(--bg-alt); position: relative; padding-left: 45% !important; text-align: right; font-size: 0.9rem; }
    .table-responsive td:before { content: attr(data-label); position: absolute; left: 12px; width: 40%; text-align: left; font-weight: 700; color: var(--text-muted); }
}

/* --- 14. BLUEPRINT INFORMATIE STYLING (Aangepast voor betere tekstweergave) --- */
.blueprint-content {
    background-color: var(--bg-alt);
    padding: 20px;
    border-radius: var(--radius);
    line-height: 1.6;
    color: var(--text);
    font-size: 1rem;
    border-left: 4px solid var(--primary);
}

.blueprint-content h1, .blueprint-content h2, .blueprint-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.blueprint-content p {
    margin-bottom: 1rem;
    white-space: pre-line; /* Behoudt line breaks uit de database */
}

.blueprint-content ul, .blueprint-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.blueprint-content li {
    margin-bottom: 0.5rem;
}

.blueprint-files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.blueprint-file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blueprint-file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--primary);
}

/* --- 15. ADMIN BLUEPRINTS PAGE --- */
.cat-badge-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px; border-radius: 20px;
    color: #fff; font-size: 0.8rem; cursor: pointer; transition: transform 0.2s;
}
.cat-badge-item:hover { transform: scale(1.05); }

.btn-delete-small {
    background: rgba(0,0,0,0.2); border-radius: 50%;
    width: 18px; height: 18px; display: flex; align-items: center;
    justify-content: center; text-decoration: none; color: #fff; font-size: 0.6rem;
}
.btn-delete-small:hover { background: rgba(0,0,0,0.5); }

.role-entry { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 8px; }

.file-edit-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-alt); padding: 5px 10px; border-radius: 4px;
    margin-bottom: 5px; font-size: 0.85rem; border: 1px solid var(--border);
}

/* Blueprint card grid */
.bp-grid {
    columns: 3 280px;
    column-gap: 14px;
}

.bp-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}
.bp-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

.bp-card-bar { height: 5px; background: var(--bp-color, var(--primary)); }

.bp-card-body {
    padding: 14px; flex: 1;
    display: flex; flex-direction: column; gap: 8px;
}

.bp-card-cat {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--bp-color, var(--primary));
}

.bp-card-name { margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--text); line-height: 1.3; }

.bp-card-dur {
    display: inline-block; font-size: 0.72rem; color: var(--text-muted);
    background: var(--bg-alt); padding: 2px 8px; border-radius: 10px; width: fit-content;
}

.bp-card-briefing {
    margin: 0; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.bp-section-label {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 3px;
}

.bp-role-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: var(--text); padding: 1px 0;
}

.bp-role-badge {
    font-size: 0.7rem; font-weight: 700;
    color: var(--bp-color, var(--primary));
    background: var(--bg-alt); padding: 0 6px; border-radius: 8px;
}

.bp-card-footer {
    display: flex; gap: 6px; padding: 10px 14px;
    border-top: 1px solid var(--border); background: var(--bg-alt);
}
.bp-card-footer .btn { flex: 1; padding: 6px 8px; font-size: 0.78rem; justify-content: center; }

/* Admin section dividers */
.admin-section-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin: 30px 0 14px; padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}

.blueprint-file-icon {
    font-size: 1.5rem;
}


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

/* --- 1. ADMIN SPECIFIEK --- */
.admin-main { padding-top: 20px; padding-bottom: 50px; }

.admin-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 25px; gap: 20px; flex-wrap: wrap;
}

.admin-title h1 { margin: 0; font-size: 1.8rem; }
.admin-actions { display: flex; gap: 10px; align-items: center; }
.jump-date { width: 150px !important; margin: 0 !important; height: 42px; }

/* Legenda & Stats */
.admin-stats-card { border-left: 5px solid var(--primary); }
.legend-grid { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.pill-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.status-pill-static {
    background: var(--bg-alt); padding: 5px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.status-pill-static .dot { width: 8px; height: 8px; border-radius: 50%; }

.stats-section { display: flex; gap: 25px; border-left: 1px solid var(--border); padding-left: 25px; }
.stat-item { text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-value.orange { color: #e67e22; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

/* Takenlijst */
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.task-header h2 { margin: 0; font-size: 1.3rem; }
.quick-form-box { background: var(--bg-alt); padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
.col-span-2 { grid-column: span 2; }
.form-actions { margin-top: 15px; display: flex; gap: 10px; padding-top: 15px; border-top: 1px solid var(--border); }

/* Tabel styling */
.task-table strong { font-size: 0.95rem; color: var(--text); }
.event-tag { display: inline-block; background: rgba(124, 58, 237, 0.1); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-weight: 700; margin-top: 4px; font-size: 0.75rem; }
.badge-open { font-size: 0.75rem; background: var(--bg-alt); border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px; font-weight: bold; }
.row-done { opacity: 0.5; }
.edit-icon { cursor: pointer; margin-left: 8px; opacity: 0.4; transition: 0.2s; }
.task-row:hover .edit-icon { opacity: 1; }
.status-select { width: auto !important; height: 32px !important; padding: 2px 30px 2px 8px !important; font-size: 0.8rem !important; margin: 0 !important; }
.btn-delete-icon { font-size: 1.2rem; text-decoration: none; opacity: 0.6; transition: 0.2s; }
.btn-delete-icon:hover { opacity: 1; transform: scale(1.2); }

/* Badges */
.prio-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; border: 1px solid transparent; }
.prio-hoog { background: #fee2e2; color: #991b1b; border-color: #f87171; }
.prio-medium { background: #fefce8; color: #78350f; border-color: #fbbf24; }
.prio-laag { background: #f0fdf4; color: #166534; border-color: #4ade80; }

.blink { animation: blinker 1.5s linear infinite; }
@keyframes blinker { 50% { opacity: 0.3; } }

@media (max-width: 768px) {
    .legend-grid { grid-template-columns: 1fr; }
    .stats-section { border: none; padding: 0; justify-content: space-around; }
    .col-span-2 { grid-column: span 1; }
}

/* --- 4. EMPTY STATES --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 12px 0;
}

.empty-state-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 8px 0 24px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-action {
    margin-top: 20px;
}

/* --- 5. LOADING SPINNER --- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--bg-alt);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- 6. BUTTON STYLING FIXES --- */
.btn-secondary {
    background-color: var(--bg-alt);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

[data-theme="dark"] .btn-secondary {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

/* --- 7. FORM HELP TEXT --- */
.form-help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.form-error-text {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: 4px;
    display: block;
}

/* --- 8. SECTION DIVIDERS --- */
.section-divider {
    margin: 30px 0;
    padding: 30px 0;
    border-top: 2px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.section-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.section-header::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* --- 9. ALERTS --- */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    font-weight: 500; display: flex; align-items: center; gap: 10px;
    border-left: 4px solid transparent;
}
.alert.success { background: rgba(4, 120, 87, 0.12); color: #065f46; border-left-color: var(--success); }
.alert.danger { background: rgba(220, 38, 38, 0.15); color: var(--danger); border-left-color: var(--danger); }
.alert.warning { background: rgba(180, 83, 9, 0.15); color: var(--warning); border-left-color: var(--warning); }
.alert.info { background: rgba(124, 58, 237, 0.15); color: var(--primary); border-left-color: var(--primary); }

/* --- MOBILE ENHANCEMENTS --- */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .nav-container { min-height: 50px; padding: 6px 10px; margin-bottom: 12px; gap: 8px; }
    .nav-item { font-size: 0.75rem; padding: 6px 8px; }
    .nav-left { padding: 10px; gap: 3px; }
    .section-title { margin: 24px 0 12px; gap: 8px; font-size: 0.95rem; }
    .section-title h2 { font-size: 1rem; }
    .card { padding: 12px; margin-bottom: 12px; }
    .btn { width: 100%; padding: 12px 14px; font-size: 0.9rem; }
    .btn-sm { padding: 9px 10px; font-size: 0.8rem; }
    input, select, textarea, .form-control, .form-control-custom { font-size: 16px; padding: 10px 12px; }
    .empty-state { padding: 30px 16px; }
    .empty-state-icon { font-size: 2.5rem; }
    .empty-state-title { font-size: 1.1rem; }
    .profile-grid { grid-template-columns: 1fr !important; }
    .profile-avatar-large { width: 100px; height: 100px; border-width: 2px; }

    /* Chat improvements */
    .chat-tabs { gap: 3px; flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 12px; }
    .tab-link { padding: 8px 12px; font-size: 0.8rem; border-radius: 8px 8px 0 0; }
    .close-dm-btn { padding: 0 6px; }
    .chat-layout-wrapper { height: auto; min-height: 400px; }
    #msg-input { padding: 10px 16px; font-size: 16px; }
}

/* --- ADMIN TASK TABLE MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .task-table {
        display: block !important;
        width: 100% !important;
    }

    .task-table thead {
        display: none !important;
    }

    .task-table tbody {
        display: block !important;
    }

    .task-table tr {
        display: block !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px !important;
        margin-bottom: 12px !important;
        padding: 0 !important;
        background: var(--card-bg) !important;
        overflow: visible;
    }

    .task-table td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px !important;
        border-bottom: 1px solid var(--bg-alt) !important;
        text-align: left !important;
    }

    .task-table td:last-child {
        border-bottom: none !important;
        justify-content: flex-end !important;
    }

    .task-table td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        margin-right: 8px !important;
        min-width: 50px !important;
        flex-shrink: 0;
    }

    .task-table td[data-label="Prio"]::before { content: "Prio"; }
    .task-table td[data-label="Taak"]::before { content: "Taak"; }
    .task-table td[data-label="Wie"]::before { content: "Wie"; }
    .task-table td[data-label="Status"]::before { content: "Status"; }
    .task-table td[data-label="Beheer"]::before { content: ""; }

    .task-table td[data-label="Beheer"] {
        justify-content: flex-end !important;
        gap: 8px !important;
    }

    .task-table form {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .status-select {
        width: auto !important;
        max-width: 120px !important;
        height: auto !important;
        padding: 6px 8px !important;
    }

    .prio-badge {
        margin-left: 0 !important;
    }

    .task-row.row-done {
        opacity: 0.5;
    }

    .quick-form-box {
        margin-bottom: 20px !important;
    }

    .quick-form-box form > div {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 768px) {
    /* Planning table to cards */
    .full-width {
        display: block !important;
        width: 100% !important;
    }

    .full-width tr {
        display: block !important;
        padding: 12px !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px !important;
        margin-bottom: 10px !important;
        background: var(--card-bg) !important;
    }

    .full-width td {
        display: block !important;
        padding: 6px 0 !important;
        text-align: left !important;
        border-bottom: none !important;
        margin-bottom: 6px !important;
    }

    .full-width td:last-child {
        margin-bottom: 0;
    }

    .full-width td:first-child {
        font-weight: 600 !important;
        color: var(--primary) !important;
        font-size: 0.95rem !important;
    }

    /* History section card layout */
    [style*="padding: 12px; border-bottom: 1px solid var(--border); transition:"] {
        display: block !important;
        padding: 12px !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px !important;
        margin-bottom: 10px !important;
        background: var(--card-bg) !important;
    }

    /* Uren boeken items */
    [style*="padding: 10px 0; border-bottom: 1px solid var(--border);"] {
        display: block !important;
        padding: 12px !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px !important;
        margin-bottom: 10px !important;
        background: var(--card-bg) !important;
    }

    [style*="padding: 10px 0; border-bottom: 1px solid var(--border);"] form {
        width: 100% !important;
    }

    [style*="padding: 10px 0; border-bottom: 1px solid var(--border);"] .btn {
        width: 100% !important;
    }

    /* Absence items */
    [style*="padding: 10px; background: var(--bg-alt); border-radius: 6px;"] {
        display: block !important;
    }

    [style*="padding: 10px; background: var(--bg-alt); border-radius: 6px;"] form {
        width: 100% !important;
        margin-top: 10px !important;
    }

    [style*="padding: 10px; background: var(--bg-alt); border-radius: 6px;"] .btn {
        width: 100% !important;
        margin-left: 0 !important;
    }
}


.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease;
    border-left: 4px solid;
}

/* --- NOTIFICATIONS PAGE --- */
.notif-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.notif-page-header h2 { margin: 0; font-size: 1.4rem; }
.notif-page-header .subtitle { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.notif-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.notif-list { display: flex; flex-direction: column; gap: 0; }

.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    position: relative;
}
.notif-card:last-child { border-bottom: none; }
.notif-card.is-unread {
    background: rgba(124,58,237,0.04);
    border-left: 3px solid var(--primary);
}
.notif-card.is-read {
    opacity: 0.6;
    border-left: 3px solid transparent;
}
.notif-card.is-clickable { cursor: pointer; }
.notif-card.is-clickable:hover { background: rgba(124,58,237,0.08) !important; opacity: 1 !important; }

.notif-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
}

[data-theme="dark"] .notif-icon {
    filter: brightness(1.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notif-body { flex: 1; min-width: 0; }
.notif-message {
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
    margin: 0 0 6px 0;
}
.notif-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.notif-meta .meta-sep { opacity: 0.35; }

.notif-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger, #e74c3c);
    margin-top: 6px;
}

.notif-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 20px;
}

.notif-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.notif-empty .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

@media (max-width: 768px) {
    .notif-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .notif-page-header > div:first-child {
        width: 100%;
    }

    .notif-actions {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .notif-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .notif-card {
        display: flex !important;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
        border: 1px solid var(--border) !important;
        border-left: 4px solid transparent !important;
        border-radius: 8px !important;
        background: var(--card-bg) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .notif-card.is-unread {
        border-left-color: var(--primary) !important;
        background: rgba(124, 58, 237, 0.04) !important;
    }

    .notif-card.is-read {
        opacity: 0.65;
    }

    .notif-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
        flex-shrink: 0;
        border-radius: 8px !important;
    }

    .notif-body {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .notif-message {
        font-size: 0.9rem !important;
        color: var(--text) !important;
        line-height: 1.4 !important;
        margin: 0 0 8px 0 !important;
    }

    .notif-meta {
        flex-wrap: wrap !important;
        gap: 8px !important;
        font-size: 0.75rem !important;
        color: var(--text-muted) !important;
    }

    .notif-list {
        padding: 8px;
    }

    .notif-empty {
        padding: 40px 20px !important;
        text-align: center !important;
    }

    .notif-empty .empty-icon {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .notif-card { padding: 12px !important; gap: 10px !important; }
    .notif-icon { width: 34px !important; height: 34px !important; font-size: 1rem !important; }
    .notif-page-header h2 { font-size: 1.2rem; }
    .notif-message { font-size: 0.85rem !important; }
    .profile-avatar-large { width: 80px; height: 80px; border-width: 2px; }
}

/* --- 16. AUDIT LOG TABLE --- */
.audit-log-wrapper { overflow-y: auto; max-height: 420px; }
.audit-log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.audit-log-table th {
    position: sticky; top: 0; z-index: 1;
    background: var(--card-bg); text-align: left;
    padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.audit-log-table th.audit-td-undo { text-align: right; }
.audit-log-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.audit-td-time { white-space: nowrap; color: var(--text-muted); }
.audit-td-who { font-weight: 600; }
.audit-td-detail { color: var(--text-muted); max-width: 300px; word-break: break-word; }
.audit-td-ip { font-family: monospace; font-size: 0.75rem; color: var(--text-muted); }
.audit-td-undo { text-align: right !important; white-space: nowrap; }
.audit-event-date {
    display: inline-block; margin-left: 6px;
    font-size: 0.72rem; font-weight: 600;
    color: var(--primary); background: rgba(124,58,237,0.1);
    padding: 1px 6px; border-radius: 10px; white-space: nowrap;
}

@media (max-width: 1024px) {
    .audit-log-wrapper { max-height: none; overflow-y: visible; }
    .audit-ip { display: none !important; }

    .audit-log-table,
    .audit-log-table thead,
    .audit-log-table tbody,
    .audit-log-table th,
    .audit-log-table td,
    .audit-log-table tr { display: block; }
    .audit-log-table thead tr { position: absolute; top: -9999px; left: -9999px; }
    .audit-log-table tr { border: 1px solid var(--border); margin-bottom: 12px; border-radius: 8px; background: var(--card-bg); overflow: hidden; }
    .audit-log-table td { border: none; border-bottom: 1px solid var(--bg-alt); position: relative; padding: 9px 12px 9px 46% !important; text-align: right; font-size: 0.85rem; }
    .audit-log-table td::before { content: attr(data-label); position: absolute; left: 12px; top: 9px; width: 42%; text-align: left; font-weight: 700; color: var(--text-muted); font-size: 0.75rem; }
    .audit-td-undo { padding: 8px 12px !important; text-align: center !important; }
    .audit-td-undo::before { display: none; }
    .audit-td-undo .btn { width: 100%; justify-content: center; }
}

/* ===== ANIMATIONS & TRANSITIONS ===== */

/* Global transitions */
button, .btn, input, select, textarea, a, .card, .btn-icon, .icon-btn {
    transition: var(--transition);
}

/* Button hover & active states */
.btn {
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.08);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    filter: brightness(0.95);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    filter: none;
}

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

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

.btn-danger:hover {
    background-color: #991b1b;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Card hover effect */
.card {
    transition: all var(--transition);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.card.shadow {
    box-shadow: var(--shadow-sm);
}

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

/* Input focus glow */
input, select, textarea {
    transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px var(--primary-light), inset 0 1px 0 rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
    outline: none;
    background-position: 100% center;
}

/* Input placeholder effect */
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    transition: color var(--transition);
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: var(--primary);
    opacity: 0.7;
}

/* Form group spacing */
.form-group {
    margin-bottom: 20px;
    animation: slideInUp 0.3s ease-out;
}

/* Link hover effects */
a:not(.btn):not(.nav-item) {
    transition: color var(--transition);
}

a:not(.btn):not(.nav-item):hover {
    color: var(--primary);
}

/* Icon button hover */
.icon-btn:hover {
    transform: scale(1.1);
    color: var(--primary);
}

.icon-btn.text-danger:hover {
    color: #991b1b;
}

/* Alert animations */
.alert-flash {
    animation: slideInDown 0.3s ease-out;
}

/* Navbar item active indicator */
.nav-item {
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: width var(--transition);
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item.active::before {
    width: 100%;
}

/* Notification badge bounce */
.notification-badge {
    animation: bounce 1s infinite;
}

/* Status dot animation */
.status-dot {
    animation: pulse 2s infinite;
}

/* Badge status with ripple effect */
.badge-status {
    transition: all var(--transition);
    border: 1px solid currentColor;
    opacity: 0.95;
}

.badge-status:hover {
    transform: scale(1.08) translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Edit trigger hover */
.edit-trigger:hover {
    background: var(--bg-alt);
    transform: scale(1.1);
}

/* Status badge pulse for unread */
.notif-card.is-unread .notif-dot {
    animation: pulse 2s infinite;
}

/* Badge status bounce */
.badge-status {
    transition: all var(--transition);
}

.badge-status:hover {
    transform: scale(1.05);
}

/* Accent card hover */
.accent-card {
    transition: all var(--transition);
}

.accent-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* Planning grid card hover */
.planning-grid > div:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Data table row hover */
.data-table tbody tr {
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.data-table tbody tr:hover {
    background: var(--bg-alt);
    border-left-color: var(--primary);
    transform: translateX(2px);
}

.data-table tbody tr:hover td {
    color: var(--primary);
}

/* Alternate row striping */
.data-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

/* Flex item smooth transitions */
.flex-center, .flex-between, .flex-col {
    transition: all var(--transition);
}

/* Form control smooth focus */
.form-control, .form-control-custom {
    transition: all var(--transition);
}

.form-control:focus, .form-control-custom:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
    border-color: var(--primary);
}

/* Smooth color transitions */
.text-danger, .text-success, .text-primary, .text-muted, .text-warning {
    transition: color var(--transition);
}

/* Announcement card fade */
.announcement-card {
    animation: fadeIn 0.4s ease-out;
}

/* ===== KEYFRAME ANIMATIONS ===== */

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(124, 58, 237, 0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== SCROLL BEHAVIOR ===== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    transition: background var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--primary) var(--bg-alt);
    scrollbar-width: thin;
}

/* ===== MICRO-INTERACTIONS ===== */

/* Link underline animation */
a:not(.btn):not(.nav-item) {
    position: relative;
    text-decoration: none;
}

a:not(.btn):not(.nav-item)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

a:not(.btn):not(.nav-item):hover::after {
    width: 100%;
}

/* Form input label animation */
label {
    transition: color var(--transition);
}

input:focus + label,
textarea:focus + label,
select:focus + label {
    color: var(--primary);
}

/* Badge status pulse on unread */
.badge-status {
    position: relative;
    overflow: hidden;
}

.badge-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.3);
    transition: left 0.3s ease;
}

.badge-status:hover::before {
    left: 100%;
}

/* Button ripple effect preparation */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Card hover lift effect */
.card {
    will-change: transform, box-shadow;
}

/* Smooth color transitions for status badges */
.badge-status.status-confirmed,
.badge-status.status-bevestigd {
    animation: glow 2s infinite;
}

/* Input field glow on focus (stronger) */
input:focus,
select:focus,
textarea:focus {
    animation: glow 1s infinite;
}

/* ===== ADVANCED EFFECTS ===== */

/* Loading skeleton shimmer */
.skeleton {
    background: var(--bg-alt);
    animation: pulse 2s ease-in-out infinite;
    opacity: 0.6;
}

/* Tooltip hover effect */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 119%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text);
    animation: slideInUp 0.3s ease-out;
}

/* Success checkmark animation */
.success-check {
    animation: scaleIn 0.5s ease-out;
}

/* ===== ACCESSIBILITY ===== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode enhanced */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--primary);
}

[data-theme="dark"] [data-tooltip]:hover::after {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] [data-tooltip]:hover::before {
    border-top-color: var(--card-bg);
}

/* Mobile Responsive Improvements */
@media (max-width: 992px) {
    .detail-grid, .profile-grid { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header h1, .page-header h2 { width: 100%; }

    /* Mobile form grids */
    .form-grid-2, .form-grid-3, .role-time-grid { grid-template-columns: 1fr; }

    /* Data table card stacking */
    .data-table thead { display: none; }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td { display: block; width: 100%; }
    .data-table tr { border: 1px solid var(--border); margin-bottom: 12px; border-radius: 8px; padding: 0; }
    .data-table td { border: none; border-bottom: 1px solid var(--bg-alt); padding: 12px !important; text-align: right; }
    .data-table td::before { content: attr(data-label); position: absolute; left: 12px; font-weight: 700; color: var(--text-muted); font-size: 0.75rem; text-align: left; }
    .data-table td:first-child { border-radius: 8px 8px 0 0; }
    .data-table td:last-child { border-radius: 0 0 8px 8px; border-bottom: none; }

    /* Matrix table mobile */
    .matrix-table { -webkit-overflow-scrolling: touch; }

    /* Buttons & inputs min touch size */
    button, .btn, input[type="submit"], input[type="button"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
        min-height: 44px;
    }

    /* Cards full width */
    .card { border-radius: 8px; }

    /* Planning grid mobile */
    .planning-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .btn { padding: 10px 16px; font-size: 0.85rem; }
    .page-header { font-size: 0.9rem; }
}

/* --- TABBLADEN IN HEADER (Beheer pagina's) --- */
#tabs-mobile-check { display: none; }

.tabs-header-wrapper {
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    position: relative;
    margin-bottom: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tabs-mobile-btn {
    display: none;
    cursor: pointer;
    padding: 12px 20px;
    font-size: 1.3rem;
    color: var(--text);
    background: none;
    border: none;
    width: 100%;
    text-align: center;
}

.tabs-nav {
    display: flex;
    gap: 0;
    background: transparent;
    justify-content: flex-start;
    padding: 0;
}

.tab-link {
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: 0;
    display: inline-block;
}

.tab-link:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 1024px) {
    .tabs-mobile-btn {
        display: block;
    }

    .tabs-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--nav-bg);
        border-top: 1px solid var(--border);
        z-index: 998;
    }

    #tabs-mobile-check:checked ~ .container .tabs-nav {
        display: flex;
    }

    .tab-link {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border);
        border-right: 3px solid transparent;
        margin: 0;
    }

    .tab-link.active {
        border-bottom: 1px solid var(--border);
        border-right-color: var(--primary);
        background: var(--bg-alt);
    }
}

/* ============================================================
   === CHAT STYLES (chat.css merged) ===
   ============================================================ */

.cat-ir-games { --cat-color: #2563eb; }
.cat-living-in-the-big-world { --cat-color: #047857; }
.cat-impact-sim { --cat-color: #dc2626; }
.cat-privé { --cat-color: #8b5cf6; }

.chat-main-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    --cat-color: #2563eb;
}
.chat-layout-wrapper {
    display: flex; gap: 20px; margin-top: 0; align-items: stretch;
    height: 70vh; min-height: 520px;
}
.chat-container {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); overflow: hidden;
}

.chat-tabs {
    display: flex; flex-wrap: nowrap; gap: 2px; padding: 10px 10px 0;
    background: var(--nav-bg); border: 1px solid var(--border);
    border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
    overflow-x: auto; scrollbar-width: none;
}
.chat-tabs::-webkit-scrollbar { display: none; }

.dm-tab-wrapper {
    display: flex; align-items: stretch;
    border-radius: 8px 8px 0 0; margin-right: 4px;
    border: 1px solid var(--border); border-bottom: none;
    background: var(--bg-alt); overflow: hidden;
}
.dm-tab-wrapper .tab-link {
    border-radius: 0; border: none; padding-right: 8px;
}
.dm-tab-wrapper.active { background: var(--card-bg); box-shadow: inset 0 3px 0 var(--cat-color); }

.tab-link {
    padding: 10px 15px; text-decoration: none; color: var(--text-muted);
    font-size: 0.85rem; font-weight: 700; white-space: nowrap; display: block;
    border-radius: 8px 8px 0 0; background: var(--bg-alt); transition: 0.2s;
}
.tab-link.active {
    background: var(--card-bg); color: var(--cat-color) !important;
    box-shadow: inset 0 3px 0 var(--cat-color);
}
.chat-tabs > a.tab-link.active { color: white !important; }

.close-dm-btn {
    display: flex; align-items: center; justify-content: center;
    width: 26px; flex-shrink: 0;
    border-left: 1px solid var(--border);
    color: var(--text-muted); font-size: 13px;
    text-decoration: none; transition: background 0.2s, color 0.2s;
}
.close-dm-btn:hover { background: var(--danger); color: white; }

.chat-messages-area {
    flex: 1; overflow-y: auto; padding: 25px;
    background-color: var(--bg); display: flex; flex-direction: column;
    overflow-x: hidden;
}

.message-row { display: flex; margin-bottom: 20px; gap: 12px; align-items: flex-end; width: 100%; }
.message-row.others { justify-content: flex-start; }
.message-row.me { justify-content: flex-end; }

.message-content { max-width: 80%; display: flex; flex-direction: column; }
.message-row.others .message-content { align-items: flex-start; }
.message-row.me .message-content { align-items: flex-end; }

.chat-avatar {
    width: 40px !important; height: 40px !important; min-width: 40px !important;
    max-width: 40px !important; max-height: 40px !important;
    border-radius: 50%; object-fit: cover;
    border: 2px solid var(--card-bg); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.chat-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }

.bubble {
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    position: relative;
    display: block;
    width: fit-content;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-row.me .bubble {
    background: var(--cat-color) !important; color: #ffffff !important;
    border: none; border-bottom-right-radius: 4px;
}
.message-row.others .bubble {
    border-bottom-left-radius: 4px;
}

.pinned-sidebar {
    width: 280px; background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 15px; position: sticky; top: 20px;
    max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow);
}
.user-list-sidebar { display: flex; flex-direction: column; gap: 5px; }
.user-list-item {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    color: var(--text); padding: 8px; border-radius: 8px; transition: 0.2s; font-size: 0.9rem;
}
.user-list-item:hover { background: var(--bg-alt); color: var(--primary); }
.mini-avatar {
    width: 32px !important; height: 32px !important; min-width: 32px !important;
    max-width: 32px !important; max-height: 32px !important;
    border-radius: 50%; object-fit: cover; background: #eee; border: 1px solid var(--border);
}

[data-theme="dark"] .chat-messages-area {
    background: var(--bg);
}
[data-theme="dark"] .bubble { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tab-link:not(.active) { background: #0f172a; color: #64748b; }

.chat-link {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
    word-break: break-all;
}
.message-row.me .chat-link { color: #fff; }

.is-reported-label {
    display: block;
    font-size: 0.7rem;
    font-weight: bold;
    color: #ef5350;
    margin-bottom: 5px;
}

.pinned-card {
    border-left: 4px solid var(--primary);
    background: var(--card-bg);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.new-messages-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: bold;
    margin: 20px 0;
    width: 100%;
}
.new-messages-separator::before, .new-messages-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--primary);
    opacity: 0.3;
}
.new-messages-separator span {
    padding: 0 10px;
}

.chat-input-area {
    padding: 12px 15px;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input-area form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
#msg-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px !important;
    padding: 12px 20px !important;
    resize: none;
    max-height: 150px;
    font-family: inherit;
    display: block;
    width: auto;
    background-color: var(--card-bg);
    color: var(--text);
}
#msg-input:focus {
    border-color: var(--active-tab-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}
.btn-send-chat {
    flex-shrink: 0;
    background: var(--active-tab-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.btn-send-chat:hover { transform: scale(1.08); }

.badge-notif {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    position: absolute;
    top: -5px;
    right: -5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chat-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.message-row:hover .chat-actions {
    opacity: 1;
}

.message-row.me .chat-actions {
    justify-content: flex-end;
}
.message-row.others .chat-actions {
    justify-content: flex-start;
}

.btn-icon {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--border);
    transform: scale(1.1);
}

.btn-icon.text-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.bubble.is-pinned {
    border: 2px solid #fbc02d;
    background: #fff9c4 !important;
    color: #856404 !important;
}
[data-theme="dark"] .bubble.is-pinned {
    background: #413a02 !important;
    color: #fff3cd !important;
    border-color: #fbc02d;
}

.chat-retention-notice {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .chat-layout-wrapper { flex-direction: column; height: auto; min-height: 0; }
    .chat-container { height: 60vh; min-height: 400px; order: 1; }
    .pinned-sidebar {
        width: 100%; order: 2; position: static; padding: 10px 0;
        background: transparent; border: none; box-shadow: none; max-height: none;
    }
    .user-list-sidebar {
        flex-direction: row; overflow-x: auto; padding-bottom: 10px;
        scrollbar-width: thin;
    }
    .user-list-item {
        flex-direction: column; text-align: center; min-width: 75px;
        font-size: 0.75rem; padding: 5px; gap: 4px;
    }
    .user-list-item span { width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mini-avatar { width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px !important; max-height: 32px !important; }

    .chat-actions {
        opacity: 0.6;
    }
}

@media (max-width: 600px) {
    .chat-main-wrapper { padding: 0 5px; margin: 10px auto; }
    .chat-messages-area {
        padding: 12px;
        flex: 1;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    .message-row { gap: 8px; margin-bottom: 15px; }
    .bubble { max-width: 90%; padding: 10px 14px; font-size: 0.92rem; line-height: 1.4; }
    .chat-avatar { width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px !important; max-height: 32px !important; }

    .chat-input-area form { padding: 8px; gap: 8px; }
    #msg-input { padding: 10px; font-size: 16px !important; }
    .btn-send-chat { width: 42px; height: 42px; }
    .chat-container { height: 65vh; min-height: 350px; }
}

/* ============================================================
   === CALENDAR STYLES (calendar.css merged) ===
   ============================================================ */

.cal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.cal-legend-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.cal-legend-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cal-legend-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-right: 2px;
}

.cal-legend-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.cal-legend-cat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid currentColor;
    white-space: nowrap;
}

.cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cal-legend-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-alt);
    white-space: nowrap;
}

.cal-legend-gepland {
    border: 2px dashed var(--primary);
}

.cal-legend-bevestigd {
    border: 2px solid var(--primary);
}

/* Homepage kalender categorie toggle */
.cat-toggle {
    cursor: pointer !important;
    transition: opacity var(--transition), text-decoration var(--transition);
    user-select: none;
}

.cat-toggle:hover {
    opacity: 0.8;
}

.cat-toggle.cat-hidden {
    opacity: 0.4;
    text-decoration: line-through;
}

/* Homepage kalender status labels */
.cal-legend-ingepland {
    border: 2px solid var(--success);
    background: var(--success) !important;
    color: white !important;
}

.cal-legend-voorkeur {
    border: 2px solid var(--warning);
    background: var(--warning) !important;
    color: white !important;
}

.cal-legend-open {
    border: 2px solid var(--info);
    background: var(--info) !important;
    color: white !important;
}

.cal-ev {
    display: flex;
    flex-direction: column;
    padding: 2px 5px;
    gap: 1px;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.cal-ev-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.cal-ev-time {
    font-size: 0.67rem;
    color: inherit;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

/* Homepage kalender event status kleuren */
.fc-event.status-ingepland {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
}

.fc-event.status-voorkeuren-aangegeven {
    background-color: var(--warning) !important;
    border-color: var(--warning) !important;
}

.fc-event.status-open-voor-inschrijvingen {
    background-color: var(--info) !important;
    border-color: var(--info) !important;
}

.fc {
    background: var(--card-bg);
    color: var(--text);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.fc-toolbar-title {
    color: var(--text) !important;
    font-size: 1.1rem !important;
    font-weight: bold;
}

body .fc .fc-button {
    background-color: var(--bg-alt) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    padding: 0.4em 0.65em;
}

body .fc .fc-button-active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.fc-event {
    cursor: pointer;
    border-radius: 4px !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    margin: 1px 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-decoration: none !important;
}

.fc-event:hover {
    transform: scale(1.01);
    filter: brightness(1.1);
    z-index: 5;
}

.fc-event-main-custom {
    padding: 3px 5px;
    color: #ffffff !important;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.fc-event-title-container {
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-event-time-container {
    font-size: 0.7rem;
    opacity: 0.85;
}

.status-gepland {
    border: 3px dashed rgba(255, 255, 255, 0.65) !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15) !important;
}
.status-bevestigd {
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
}
.status-geannuleerd {
    opacity: 0.4 !important;
    text-decoration: line-through !important;
    border: 1px solid rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th { border-color: #334155 !important; }
[data-theme="dark"] .fc-daygrid-day-number { color: #f1f5f9 !important; }

.custom-modal { position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-content { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.5); color: var(--text); overflow-y: auto; max-height: 90vh; }
.modal-content h3 { margin-top: 0; margin-bottom: 20px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; }
.modal-footer.vertical { flex-direction: column; }

[data-theme="dark"] .fc-daygrid-dot-event:hover,
[data-theme="dark"] .fc-daygrid-block-event:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .fc-list-event:hover td { background: rgba(255,255,255,0.05); }

[data-theme="dark"] .fc-list-event-title a {
    color: var(--text) !important;
}

[data-theme="dark"] .fc-list-event-dot {
    filter: brightness(1.2) saturate(1.5);
}

@media (max-width: 768px) {
    #calendar {
        min-height: 400px;
        display: block;
    }

    .fc {
        display: block !important;
        visibility: visible !important;
    }

    .cal-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cal-card-header input {
        width: 100% !important;
        max-width: 100% !important;
    }

    .cal-legend-bar {
        gap: 6px;
    }

    .cal-legend-sep {
        display: none;
    }

    .cal-ev-time {
        display: none;
    }

    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 5px !important;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .fc-button-group {
        width: 100%;
    }

    .fc-button-group .fc-button {
        flex-grow: 1;
        font-size: 0.75rem !important;
    }

    .cal-ev-title {
        font-size: 0.72rem;
    }

    .fc-daygrid-day-number {
        font-size: 0.8rem;
    }
}

/* --- VIEW TOGGLE CONTAINER --- */
.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 35px;
    padding: 0 0 20px 0;
    border-bottom: 2px solid var(--border);
}

.view-toggle-group {
    display: inline-flex;
    gap: 8px;
    background: var(--bg-alt);
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-toggle-btn:hover:not(.active) {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

@media (max-width: 640px) {
    .view-toggle-container {
        justify-content: center;
        margin-bottom: 25px;
    }

    .view-toggle-btn {
        padding: 9px 16px;
        font-size: 0.9rem;
    }
}