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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
}

/* ── Header ────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
header h1 { font-size: 1.3rem; font-weight: 600; }
header .actions { display: flex; gap: 8px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.btn-primary { background: #4472C4; color: white; }
.btn-success { background: #00B050; color: white; }
.btn-warning { background: #FFC000; color: #333; }
.btn-danger  { background: #FF4444; color: white; }
.btn-outline { background: transparent; border: 1px solid #aaa; color: #555; }
.btn-outline:hover { background: #eee; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
}
.tab {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.15s;
}
.tab:hover { color: #333; }
.tab.active { color: #4472C4; border-bottom-color: #4472C4; }

/* ── Main content ──────────────────────────────────── */
main { padding: 16px 24px; }
.panel { display: none; }
.panel.active { display: block; }

/* ── Month selector ────────────────────────────────── */
.month-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.month-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.month-btn:hover { border-color: #4472C4; }
.month-btn.active { background: #4472C4; color: white; border-color: #4472C4; }

/* ── Roster table ──────────────────────────────────── */
.roster-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 4px;
}
.roster-table {
    border-collapse: collapse;
    font-size: 0.75rem;
    width: max-content;
    min-width: 100%;
}
.roster-table th, .roster-table td {
    border: 1px solid #d0d0d0;
    text-align: center;
    padding: 3px 2px;
    min-width: 52px;
    max-width: 72px;
    height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.roster-table th {
    background: #f5f7fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}
.roster-table th.fellow-header {
    text-align: left;
    min-width: 90px;
    max-width: 120px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f5f7fa;
}
.roster-table td.fellow-name {
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
    background: white;
}
.roster-table td.weekend { background: #e8e8e8 !important; color: #999; }
.roster-table td.editable { cursor: pointer; }
.roster-table td.editable:hover { outline: 2px solid #4472C4; outline-offset: -2px; }

.roster-table tr.separator td { height: 4px; border: none; background: #f0f2f5; }

/* ── Legend ─────────────────────────────────────────── */
.legend {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
    font-size: 0.8rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

/* ── Validation bar ────────────────────────────────── */
.validation-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: white;
    border-radius: 8px;
    margin-top: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 0.85rem;
}
.validation-bar .badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}
.badge-error { background: #FFE0E0; color: #CC0000; }
.badge-warning { background: #FFF3CD; color: #856404; }
.badge-ok { background: #D4EDDA; color: #155724; }

/* ── Fellows panel ─────────────────────────────────── */
/* ── Fellow 3-panel layout ─────────────────────────── */
.fellow-layout {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}
/* Links: naam, datums, vrije dag */
.fellow-left {
    flex-shrink: 0;
    box-shadow: 4px 0 6px -2px rgba(0,0,0,0.12);
    z-index: 2;
    background: white;
}
.fellow-left-table {
    border-collapse: collapse;
    font-size: 0.78rem;
}
.fellow-left-table thead th {
    background: #f5f7fa;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    padding: 4px 6px;
    white-space: nowrap;
    text-align: left;
    border-bottom: 1px solid #d0d0d0;
}
.fellow-col-name {
    width: 120px;
    min-width: 120px;
    padding: 4px 6px;
    background: white;
}
.fellow-col-name input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    box-sizing: border-box;
}
.fellow-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.fellow-col-date {
    width: 115px;
    min-width: 115px;
    padding: 4px 3px;
    background: white;
}
.fellow-col-date input[type="date"] {
    width: 100%;
    padding: 3px 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.76rem;
    box-sizing: border-box;
}
.fellow-col-dayoff {
    width: 60px;
    min-width: 60px;
    padding: 4px 3px;
    background: white;
}
.fellow-col-dayoff select {
    width: 100%;
    padding: 3px 1px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.76rem;
    box-sizing: border-box;
}
.fellow-left-table .fellow-row td {
    border-bottom: 1px solid #eee;
}
/* Midden: gantt (scrollbaar) */
.fellow-gantt-scroll {
    flex: 1;
    overflow-x: auto;
    min-width: 0;
}
.fellow-gantt-table {
    border-collapse: collapse;
    font-size: 0.78rem;
}
.fellow-gantt-table thead th {
    border-bottom: 1px solid #d0d0d0;
}
.fellow-gantt-table .gantt-year-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 3px 0;
    background: #f5f7fa;
    border-bottom: 2px solid #4472C4;
    color: #333;
}
.fellow-gantt-table .gantt-month-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.58rem;
    padding: 2px 0;
    background: #f5f7fa;
    color: #555;
    width: 22px;
    min-width: 22px;
}
.fellow-gantt-table .gantt-cell {
    padding: 0;
    height: 26px;
    border: none;
    border-bottom: 1px solid #eee;
    width: 22px;
    min-width: 22px;
}
.fellow-gantt-table .gantt-active {
    opacity: 0.85;
}
/* Rechts: verwijder-knoppen */
.fellow-right {
    flex-shrink: 0;
    box-shadow: -4px 0 6px -2px rgba(0,0,0,0.12);
    z-index: 2;
    background: white;
}
.fellow-right-table {
    border-collapse: collapse;
    font-size: 0.78rem;
}
.fellow-right-table thead th {
    background: #f5f7fa;
    border-bottom: 1px solid #d0d0d0;
    padding: 0;
}
.fellow-col-actions {
    width: 28px;
    min-width: 28px;
    text-align: center;
    padding: 4px 2px;
    background: white;
    border-bottom: 1px solid #eee;
}
.fellow-col-actions .remove-btn {
    color: #CC0000;
    font-size: 0.82rem;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 4px;
}
.fellow-col-actions .remove-btn:hover {
    background: #fee;
    border-radius: 4px;
}

/* ── Clinics panel ─────────────────────────────────── */
.clinics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 0.85rem;
}
.clinics-table th, .clinics-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.clinics-table th { background: #f5f7fa; font-weight: 600; }
.clinics-table tr:hover { background: #f9f9f9; }
.badge-mandatory { background: #D4EDDA; color: #155724; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.badge-optional  { background: #FFF3CD; color: #856404; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }

/* ── Edit dialog ───────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
    justify-content: center;
    align-items: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: white;
    border-radius: 10px;
    padding: 24px;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 12px; }
.modal label { font-size: 0.85rem; color: #555; display: block; margin-top: 10px; }
.modal select, .modal input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 2px;
}
.modal .modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* ── Validation month bar ─────────────────────────── */
.validation-month-bar {
    display: flex;
    gap: 4px;
    align-items: center;
}
.validation-month-bar .month-btn {
    padding: 3px 10px;
    font-size: 0.75rem;
}

/* ── Validation details ────────────────────────────── */
.validation-list {
    margin-top: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    max-height: 500px;
    overflow-y: auto;
}
.validation-group {
    border-bottom: 1px solid #e0e0e0;
}
.validation-group:last-child { border-bottom: none; }
.validation-group-header {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    background: #f9f9fb;
    user-select: none;
}
.validation-group-header:hover { background: #f0f2f5; }
.validation-group-header .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.15s;
    width: 12px;
}
.validation-group.collapsed .toggle-icon { transform: rotate(-90deg); }
.validation-group.collapsed .validation-group-items { display: none; }
.validation-group-items { }
.validation-item {
    padding: 6px 14px 6px 32px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.validation-item:last-child { border-bottom: none; }
.validation-item.clickable { cursor: pointer; }
.validation-item.clickable:hover { background: #f0f4ff; }
.validation-item .icon-error { color: #CC0000; }
.validation-item .icon-warning { color: #E6A800; }

/* ── Cell highlight (vanuit validatie navigatie) ──── */
.cell-highlight {
    animation: cellPulse 0.6s ease-in-out 3;
    outline: 3px solid #4472C4 !important;
    outline-offset: -2px;
    position: relative;
    z-index: 5;
}
@keyframes cellPulse {
    0%   { outline-color: #4472C4; box-shadow: 0 0 0 0 rgba(68,114,196,0.4); }
    50%  { outline-color: #FF6600; box-shadow: 0 0 8px 2px rgba(255,102,0,0.4); }
    100% { outline-color: #4472C4; box-shadow: 0 0 0 0 rgba(68,114,196,0.4); }
}

/* ── Generate panel ────────────────────────────────── */
.generate-form {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 480px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.generate-form label { display: block; margin-top: 12px; font-size: 0.85rem; color: #555; }
.generate-form select, .generate-form input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 2px;
}
.generate-form .btn { margin-top: 16px; }
#generate-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: none;
}

/* ── Spinner ───────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #4472C4;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Absences (Vakantierooster) panel ─────────────── */
.abs-month-block {
    margin-bottom: 20px;
}
.abs-month-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a2e;
}
.abs-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 4px;
    width: fit-content;
}
.abs-table {
    border-collapse: collapse;
    font-size: 0.72rem;
    table-layout: fixed;
}
.abs-table th, .abs-table td {
    border: 1px solid #d0d0d0;
    text-align: center;
    padding: 2px 1px;
    height: 26px;
    white-space: nowrap;
    overflow: hidden;
}
/* Colgroup-gestuurde breedtes via CSS-variabelen */
col.abs-col-name { width: var(--abs-name-col, 100px); }
col.abs-col-day  { width: var(--abs-day-col, 38px); }
/* Weeknummer-rij */
.abs-week-row th {
    height: 18px;
    border-bottom: 2px solid #4472C4;
}
.abs-week-num {
    background: #EDF2F9 !important;
    color: #4472C4;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}
.abs-week-empty {
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}
.abs-week-empty.weekend {
    background: #e8e8e8 !important;
    border: 1px solid #d0d0d0 !important;
}
.abs-week-label {
    font-size: 0.68rem !important;
    color: #999 !important;
    font-weight: 400 !important;
}
.abs-table th {
    background: #f5f7fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.7rem;
    line-height: 1.2;
}
.abs-table th small {
    display: block;
    font-weight: 400;
    color: #999;
    font-size: 0.65rem;
}
.abs-fellow-col {
    text-align: left !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    position: sticky;
    left: 0;
    z-index: 3;
    background: white !important;
    font-size: 0.78rem;
}
.abs-table th.abs-fellow-col {
    background: #f5f7fa !important;
}
.abs-table td.weekend {
    background: #e8e8e8 !important;
    color: #999;
}
.abs-cell {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.7rem;
    transition: all 0.1s;
}
.abs-cell:hover {
    outline: 2px solid #4472C4;
    outline-offset: -2px;
}
.abs-cell.abs-parttime {
    background: #D9E2F3;
    color: #5B7DB1;
    cursor: pointer;
}
.abs-cell.abs-holiday {
    background: #00B050;
    color: white;
    cursor: default;
    font-weight: 500;
    font-size: 0.6rem;
}
.abs-cell.abs-holiday:hover {
    outline: none;
}
.abs-table th.holiday-header {
    background: #C6EFCE;
    color: #006100;
}

/* ── Indeling panel ───────────────────────────────── */
.ind-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 4px;
}
.ind-table {
    border-collapse: collapse;
    font-size: 0.78rem;
    width: max-content;
    min-width: 100%;
}
.ind-table th, .ind-table td {
    border: 1px solid #d0d0d0;
    padding: 4px 6px;
    vertical-align: middle;
}
.ind-table th {
    background: #f5f7fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: center;
    font-size: 0.75rem;
}
.ind-dag-col {
    min-width: 80px;
    text-align: center;
    background: #eef1f5 !important;
    font-size: 0.78rem;
}
.ind-dagdeel-col {
    min-width: 60px;
    background: #fafafa;
    font-size: 0.72rem;
    color: #555;
    text-align: center;
}
.ind-poli-col {
    min-width: 80px;
    max-width: 120px;
    background: #fafafa;
    white-space: nowrap;
}
.ind-month-col {
    min-width: 90px;
    text-align: center;
    line-height: 1.3;
}
.ind-cell {
    padding: 2px 3px;
    text-align: center;
}
.ind-clickable {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 80px;
    user-select: none;
    transition: all 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ind-clickable:hover {
    outline: 2px solid #333;
    outline-offset: -2px;
}
.ind-multi-cell {
    padding: 1px !important;
}
.ind-multi-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ind-sub-cell {
    flex: 1;
    padding: 3px 2px;
    border-radius: 3px;
    min-height: 22px;
    font-size: 0.70rem;
    border: 1px solid #ddd;
    background: #fafafa;
}
.ind-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.ind-legend-item {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ind-legend-selectable, .ind-legend-eraser {
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, box-shadow 0.15s;
    user-select: none;
}
.ind-legend-selectable:hover, .ind-legend-eraser:hover {
    opacity: 0.85;
}
.ind-legend-active {
    opacity: 1 !important;
    box-shadow: 0 0 0 3px #333;
}
.ind-legend-eraser {
    background: #eee;
    color: #666;
    font-size: 0.85rem;
    padding: 3px 12px;
}
.ind-count-fellow {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    background: white;
    text-align: left !important;
}
.ind-count-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}
.ind-count-cell {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 6px;
}
.ind-count-dimmed {
    opacity: 0.25;
}
.ind-count-highlighted {
    opacity: 1;
}
.ind-cell-dimmed {
    opacity: 0.15;
}
.ind-summary-header td {
    border-top: 2px solid #4472C4;
}

/* ── Namen-view (polinamen per fellow) ──────────── */
.ind-clinic-legend-row {
    background: #f5f7fa;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.ind-clinic-legend-item {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-block;
}
.ind-clinic-legend-selectable, .ind-clinic-legend-eraser {
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, box-shadow 0.15s;
    user-select: none;
}
.ind-clinic-legend-selectable:hover, .ind-clinic-legend-eraser:hover {
    opacity: 0.85;
}
.ind-clinic-legend-active {
    opacity: 1 !important;
    box-shadow: 0 0 0 2px #333;
}
.ind-clinic-legend-eraser {
    background: #eee;
    color: #666;
    font-size: 0.80rem;
    padding: 2px 10px;
}
.ind-names-cell {
    padding: 2px 3px;
    text-align: center;
    cursor: pointer;
    vertical-align: top;
    user-select: none;
    transition: all 0.1s;
}
.ind-names-cell:hover {
    outline: 2px solid #333;
    outline-offset: -2px;
}
.ind-names-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-height: 20px;
}
.ind-names-tag {
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    line-height: 1.4;
}
.ind-names-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 0.78rem;
    margin-top: 0;
}
.ind-names-table td {
    border: 1px solid #d0d0d0;
    vertical-align: middle;
}
.ind-names-fellow-hdr {
    background: #f5f7fa;
}
.ind-names-month-hdr {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    background: #f5f7fa;
    padding: 4px 2px;
}
.ind-names-fellow {
    padding: 4px 4px;
    white-space: nowrap;
    overflow: hidden;
}
.ind-names-slot-hdr {
    background: #f5f7fa;
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
    padding: 4px 2px;
}
.ind-names-slot {
    font-size: 0.65rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    padding: 2px 2px;
    white-space: nowrap;
    background: #fafbfc;
}
.ind-names-dag {
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    background: #eef1f5;
    padding: 4px 4px;
    white-space: nowrap;
}
.ind-names-dagdeel {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: #555;
    background: #fafafa;
    padding: 2px 4px;
    white-space: nowrap;
}
.ind-names-fellow-group {
    border-top: 2px solid #d1d5db;
}

/* ── Gantt diagram (fellows tab) ─────────────────── */
.gantt-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 8px;
}
.gantt-table {
    border-collapse: collapse;
    font-size: 0.78rem;
    width: 100%;
    table-layout: fixed;
}
.gantt-name-col {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    text-align: left;
    padding: 4px 8px;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
}
.gantt-year-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 0;
    background: #f5f7fa;
    border-bottom: 2px solid #4472C4;
    color: #333;
}
.gantt-month-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.68rem;
    padding: 3px 0;
    background: #f5f7fa;
    color: #555;
    border-bottom: 1px solid #d0d0d0;
}
.gantt-cell {
    padding: 0;
    height: 26px;
    border: none;
    border-bottom: 1px solid #eee;
}
.gantt-active {
    opacity: 0.85;
}

/* ── Stage-telling tabel (poli's tab) ─────────────── */
.stage-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 4px;
}
.stage-table {
    border-collapse: collapse;
    font-size: 0.78rem;
    width: 100%;
}
.stage-table th, .stage-table td {
    border: 1px solid #d0d0d0;
    padding: 5px 8px;
    text-align: center;
    white-space: nowrap;
}
.stage-table th {
    background: #f5f7fa;
    font-weight: 600;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 2;
}
.stage-poli-col {
    text-align: left !important;
    min-width: 140px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: white !important;
}
.stage-table th.stage-poli-col {
    background: #f5f7fa !important;
}
.stage-req-col {
    min-width: 70px;
}
.stage-req-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.75rem;
    background: #fafafa;
}
.stage-req-input:focus {
    border-color: #4472C4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(68,114,196,0.2);
}
.stage-fellow-col {
    min-width: 70px;
    font-size: 0.72rem;
}
.stage-fellow-val {
    font-weight: 700;
    font-size: 0.82rem;
}
.stage-val-zero {
    color: #bbb;
}
.stage-val-partial {
    color: #C55A11;
}
.stage-val-neutral {
    color: #333;
}
.stage-val-done {
    background: #00B050 !important;
    color: white;
}
.stage-category-row td {
    background: #EDF2F9 !important;
    color: #333;
    font-size: 0.78rem;
    padding: 4px 8px;
    border: none;
    border-bottom: 2px solid #4472C4;
}

/* ── Regels panel ─────────────────────────────────── */
.regels-intro {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 0.9rem;
    line-height: 1.6;
}
.regels-intro p { margin: 0; }

.regels-section {
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}
.regels-section-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9f9fb;
    user-select: none;
    transition: background 0.15s;
}
.regels-section-header:hover { background: #f0f2f5; }
.regels-section-header h3 {
    font-size: 0.92rem;
    margin: 0;
    font-weight: 600;
}
.regels-section-header .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.15s;
    width: 12px;
    flex-shrink: 0;
}
.regels-section.collapsed .toggle-icon { transform: rotate(-90deg); }
.regels-section.collapsed .regels-section-content { display: none; }

.regels-section-content {
    padding: 12px 16px 16px;
    font-size: 0.85rem;
    line-height: 1.6;
}
.regels-section-content p { margin: 0 0 8px 0; }
.regels-section-content ul {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}
.regels-section-content li { margin-bottom: 4px; }

.regels-detail {
    background: #f5f7fa;
    border-left: 3px solid #4472C4;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 0 4px 4px 0;
    font-size: 0.82rem;
    color: #555;
}
.regels-detail code {
    background: #e8ecf0;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* ── Regels: stappen ─────────────────────────────── */
.regels-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}
.regels-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #4472C4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}
.step-content {
    flex: 1;
}
.step-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.88rem;
}
.step-content p {
    margin: 0 !important;
    font-size: 0.82rem;
    color: #555;
}
.step-content ul {
    margin: 2px 0 0 0;
    padding-left: 16px;
    font-size: 0.82rem;
    color: #555;
}

/* ── Regels: poli overzicht tabel ────────────────── */
.regels-poli-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 8px;
}
.regels-poli-table th, .regels-poli-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.regels-poli-table th {
    background: #f5f7fa;
    font-weight: 600;
}
.regels-poli-table td:first-child {
    width: 100px;
}
.poli-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1px 2px;
}
.poli-tag.mandatory { background: #D4EDDA; color: #155724; }
.poli-tag.optional { background: #FFF3CD; color: #856404; }
.poli-tag.gv { background: #3B4A5C; color: white; }

/* ── Regels: validatie tabel ─────────────────────── */
.regels-validation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 8px;
}
.regels-validation-table th, .regels-validation-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.regels-validation-table th {
    background: #f5f7fa;
    font-weight: 600;
}
.regels-validation-table td:first-child {
    width: 30px;
    text-align: center;
    color: #999;
}
.regels-validation-table .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ── Regels: activiteiten grid ───────────────────── */
.regels-activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.regels-activity {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}
.regels-activity code {
    background: #e8ecf0;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Regels: fellows info tabel ──────────────────── */
.regels-fellows-table {
    margin-top: 8px;
}
.regels-fellows-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.regels-fellows-table th, .regels-fellows-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.regels-fellows-table th {
    background: #f5f7fa;
    font-weight: 600;
}

/* ── Regels: beperkingen lijst ───────────────────── */
.regels-limitations {
    list-style: none;
    padding: 0 !important;
}
.regels-limitations li {
    padding: 8px 12px;
    border-left: 3px solid #FFC000;
    background: #FFFDF5;
    margin-bottom: 8px !important;
    border-radius: 0 4px 4px 0;
}

/* Biweekly week selector */
.biweekly-week-select {
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.82rem;
    background: #fff;
}
