:root {
    --bg-main: #0a0f1d;
    --bg-card: #12192c;
    --bg-card-hover: #1a233d;
    --bg-sidebar: #070b16;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 85, 0, 0.4);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --knrm-orange: #ff5500;
    --knrm-orange-hover: #e04a00;
    --knrm-orange-glow: rgba(255, 85, 0, 0.25);
    
    --color-accent: #ff5500;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    --knrm-cyan: #00f0ff;
    --knrm-blue: #3b82f6;
    --knrm-green: #22c55e;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

html {
    overflow-x: hidden;  /* v2.10.64: voorkom horizontale scroll bij small viewport */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: auto;   /* v2.10.92: laat pagina horizontaal scrollen wanneer inhoud breder is dan viewport (sidebar is position:fixed, blijft staan) */
    line-height: 1.5;
    max-width: 100vw;  /* v2.10.64: voorkom dat main-content breder wordt dan viewport (sidebar-overlap bug) */
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;  /* v2.10.65: voorkom dat app-layout breder wordt dan viewport (kinderen rekken anders uit) */
    max-width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.brand-logo {
    background: linear-gradient(135deg, var(--knrm-orange), #ff8800);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px var(--knrm-orange-glow);
    flex-shrink: 0;
}

.logo-badge {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 1px;
}

.brand-title {
    transition: opacity 0.2s ease, width 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.brand-title h1 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand-title .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-card-hover);
    color: var(--knrm-orange);
    border-color: var(--knrm-orange);
}

.sidebar-toggle-btn .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: 76px;
    padding: 1.25rem 0.6rem;
}

.sidebar.collapsed .brand {
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .status-text {
    display: none;
    opacity: 0;
}

.sidebar.collapsed .sidebar-toggle-btn {
    margin-left: 0;
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 101;
}

.sidebar.collapsed .sidebar-toggle-btn .icon {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.85rem 0;
    gap: 0;
}

.sidebar.collapsed .system-status {
    justify-content: center;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 85, 0, 0.15), transparent);
    color: var(--knrm-orange);
    border-left: 3px solid var(--knrm-orange);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    min-width: 0;  /* v2.10.81: voorkom dat kinderen (tabel, detail-row) main uitrekken buiten viewport */
    padding: 2rem;
    max-width: 1600px;
    overflow-x: hidden;  /* v2.10.81: kinderen die breder zijn krijgen eigen scroll via .table-scroll */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-collapsed .main-content {
    margin-left: 76px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.header-search input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.header-search input:focus {
    outline: none;
    border-color: var(--knrm-orange);
    box-shadow: 0 0 0 3px var(--knrm-orange-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-dim);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.year-select, .custom-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
}

.select-member-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.select-member-wrap > * {
    min-width: 0;
}

.select-member-wrap > label {
    flex: 0 1 auto;
    white-space: nowrap;
}

.select-member-wrap > select {
    flex: 1 1 130px;
    width: auto;
}

.year-select:focus, .custom-select:focus {
    outline: none;
    border-color: var(--knrm-orange);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--knrm-orange), #ff7700);
    color: #fff;
    box-shadow: 0 4px 14px var(--knrm-orange-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--knrm-orange-hover), var(--knrm-orange));
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tab Sections */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;  /* v2.10.81: lange tekst (zoals carrière-totalen) breekt op mobiele viewport */
}

