/* ============================================
   MEESTERTOOLS - Instellingen Overlay
   ============================================ */

.instellingen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.instellingen-overlay.active { opacity: 1; visibility: visible; }

.instellingen-container {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90vw; max-width: 900px;
    height: 85vh; max-height: 700px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex; flex-direction: column;
    z-index: 501;
    opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.instellingen-overlay.active .instellingen-container {
    opacity: 1; visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.instellingen-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #F0F0F5;
    flex-shrink: 0;
}
.instellingen-header h2 { font-size: 20px; font-weight: 800; color: var(--text-dark); }

.instellingen-close {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--bg-light); cursor: pointer; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-medium);
}
.instellingen-close:hover { background: #E8E8F0; color: var(--text-dark); }

.instellingen-body { display: flex; flex: 1; overflow: hidden; }

.instellingen-sidebar {
    width: 220px; border-right: 1px solid #F0F0F5;
    padding: 16px 0; flex-shrink: 0; background: #FAFAFF;
}
.instellingen-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 24px; font-size: 14px; font-weight: 600;
    color: var(--text-medium); cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none; background: none; width: 100%;
    text-align: left; font-family: inherit;
}
.instellingen-nav-item:hover { color: var(--text-dark); background: #F0F0F8; }
.instellingen-nav-item.active {
    color: var(--primary); background: #EEF0FF;
    border-right: 3px solid var(--primary);
}
.instellingen-nav-item .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.instellingen-content { flex: 1; overflow-y: auto; padding: 28px 32px; }
.instellingen-section { display: none; }
.instellingen-section.active { display: block; }
.instellingen-section h3 { font-size: 18px; font-weight: 700; color: var(--text-dark); margin-bottom: 20px; }

.profiel-card {
    background: var(--bg-light); border-radius: var(--radius-md);
    padding: 24px; margin-bottom: 24px;
}
.profiel-card h4 { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; }
.profiel-card .form-group { margin-bottom: 16px; }
.profiel-card .form-group:last-of-type { margin-bottom: 0; }
.profiel-card .form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-medium); margin-bottom: 6px;
}
.profiel-card .form-group input {
    width: 100%; padding: 12px 14px; border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm); font-size: 14px; outline: none;
    font-family: inherit; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-white);
}
.profiel-card .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}
.profiel-card .btn-save {
    margin-top: 16px; padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-family: inherit;
}
.profiel-card .btn-save:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.profiel-card .btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.profiel-message {
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 13px; margin-top: 12px; display: none;
}
.profiel-message.success { display: block; background: #F0FFF4; color: #27AE60; border: 1px solid #C6F6D5; }
.profiel-message.error { display: block; background: #FFF0F0; color: #D63031; border: 1px solid #FFCCCC; }

.klas-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; gap: 12px;
}
.klas-toolbar .filter-toggle { font-size: 13px; }

.groepen-list { display: flex; flex-direction: column; gap: 8px; }
.groep-item {
    background: var(--bg-light); border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden;
}
.groep-item.active { border-color: var(--primary); background: var(--bg-white); box-shadow: var(--shadow-sm); }
.groep-item.archived { opacity: 0.6; }

.groep-header {
    display: flex; align-items: center; padding: 14px 16px;
    cursor: pointer; gap: 12px;
}
.groep-header:hover { background: rgba(108, 99, 255, 0.04); }
.groep-name { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-dark); }
.groep-count {
    font-size: 12px; color: var(--text-light); background: var(--bg-white);
    padding: 2px 10px; border-radius: 20px; font-weight: 600;
}
.groep-actions { display: flex; gap: 4px; }
.groep-actions .btn-small { padding: 5px 10px; font-size: 11px; }
.groep-expand { font-size: 12px; color: var(--text-light); transition: transform 0.3s; }
.groep-item.active .groep-expand { transform: rotate(90deg); }

.leerlingen-panel {
    display: none; border-top: 1px solid #E8E8F0;
    padding: 16px; background: var(--bg-white);
}
.groep-item.active .leerlingen-panel { display: block; }