.text-accent { color: var(--knrm-orange); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-center { text-align: center; }

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    background-color: var(--bg-card);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill.active {
    background-color: var(--knrm-orange);
    color: #fff;
}

/* Stats Overview Bar */
.stats-overview-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* v2.10.67: Premium Section-titles met KNRM Oranje accent-indicator */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 85, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 18px;
    background: linear-gradient(180deg, var(--knrm-orange), #ff8800);
    border-radius: 3px;
}

.section-title small {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* v2.10.67: Glassmorphism Stat Cards met Iconen & Micro-interacties */
.stat-card {
    background: rgba(18, 25, 44, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 85, 0, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 85, 0, 0.12);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 85, 0, 0.12);
    border: 1px solid rgba(255, 85, 0, 0.25);
    color: var(--knrm-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-card-icon.icon-blue {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

.stat-card-icon.icon-green {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.stat-card-icon.icon-cyan {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.25);
    color: #00f0ff;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

/* Primaire cards = hoofdcijfers (groter, geaccentueerd) */
.stat-card-primary {
    background: linear-gradient(135deg, rgba(255, 85, 0, 0.12), rgba(18, 25, 44, 0.85));
    border-left: 4px solid var(--knrm-orange);
    box-shadow: 0 4px 20px rgba(255, 85, 0, 0.08);
}

.stat-card-primary:hover {
    border-color: var(--knrm-orange);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 85, 0, 0.25);
}

.stat-card-primary .stat-value {
    font-size: 2.1rem;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

/* v2.10.67: Inline progress bars & row highlights in tabellen */
.stat-bar-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.stat-bar-wrap {
    flex: 1;
    max-width: 110px;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--knrm-orange), #ff8800);
    border-radius: 4px;
    transition: width 0.4s ease-out;
}

.stat-bar-fill.fill-blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-bar-fill.fill-green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-row-top {
    background: rgba(255, 85, 0, 0.07) !important;
}

.stat-row-top td {
    font-weight: 600;
}

.top-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 85, 0, 0.2);
    color: #ff8a4c;
    border: 1px solid rgba(255, 85, 0, 0.4);
    margin-left: 0.4rem;
}

/* Table Cards */
.table-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;  /* v2.10.81: toestaan horizontaal scrollen op smalle viewport (was: hidden) */
    overflow-y: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

/* v2.10.81: utility voor tabellen zonder .table-card wrapper, b.v. PO-historie op smalle viewport (Z Fold5 cover) */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-actie { background-color: rgba(255, 85, 0, 0.2); color: #ff7733; border: 1px solid rgba(255, 85, 0, 0.4); }
.badge-oefening { background-color: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-pr { background-color: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-default { background-color: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    background-color: var(--bg-card-hover);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0.1rem;
}

.role-tag.role-K { border-left: 2px solid var(--knrm-orange); font-weight: 600; }
.role-tag.role-N { border-left: 2px solid var(--color-info); }
.role-tag.role-F { border-left: 2px solid var(--color-warning); }
.role-tag.role-O { border-left: 2px solid var(--color-success); }
.role-tag.role-X { border-left: 2px solid var(--color-danger); background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; font-weight: 700; }

/* Member Detail View */
.member-detail-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.member-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--knrm-orange), #ff8800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.profile-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    /* v2026-08-02: beeldvullende modal (95vw x 95vh, max 1400px breed) voor betere UX met grote bemanningslijsten */
    width: 95vw;
    max-width: 1400px;
    height: 95vh;
    max-height: 95vh;
    overflow: hidden;  /* v2026-08-02: child scrolls now (was auto op de card zelf) */
    display: flex;     /* v2026-08-02: stack header/body/footer verticaal */
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    /* v2026-08-02: header niet krimpen in flex-layout */
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    /* v2026-08-02: body vult de ruimte tussen header en footer; scrollt zelf */
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* v2026-08-02: zichtbare kalender/klok-iconen op date/time inputs in dark mode.
   Eerste poging met filter werkte niet (browser-specifiteit / caching).
   Nu: verberg native indicator + toon eigen SVG-icoon via background-image.
   Werkt in alle moderne browsers (Chrome/Firefox/Safari/Edge). */
.form-group input[type="date"],
.form-group input[type="time"] {
    color-scheme: dark;
    padding-right: 2.5rem;
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.1rem 1.1rem;
}

/* Verberg de native picker-indicator */
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    /* Houd 'm klikbaar door groot transparant oppervlak te maken */
    width: 1.5rem;
    height: 1.5rem;
    margin-right: -1.5rem;
}

/* Kalender-icoon (SVG inline, wit voor dark mode) */
.form-group input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 002 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM5 8V6h14v2H5zm2 4h5v5H7v-5z'/%3E%3C/svg%3E");
}

/* Klok-icoon (SVG inline, wit voor dark mode) */
.form-group input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--knrm-orange);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* v2.10.6: zichtbare cache-buster indicator (rechtsboven in top-bar) */
.app-version-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin-right: 0.5rem;
    background-color: rgba(255, 193, 7, 0.18);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 0.02em;
    user-select: all;
}

.crew-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.35rem;
    max-height: 460px;
    overflow-y: auto;
    padding: 0.4rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.crew-checkbox-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    background-color: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    gap: 0.4rem;
    min-width: 0;
}

.crew-checkbox-item label {
    cursor: pointer;
    font-weight: 400;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.crew-role-select {
    padding: 0.05rem 0.15rem;
    font-size: 0.72rem;
    min-width: 36px;
    flex-shrink: 0;
}

/* v2.10.5: Toggle om inactieve bemanningsleden te tonen */
.crew-toggle-inactief {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0.4rem 0 0.3rem 0;
    cursor: pointer;
    font-weight: 400;
}
.crew-toggle-inactief input[type="checkbox"] {
    cursor: pointer;
}

/* v2.10.5: status-melding onder de toggle */
.crew-status-msg {
    font-size: 0.75rem;
    color: var(--accent);
    margin: 0 0 0.4rem 0;
    min-height: 1.1rem;
    font-weight: 500;
}

/* v2026-08-02: live teller van aangevinkte opstappers onder de grid */
.crew-count-display {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: rgba(100, 200, 255, 0.08);
    border: 1px solid rgba(100, 200, 255, 0.25);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.crew-count-display.zero {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
}

/* v2.10.4: visuele markering voor inactieve / aspirant bemanningsleden */
.crew-checkbox-item.crew-inactief {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-color);
    opacity: 0.85;
}
.crew-inactief-badge {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.05rem 0.35rem;
    background-color: rgba(255, 193, 7, 0.18);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;  /* v2026-08-02: side-padding zodat het niet tegen de rand plakt */
    border-top: 1px solid var(--border-color);
    /* v2026-08-02: footer plakt onderaan bij korte body */
    margin-top: auto;
    flex-shrink: 0;
}

/* ===== v2.5: Persoonlijk Overzicht ===== */
.version-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.6em;
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.headerkaart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.hk-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hk-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hk-val {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-card .stat-value.text-danger { color: #ef4444; }
.stat-card .stat-value.text-warning { color: #f59e0b; }

/* ===== v2.5: Matrix Grid ===== */
.matrix-grid-container {
    overflow-x: auto;
    max-width: 100%;
}

table.matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    background: var(--bg-card);
}

table.matrix-table th,
table.matrix-table td {
    border: 1px solid var(--border-color);
    padding: 4px 6px;
    text-align: center;
    white-space: nowrap;
}

table.matrix-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
    font-weight: 600;
}

table.matrix-table thead th.inzet-col {
    min-width: 60px;
    max-width: 80px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    height: 110px;
    vertical-align: bottom;
    padding: 4px 3px;
}

table.matrix-table tbody th {
    background: var(--bg-secondary);
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 160px;
    max-width: 220px;
    font-weight: 600;
}

table.matrix-table tbody th .row-meta {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

.rol-badge {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.rol-badge.rol-K { background: #dbeafe; color: #1e3a8a; }
.rol-badge.rol-N { background: #d1fae5; color: #065f46; }
.rol-badge.rol-F { background: #fef3c7; color: #92400e; }
.rol-badge.rol-O { background: #e0e7ff; color: #3730a3; }
.rol-badge.rol-X { background: #fee2e2; color: #991b1b; }
.rol-badge.rol-leeg { background: var(--bg-tertiary); color: var(--text-muted); }

/* Matrix scrollbar styling */
.matrix-grid-container::-webkit-scrollbar { height: 10px; }
.matrix-grid-container::-webkit-scrollbar-track { background: var(--bg-tertiary); }
.matrix-grid-container::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }

/* ===== v2.5 Sidebar — Mobile + Custom Tooltip ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 76px;
        padding: 1.25rem 0.6rem;
    }
    .sidebar .brand-title,
    .sidebar .nav-item span,
    .sidebar .status-text {
        display: none;
    }
    .sidebar .brand {
        justify-content: center;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 0.85rem 0;
    }
    .sidebar .sidebar-toggle-btn {
        display: none;  /* Geen handmatige toggle op mobile; sidebar is permanent ingeklapt */
    }
    .app-layout.sidebar-collapsed .main-content,
    .main-content {
        margin-left: 76px;
        padding: 1rem;
    }
}

/* Custom tooltip voor nav-items in collapsed stand */
.sidebar.collapsed .nav-item[data-tooltip]:hover::after,
.sidebar.collapsed .nav-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 250;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* v2.5.2: Verberg Geredden-kolom bij Oefeningen/Div filter */
#inzetten-table.hide-geredden th#th-geredden,
#inzetten-table.hide-geredden td:nth-child(7) {
    display: none;
}

/* v2.9.2: Sortable headers (bezetting-tabel) */
#bezetting-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}
#bezetting-table th.sortable:hover {
    color: #cbd5e1;
}
#bezetting-table th.sortable .sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
    color: #fbbf24;
}


/* ========================================================================
   Login-pagina (glasmorphic, donker, gespiegeld van hefring-webapp).
   Body krijgt class="login-page" zodat glow-bg fullscreen werkt.
   Toegevoegd v2.10.17 — vereiste login-blok ontbrak in styles.css,
   waardoor het inlogscherm kaal/default uitzag.
   Gebruikt --knrm-cyan / --knrm-blue gradient-knop.
   ======================================================================== */

/* ========================================================================
   Login-pagina (glasmorphic, donker, zelfde ontwerp als dashboard)
   Body krijgt class="login-page" zodat de glow-bg fullscreen werkt.
   ======================================================================== */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10;
  animation: loginFadeIn 0.4s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45));
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--knrm-cyan) 0%, var(--knrm-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.5px;
}