.leerlingen-toolbar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.leerlingen-toolbar h4 {
    font-size: 13px; font-weight: 700; color: var(--text-medium);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.leerlingen-list { display: flex; flex-direction: column; gap: 4px; }

.leerling-item {
    display: flex; align-items: center; padding: 10px 12px;
    border-radius: var(--radius-sm); gap: 12px; transition: background 0.2s;
}
.leerling-item:hover { background: var(--bg-light); }
.leerling-item.archived { opacity: 0.5; }

.leerling-nummer {
    font-size: 12px; font-weight: 700; color: var(--text-light);
    background: var(--bg-light); width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.leerling-naam { flex: 1; font-size: 14px; color: var(--text-dark); }

.leerling-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.leerling-item:hover .leerling-actions { opacity: 1; }
.leerling-actions .btn-small { padding: 4px 8px; font-size: 11px; }

.leerlingen-empty { text-align: center; padding: 24px; color: var(--text-light); font-size: 13px; }
.groepen-empty { text-align: center; padding: 40px 20px; color: var(--text-light); }
.groepen-empty .empty-icon { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.5; }
.groepen-empty p { font-size: 14px; }

.inline-add-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-add-form input {
    flex: 1; padding: 8px 12px; border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm); font-size: 13px; outline: none;
    font-family: inherit; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.inline-add-form input:focus { border-color: var(--primary); }

.btn-add-small {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit; white-space: nowrap;
}
.btn-add-small:hover { box-shadow: var(--shadow-sm); }

.instellingen-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none; align-items: center; justify-content: center;
    z-index: 10; padding: 20px;
}
.instellingen-modal.active { display: flex; }
.instellingen-modal .modal { max-width: 420px; }

.confirm-text { font-size: 14px; color: var(--text-dark); line-height: 1.6; margin-bottom: 8px; }
.confirm-text strong { color: var(--secondary); }

.btn-danger {
    padding: 10px 20px; background: var(--secondary); color: white;
    border: none; border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-family: inherit;
}
.btn-danger:hover { opacity: 0.9; box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3); }

@media (max-width: 700px) {
    .instellingen-container {
        width: 100vw; height: 100vh;
        max-width: none; max-height: none; border-radius: 0;
    }
    .instellingen-body { flex-direction: column; }
    .instellingen-sidebar {
        width: 100%; border-right: none;
        border-bottom: 1px solid #F0F0F5;
        padding: 8px 0; display: flex; overflow-x: auto; flex-shrink: 0;
    }
    .instellingen-nav-item { padding: 10px 16px; white-space: nowrap; border-right: none; }
    .instellingen-nav-item.active { border-right: none; border-bottom: 3px solid var(--primary); }
    .instellingen-content { padding: 20px 16px; }
    .klas-toolbar { flex-direction: column; align-items: stretch; }
    .leerling-actions { opacity: 1; }
}

/* ---------- Inline form errors ---------- */
.inline-form-error {
    display: none;
    color: #D63031;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #FFF0F0;
    border-radius: 8px;
    border: 1px solid #FFCCCC;
}

/* ---------- Schooljaar ---------- */
.sj-hint {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
    margin: 4px 0 0;
}

.sj-vacation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0 16px;
}

.sj-vacation-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--bg-light, #F3F4F8);
    border-radius: 12px;
}

.sj-vacation-row .sj-vac-name {
    flex: 1 1 180px;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid #E0E0EA;
    border-radius: 8px;
    font-size: 14px;
}

.sj-vac-dates {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sj-vac-dates label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-medium);
}

.sj-vac-dates input[type="date"] {
    padding: 7px 10px;
    border: 1px solid #E0E0EA;
    border-radius: 8px;
    font-size: 14px;
}

.sj-vac-del {
    margin-left: auto;
}

@media (max-width: 600px) {
    .sj-vacation-row { align-items: stretch; }
    .sj-vac-dates { flex-direction: column; gap: 8px; }
    .sj-vac-del { margin-left: 0; }
}