.login-field {
  margin-bottom: 1rem;
}

.login-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.login-input:focus {
  outline: none;
  border-color: var(--knrm-cyan);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}

.login-btn {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.5px;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--knrm-blue) 0%, var(--knrm-cyan) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.2);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.35);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: var(--color-danger);
  font-size: 0.85rem;
  text-align: center;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Login-pagina voor inzet.knrmijmuiden.nl — gespiegeld van hefring-webapp voor consistentie. v2.10.17. */
body.login-page .glow-bg {
  /* Glow wat centraler voor een centered card. */

/* Statistieken — Type Acties taartdiagram (Sheet-stijl met datalabels). v2.10.47 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.type-acties-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    min-height: 460px;
}
@media (max-width: 700px) {
    .type-acties-canvas-wrap {
        min-height: 320px;
    }
}

/* ===== v2.10.69: Premium Persoonlijk Overzicht Styling ===== */

/* Glassmorphism Header Profile Card */
.member-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--knrm-orange);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.member-profile-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.avatar-circle-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6600 0%, #e65c00 50%, #cc5200 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 102, 0, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

.avatar-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    border: 3px solid #0f172a;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Headerkaart Tile Grid */
.headerkaart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.hk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.hk-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 85, 0, 0.4);
    transform: translateY(-1px);
}

.hk-icon,
svg.hk-icon,
.hk-item svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    stroke-width: 2 !important;
    color: var(--knrm-orange);
    flex-shrink: 0;
    margin-top: 0;
    display: block;
}

.hk-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hk-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.2;
    display: block;
}

.hk-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
    display: block;
    word-break: break-word;
}

.po-stat-card {
    position: relative;
}

.po-kwartaal-tabel {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.po-kwartaal-tabel th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.po-kwartaal-tabel td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}

.po-jaar-totaal-cell {
    background: rgba(16, 185, 129, 0.08) !important;
    border-left: 2px solid #10b981 !important;
}

.po-jaar-totaal-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: #34d399;
}

