:root {
    --accent: #154273;
    --accent-deep: #0d2d4f;
    --accent-soft: #e8eef5;
    --signal: #e27000;
    --signal-deep: #c45f00;
    --signal-soft: #fff1e2;
    --green: #39870c;
    --green-soft: #e8f3de;
    --red: #ca3f3f;
    --red-soft: #fdeaea;
    --bg: #f2f4f7;
    --bg-card: #ffffff;
    --bg-tint: #f3f6fa;
    --border: #dbe2ea;
    --text: #1c2530;
    --text-secondary: #5b6a7a;
    --radius: 16px;
    --radius-sm: 11px;
    --grad-accent: linear-gradient(135deg, #1d5aa0 0%, #123c6e 100%);
    --grad-ink: linear-gradient(170deg, #1a4e86 0%, #0d2d4f 100%);
    --shadow-sm: 0 2px 6px rgba(21, 66, 115, 0.08), 0 1px 2px rgba(21, 66, 115, 0.06);
    --shadow-md: 0 8px 24px rgba(21, 66, 115, 0.13);
    --shadow-lg: 0 18px 60px rgba(13, 45, 79, 0.28);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif; letter-spacing: -0.01em; }

.hidden { display: none !important; }
.flex-spacer { flex: 1; }

.screen { min-height: 100vh; }

#screen-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-ink);
    position: relative;
    overflow: hidden;
}
#screen-auth::before {
    content: '';
    position: absolute;
    width: 720px; height: 720px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90, 150, 220, 0.25) 0%, transparent 65%);
    top: -260px; right: -180px;
}
#screen-auth::after {
    content: '';
    position: absolute;
    width: 560px; height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(226, 112, 0, 0.16) 0%, transparent 65%);
    bottom: -220px; left: -160px;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 410px;
    margin: 20px;
    animation: rise 0.45s var(--ease);
}
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo h1 { font-size: 21px; margin-top: 14px; color: var(--accent); }
.auth-sub { color: var(--text-secondary); font-size: 12px; margin-top: 5px; }

.auth-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px; height: 66px;
    border-radius: 18px;
    background: var(--grad-accent);
    color: #fff;
    font-weight: 800;
    font-size: 21px;
    letter-spacing: 1px;
    box-shadow: 0 8px 22px rgba(21, 66, 115, 0.35);
}
.auth-logo-badge.small { width: 40px; height: 40px; font-size: 14px; border-radius: 11px; flex: none; box-shadow: none; }

form h2 { font-size: 16px; margin-bottom: 8px; color: var(--accent); }
.form-hint { color: var(--text-secondary); font-size: 12px; margin-bottom: 16px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 14px; text-align: center; }

label { display: block; margin-bottom: 15px; font-weight: 600; font-size: 13px; color: var(--text); }
input, select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 400;
    background: #fbfcfe;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(21, 66, 115, 0.14);
}
textarea { resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-inline input { width: auto; margin: 0; accent-color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s, filter 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(21, 66, 115, 0.30);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 7px 20px rgba(21, 66, 115, 0.40); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); }
.btn-secondary:hover { background: #d8e3ef; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-big { padding: 17px; font-size: 16px; margin-bottom: 22px; border-radius: 20px; }
.btn-sm { padding: 6px 13px; font-size: 12px; }

.classes-wrap { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.classes-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.classes-header h1 { color: var(--accent); font-size: 26px; font-weight: 800; }
.classes-header-right { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); }

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.class-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.class-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--grad-accent);
}
.class-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.classes-grid.reorderable .class-card { cursor: grab; }
.classes-grid.reorderable .class-card:active { cursor: grabbing; }
.class-card-dragging {
    cursor: grabbing;
    z-index: 900;
    pointer-events: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
    transform-origin: center;
    opacity: .96;
}
.class-card-dragging:hover { transform: none; }
.class-card-placeholder {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(127, 127, 127, .06);
}
body.reordering { user-select: none; -webkit-user-select: none; }
.class-card-locked { cursor: default; opacity: .8; }
.class-card-locked:hover { transform: none; box-shadow: none; }
.class-card-pending { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 8px; }
.class-card-denied { color: var(--red); font-size: 12px; font-weight: 600; margin-top: 8px; }
.class-denied-x { border: none; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px; padding: 1px 5px; border-radius: 999px; }
.class-denied-x:hover { background: var(--red); color: #fff; }
.class-card-request { margin-top: 8px; }
.classes-online-panel { margin-bottom: 20px; }
.classes-online-panel h3 { margin: 0 0 10px; font-size: 15px; }
.classes-online-list { display: flex; flex-wrap: wrap; gap: 8px; }
.online-person {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 14px 5px 6px; border: 1px solid var(--border); border-radius: 999px;
    background: #fff; font-size: 13px; font-weight: 600;
}
.online-person-self { background: var(--bg-tint); }
.online-person-jij { color: var(--text-secondary); font-weight: 400; }
.online-person-avatar {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700;
}
.online-person-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
    animation: online-pulse 2s ease-in-out infinite;
}
@keyframes online-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--green-soft); }
    50% { box-shadow: 0 0 0 5px var(--green-soft); }
}

#class-requests-panel { margin-bottom: 20px; }
#class-requests-panel h3 { margin: 0 0 10px; font-size: 15px; }
.class-request-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; background: #fff; }
.class-request-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.class-request-date { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.class-request-msg { margin-top: 8px; padding: 8px 12px; background: var(--bg-tint); border-radius: var(--radius-sm); font-size: 13px; }
.class-request-note { width: 100%; margin-top: 8px; }
.class-request-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.class-req-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.class-card h3 { color: var(--accent); margin-bottom: 6px; font-size: 16px; }
.class-card p { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

#screen-app { display: flex; flex-direction: column; }

.sidebar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 24px);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 8px 12px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow-x: auto;
}
.sidebar-logo { display: none; }

.nav { display: flex; gap: 2px; }
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 15px;
    background: none;
    border: none;
    border-radius: 18px;
    color: var(--text-secondary);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--accent-soft); color: var(--accent); }
.nav-item.active {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(21, 66, 115, 0.40);
}
.nav-item.active .nav-txt, .nav-item.active .nav-ico { color: #fff; }
.nav-item:disabled { opacity: 0.32; cursor: not-allowed; }
.nav-ico { font-size: 19px; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: 0 0 auto; }
.nav-ico .ic { width: 19px; height: 19px; }
.chip-avatar .ic { width: 15px; height: 15px; }
.koplava-ico .ic, .role-badge .ic { width: 13px; height: 13px; }
.toast-ico { display: inline-block; margin-right: 7px; vertical-align: -0.125em; }
.koplava-col-head .ic { width: 14px; height: 14px; }
h3 > .ico .ic { width: 17px; height: 17px; vertical-align: -0.16em; }
.live-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
    vertical-align: 0.02em; margin-right: 5px;
}
.nav-txt { text-align: center; }
.nav-divider { width: 1px; height: 30px; margin: 0 4px; align-self: center; background: var(--border); }

.main {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 30px clamp(16px, 5vw, 56px) 120px;
    min-width: 0;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar h2 { color: var(--accent); font-size: 27px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.sync-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--green); font-weight: 600;
    background: var(--green-soft);
    padding: 6px 12px;
    border-radius: 20px;
}
.sync-badge.offline { color: var(--red); background: var(--red-soft); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2.4s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.presence-stack { display: flex; align-items: center; }
.presence-stack:empty { display: none; }
.presence-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; margin-left: -6px; border-radius: 50%;
    color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .3px;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
    text-transform: uppercase; cursor: default;
}
.presence-chip:first-child { margin-left: 0; }
.presence-chip.afk { opacity: .4; filter: grayscale(.6); }
.presence-chip.pulse { animation: chip-pulse 1.6s ease-in-out infinite; }
@keyframes chip-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
    50% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(21, 66, 115, .22), 0 1px 3px rgba(0,0,0,.25); }
}


.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}
.card h3 { color: var(--accent); font-size: 15px; margin-bottom: 14px; }
.card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.card-header h3 { margin: 0; }
.card-header-right { display: flex; gap: 10px; align-items: center; }
.card-header-right input, .card-header-right select { margin: 0; width: auto; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    border-radius: var(--radius);
    padding: 22px;
    background: linear-gradient(135deg, #e8eef5, #d9e5f2);
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.green { background: linear-gradient(135deg, #e8f3de, #d6ebc3); }
.stat-card.orange { background: linear-gradient(135deg, #ffeede, #ffdfc2); }
.stat-card.blue { background: linear-gradient(135deg, #e2f0ff, #cfe4fb); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.stat-value { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.orange .stat-value { color: var(--signal-deep); }
.stat-card.blue .stat-value { color: #1e6fd9; }

.table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.table td { padding: 11px 12px; vertical-align: middle; }
.table tbody tr { background: var(--bg-tint); }
.table tbody tr:hover td { background: var(--accent-soft); }
.table td:first-child { border-radius: 12px 0 0 12px; }
.table td:last-child { border-radius: 0 12px 12px 0; }

.avatar, .avatar-placeholder {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-soft), #d0deed);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}
.avatar-lg { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-md); }
.student-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}
.status-pill.actief { background: var(--green-soft); color: var(--green); }
.status-pill.gestopt { background: var(--red-soft); color: var(--red); }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    border: 1px solid #c2d4e9;
    border-radius: 14px;
    padding: 15px 18px;
    cursor: pointer;
    background: #dbe7f5;
    transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s;
}
.list-item:hover { background: #cfdff1; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.student-cards { display: flex; flex-direction: column; gap: 10px; }
.student-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #dbe7f5;
    border: 1px solid #c2d4e9;
    border-left: 5px solid var(--accent);
    border-radius: 14px;
    padding: 13px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.student-card:hover { border-color: var(--accent); background: #fff; box-shadow: var(--shadow-sm); }
.mutation-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f2b8b5;
    border-radius: 999px;
    padding: 2px 11px;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}
.mutation-file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.mutation-file-link:hover { text-decoration: underline; }
#btn-overview-print { background: var(--signal); color: #fff; border: none; }
#btn-overview-print:hover { filter: brightness(1.1); }
img.student-card-avatar, img.overview-avatar, #student-photo-preview { cursor: zoom-in; }
#progress-student-search { margin-bottom: 10px; }
.stat-click { cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s; }
.stat-click:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-item > .ic, .tl-item > .ic-emo { flex: 0 0 auto; margin-top: 3px; color: var(--accent); }
.tl-body { min-width: 0; }
.tl-date { color: var(--text-secondary); font-size: 12px; margin-right: 6px; }
.tl-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
#students-status-filter, #students-sort { width: auto; margin-top: 0; padding: 8px 10px; font-size: 13px; }
.count-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.count-chip .ic { width: 11px; height: 11px; }
.count-chip-vp { color: var(--signal-deep); border-color: var(--signal); background: var(--signal-soft); }
.schrijfhulp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.schrijfhulp-row .schrijfhulp-label { margin-bottom: 0; }
.schrijfhulp-panel {
    background: var(--bg-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.sh-groep { margin-bottom: 10px; }
.sh-groep:last-child { margin-bottom: 0; }
.sh-groep-titel { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.sh-chip:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.vp-comp-chip.vp-sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.schrijfhulp-btns { display: inline-flex; gap: 6px; }
.draft-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    border-radius: 8px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
    margin-left: 4px;
}
.student-card-avatar { width: 46px; height: 46px; flex: 0 0 auto; font-size: 15px; }
.student-card .avatar-placeholder { background: var(--grad-accent); color: #fff; }
.student-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.student-card-name { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.student-card-nr {
    background: var(--accent); color: #fff;
    border-radius: 999px; padding: 1px 10px;
    font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.student-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.student-card-birth { display: inline-flex; align-items: center; gap: 5px; }
.student-card-actions { flex: 0 0 auto; }
.student-card .student-role-badges { margin-top: 2px; }
.list-item-header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.list-item-title { font-weight: 700; color: var(--accent); }
.list-item-meta { font-size: 11px; color: var(--text-secondary); }
.list-item-body { font-size: 13px; white-space: pre-wrap; color: var(--text); max-height: 80px; overflow: hidden; line-height: 1.5; }
.draft-pill { background: var(--signal-soft); color: var(--signal-deep); padding: 2px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.empty { color: var(--text-secondary); text-align: center; padding: 28px; font-size: 13px; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 15px;
    background: #fbfcfe;
}
.checkbox-grid label { display: flex; align-items: center; gap: 7px; font-weight: 400; margin: 0; font-size: 13px; }
.checkbox-grid input { width: auto; margin: 0; accent-color: var(--accent); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 38, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: var(--bg-card);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: none;
    flex-direction: column;
    animation: modal-in 0.22s var(--ease);
    overflow: hidden;
}
.modal.open { display: flex; }
@keyframes modal-in {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 22px;
    background: var(--grad-ink);
    color: #fff;
}
.modal-header h3 { font-size: 15px; }
.modal-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; opacity: 0.8; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.avg-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.avg-list li { position: relative; padding-left: 22px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.avg-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; }
.avg-list li strong { color: var(--text); }
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 22px;
    border-top: 1px solid var(--border);
    background: #fafbfd;
}

#toast-container {
    position: fixed;
    bottom: 90px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}
.toast {
    background: var(--accent);
    color: #fff;
    padding: 13px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 600;
    animation: toast-in 0.25s var(--ease);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.competency-name { font-weight: 700; font-size: 13px; }
.competency-remarks { font-size: 12px; color: var(--text-secondary); white-space: pre-wrap; }


.topbar-birthday {
    background: var(--signal-soft);
    color: var(--signal-deep);
    border: 1.5px solid var(--signal);
    border-radius: 20px;
    padding: 7px 14px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
    transition: background 0.15s, color 0.15s;
}
.topbar-birthday:hover { background: var(--signal); color: #fff; }

.birthday-month {
    font-size: 12px;
    text-transform: capitalize;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    margin: 18px 4px 8px;
}
.birthday-month:first-child { margin-top: 0; }
.birthday-row {
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto auto minmax(110px, auto);
    align-items: center;
    gap: 14px;
    background: #dbe7f5;
    border: 1px solid #c2d4e9;
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 8px;
}
.birthday-name { font-weight: 700; font-size: 13px; }
.birthday-date { font-size: 12px; color: var(--text-secondary); }
.birthday-age { font-size: 12px; color: var(--text-secondary); }
.birthday-days { font-size: 12px; font-weight: 700; color: var(--accent); text-align: right; }
.birthday-today {
    background: var(--signal-soft);
    box-shadow: inset 4px 0 0 var(--signal);
}
.birthday-today .birthday-name { color: var(--signal-deep); }
.birthday-today .birthday-days { color: var(--signal-deep); }

.class-card-gear {
    position: absolute;
    top: 10px; right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    padding: 5px;
    border-radius: 9px;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, background 0.15s;
}
.class-card-gear:hover { opacity: 1; background: var(--accent-soft); }
.class-card-kader {
    margin-top: 10px;
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 10px;
    row-gap: 6px;
    align-items: baseline;
}
.kader-functie {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: .75;
    white-space: nowrap;
}
.kader-namen { font-size: 12px; line-height: 1.5; color: var(--text); }

.form-section-label { font-weight: 700; font-size: 13px; margin: 18px 0 8px; }
.check-row {
    display: flex !important; flex-direction: row !important; align-items: center; gap: 9px;
    padding: 6px 0; cursor: pointer; font-weight: 500; font-size: 14px;
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check-dates {
    margin: 2px 0 8px 27px;
    padding: 8px 12px;
    background: var(--bg-tint);
    border-radius: var(--radius-sm);
}
.student-role-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.role-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff;
}
.role-badge.ko { background: #1565c0; }
.role-badge.plava { background: #5e35b1; }
.role-badge.sport { background: #e65100; }
.role-badge.spoco { background: #2e7d32; }
.role-badge.plv-spoco { background: #558b2f; }
.role-badge.zwemles { background: #0277bd; }
.expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    vertical-align: middle;
}
.expiry-badge.exp-warn { background: #e27000; }
.expiry-badge.exp-danger { background: #c62828; }
.expiry-badge .ic { width: 11px; height: 11px; }
.role-badge.niveau { background: var(--accent); color: #fff; }
.role-badge.functie { background: #5a6c85; color: #fff; }
.role-badge.cluster { background: #00897b; color: #fff; }
.koplava-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.koplava-col-head { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.koplava-col-head.ko { color: #1565c0; }
.koplava-col-head.plava { color: #5e35b1; }
.koplava-col-head.rest { color: var(--text-secondary); }
.koplava-col-head.sport { color: #e65100; }
.koplava-col-head.zwem { color: #0277bd; }
.koplava-ico.zwem { background: #0277bd; }
.koplava-col-list { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 190px; overflow-y: auto; background: #fff; }
.koplava-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.koplava-row:last-child { border-bottom: none; }
.koplava-row:hover { background: var(--bg-tint); }
.koplava-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.koplava-meta { margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--text-secondary); }
.koplava-ico {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 8px; font-size: 11px; color: #fff;
}
.koplava-ico.ko { background: #1565c0; }
.koplava-ico.plava { background: #5e35b1; }
.koplava-ico.sport { background: #e65100; }
.koplava-ico.rest { background: #9e9e9e; }
.koplava-empty { padding: 10px; font-size: 12px; color: var(--text-secondary); text-align: center; }

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tint);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.member-name { font-weight: 600; font-size: 13px; white-space: nowrap; }
.member-email { flex: 1; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.member-add-row { display: flex; gap: 8px; margin-top: 10px; }
.member-add-row input { margin-top: 0; flex: 1; }
.member-add-row select { margin-top: 0; }
.member-hint { font-size: 12px; color: var(--text-secondary); margin: 4px 0 10px; }
.member-role-select { font-size: 12px; padding: 4px 6px; }
.member-role-badge {
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.member-role-badge.owner { background: #fde9d3; color: #b45309; }

.class-card-role {
    display: inline-block; vertical-align: middle; margin-left: 8px;
    font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 999px; background: var(--bg-tint); color: var(--text-secondary);
}
.class-card-role.owner { background: #fde9d3; color: #b45309; }
.class-card-role.admin { background: #dbeafe; color: #1d4ed8; }
.class-card-role.viewer { background: var(--bg-tint); color: var(--text-secondary); }

.readonly-banner {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 0 4px; padding: 10px 16px;
    background: #fef3c7; color: #92400e; font-size: 13px; font-weight: 600;
    border-bottom: 1px solid #fcd34d;
}
.readonly-banner .btn, .readonly-banner-pending { margin-left: auto; }
.class-card-upgrade { margin-top: 8px; }
body.readonly #btn-new-student,
body.readonly #btn-new-progress,
body.readonly #btn-quick-note,
body.readonly #btn-new-conversation,
body.readonly #btn-add-mutation,
body.readonly #btn-upload-document,
body.readonly #students-cards .btn,
body.readonly .doc-actions,
body.readonly #btn-overview-edit,
body.readonly #btn-edit-progress-detail,
body.readonly #btn-delete-conversation,
body.readonly #btn-edit-conversation,
body.readonly #btn-close-conversation,
body.readonly #btn-new-agreement,
body.readonly .agreement-actions,
body.readonly #btn-doc-categories { display: none !important; }
body.readonly .category-chip button, body.readonly .student-pick { pointer-events: none; }

.label-hint { font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.comp-pick-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; margin-bottom: 6px; }
.comp-pick { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--bg-tint); font-size: 13px; font-weight: 600; user-select: none; transition: border-color .15s, background .15s, color .15s; }
.comp-pick:hover { border-color: var(--accent); }
.comp-pick input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.comp-pick-check { display: none; font-weight: 800; }
.comp-pick:has(input:checked) { border-color: var(--accent); background: var(--accent); color: #fff; }
.comp-pick:has(input:checked) .comp-pick-check { display: inline; }
.progress-comp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comp-tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }

.date-row { display: flex; gap: 12px; }
.date-row label { flex: 1; }
.class-card-cat {
    display: inline-block; margin-bottom: 6px;
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
}
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.category-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-tint); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 6px 5px 13px; font-size: 13px; font-weight: 600;
}
.category-chip button {
    border: none; background: transparent; color: var(--text-secondary); cursor: pointer;
    font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 999px;
}
.category-chip button:hover { background: var(--danger, #dc2626); color: #fff; }
.comp-chip-kpi { border-color: #f0b429; background: #fff8e6; }
.comp-kpi-toggle { font-size: 14px; }
.comp-kpi-toggle:hover { background: transparent !important; color: inherit !important; transform: scale(1.15); }
.comp-tag-kpi { background: #fdecc8; color: #a16207; }
.comp-pick-kpi { border-color: #f0b429; }
.comp-pick-kpi:has(input:checked) { border-color: #d69e2e; background: #d69e2e; }

#progress-students-checkboxes { margin-top: 6px; }
.student-pick {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 13px 5px 5px; border: 1.5px solid var(--border); border-radius: 999px;
    cursor: pointer; background: var(--bg-tint); transition: border-color .15s, background .15s, color .15s;
    font-size: 13px; font-weight: 600; user-select: none;
}
.student-pick:hover { border-color: var(--accent); }
.student-pick input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.student-pick-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.student-pick-av.fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.student-pick-num { color: var(--text-secondary); font-weight: 400; }
.student-pick-check { display: none; font-weight: 800; }
.student-pick:has(input:checked) { border-color: var(--accent); background: var(--accent); color: #fff; }
.student-pick:has(input:checked) .student-pick-num { color: rgba(255,255,255,.8); }
.student-pick:has(input:checked) .student-pick-av.fallback { background: rgba(255,255,255,.25); color: #fff; }
.student-pick:has(input:checked) .student-pick-check { display: inline; }

.modal-overview { max-width: 640px; }
.overview-header { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.overview-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.overview-avatar.fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--grad-accent); color: #fff; font-weight: 800; font-size: 22px; }
.overview-name { font-size: 20px; font-weight: 800; }
.overview-meta { color: var(--text-secondary); font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.overview-remarks { margin-top: 6px; font-size: 13px; color: var(--text-secondary); font-style: italic; }
.overview-section { margin-top: 16px; }
.overview-section-head { font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.overview-count { background: var(--bg-tint); color: var(--text-secondary); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.overview-item { background: var(--bg-tint); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.overview-item .overview-sub { color: var(--text-secondary); font-weight: 400; font-size: 12px; margin-left: 6px; }
.overview-text { color: var(--text-secondary); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.overview-empty { color: var(--text-secondary); font-size: 13px; margin: 0; }
.overview-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.overview-chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; }

.search-wrap { margin-bottom: 20px; }
#global-search {
    margin-top: 0;
    padding: 13px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
#global-search-results {
    margin-top: 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-md);
    gap: 6px;
}
.search-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 8px 4px 2px;
}
.search-group-label:first-child { margin-top: 0; }

.file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.file-chips:empty { margin-bottom: 0; }
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    max-width: 100%;
}
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 2px;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}
.file-chip button:hover { opacity: 1; color: var(--red); }
.file-btn-row { margin-bottom: 15px; }

.detail-meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin-bottom: 16px; align-items: center; }
.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-secondary);
}
.detail-content {
    background: var(--bg-tint);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 4px;
}
.attachment-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.attachment-thumb {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
    transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.attachment-thumb:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }
.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tint);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: background 0.15s;
}
.attachment-link:hover { background: var(--accent-soft); }

#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5, 14, 27, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 300;
    cursor: zoom-out;
    animation: lightbox-in 0.18s var(--ease);
}
#lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
@keyframes lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-alert { border-left: 4px solid var(--red); }

.mutation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tint);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.mutation-text { flex: 1; font-size: 13px; font-weight: 600; }
.mutation-period { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
#student-mutations-section .btn { margin-top: 4px; }

.doc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.doc-chip {
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 6px 14px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.doc-chip:hover { border-color: var(--accent); color: var(--accent); }
.doc-chip.active { background: var(--grad-accent); border-color: transparent; color: #fff; }
.doc-chip-count { opacity: 0.7; font-weight: 600; }
.doc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--bg-tint);
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.doc-row:hover { background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.doc-row.doc-pinned { box-shadow: inset 4px 0 0 var(--accent); }
.doc-ico { font-size: 20px; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 700; font-size: 13px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.doc-cat-pill {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    padding: 1px 8px;
    font-weight: 700;
}
.doc-actions { display: flex; gap: 6px; }

.agreement-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-tint);
    border-radius: 14px;
    padding: 14px 18px;
}
.agreement-main { flex: 1; min-width: 0; }
.agreement-text { font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.agreement-meta { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.agreement-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 560px) {
    .agreement-row { flex-direction: column; }
    .agreement-actions { align-self: flex-end; }
}
.doc-upload-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    background: var(--bg-tint);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.doc-upload-row select { margin: 0; width: auto; }
.doc-upload-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-cat-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.doc-cat-row input { margin-top: 0; }
#doc-categories-list { margin-bottom: 10px; }
#modal-doc-preview { max-width: 880px; }
a.btn { text-decoration: none; }
.doc-preview-body { padding: 0; display: flex; }
#doc-preview-frame { border: none; width: 100%; height: 70vh; background: #fff; }

.modal-wide { max-width: 720px; }
.nav-item { position: relative; }
.nav-badge {
    position: absolute;
    top: 3px; right: 7px;
    min-width: 17px; height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--signal);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(226, 112, 0, 0.45);
}
.type-pill {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}
.type-pill.verbeterperiode { background: var(--signal-soft); color: var(--signal-deep); }
.status-pill.open { background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.status-pill.positief { background: var(--green-soft); color: var(--green); margin-left: 6px; }
.status-pill.negatief { background: var(--red-soft); color: var(--red); margin-left: 6px; }
.deadline-pill {
    display: inline-block;
    border-radius: 8px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}
.deadline-pill.warn { background: var(--signal-soft); color: var(--signal-deep); }
.deadline-pill.over { background: var(--red-soft); color: var(--red); }
.conv-enddate { font-size: 11px; color: var(--text-secondary); font-weight: 600; margin-left: 6px; }
.opleider-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.opleider-row input { margin-top: 0; }

.conv-opleiders { display: flex; flex-wrap: wrap; gap: 8px; }
.conversation-detail-footer { flex-wrap: wrap; }

#print-area { display: none; }
@media print {
    @page { size: A4; margin: 0; }
    body { background: #fff; }
    body > :not(#print-area) { display: none !important; }
    #print-area { display: block !important; color: #000; }
    #print-area .print-sheet { width: 100%; border-collapse: collapse; }
    #print-area .print-sheet > thead td, #print-area .print-sheet > tfoot td { height: 13mm; padding: 0; border: none; }
    #print-area .print-sheet > tbody > tr > td { padding: 0 15mm; vertical-align: top; border: none; }
    #print-area h1 { font-size: 20px; color: #154273; margin-bottom: 2px; }
    #print-area h2 { font-size: 13px; color: #154273; margin: 16px 0 5px; }
    #print-area .report-head p { color: #444; font-size: 11px; margin-bottom: 12px; }
    #print-area .report-meta { border-collapse: collapse; margin-bottom: 6px; }
    #print-area .report-meta td { padding: 2px 16px 2px 0; font-size: 12px; vertical-align: top; }
    #print-area .report-meta td:first-child { font-weight: 700; }
    #print-area .report-text { font-size: 12px; line-height: 1.55; }
    #print-area .report-sigs td { padding: 4px 24px 0 0; font-size: 12px; font-weight: 700; vertical-align: top; }
    #print-area .report-sigs img { border: 1px solid #ccc; border-radius: 6px; margin-top: 3px; }
}

.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill.inactief { background: var(--red-soft); color: var(--red); }
.status-pill.gepland { background: var(--accent-soft); color: var(--accent); }
.stat-value.stat-value-sm { font-size: 20px; padding-top: 9px; }
.audit-wrap { max-height: 460px; overflow-y: auto; }
.audit-size { font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--surface-alt, #eef2f8); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: middle; }
.audit-size:empty { display: none; }
.audit-table td {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 11px;
    word-break: break-all;
}
@media print {
    #print-area .report-list { border-collapse: collapse; width: 100%; margin-bottom: 8px; }
    #print-area .report-list th {
        text-align: left;
        font-size: 11px;
        border-bottom: 1.5px solid #888;
        padding: 3px 12px 3px 0;
    }
    #print-area .report-list td {
        font-size: 12px;
        border-bottom: 1px solid #ddd;
        padding: 3px 12px 3px 0;
        vertical-align: top;
    }
    #print-area .report-text em { font-style: normal; font-weight: 700; }
}

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 5px 14px 5px 6px;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.user-chip:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.chip-name { line-height: 1; }

.chip-avatar, .account-avatar {
    object-fit: cover;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chip-avatar { width: 28px; height: 28px; font-size: 15px; }
.account-avatar { width: 84px; height: 84px; font-size: 30px; border: 3px solid #fff; box-shadow: var(--shadow-md); }
.avatar-fallback { background: var(--grad-accent); color: #fff; font-weight: 800; }

.account-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.account-photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.account-central-hint { font-size: 12px; line-height: 1.5; margin: 0; }

.account-info {
    background: var(--bg-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 14px;
    margin-bottom: 16px;
}
.account-info-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--border);
}
.account-info-row:last-child { border-bottom: none; }
.account-info-label { color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.account-info-value { font-size: 13px; font-weight: 600; word-break: break-word; text-align: right; }

.muted { color: var(--text-secondary); }
.auth-hint { text-align: center; margin-top: 12px; }

@media (max-width: 760px) {
    .sidebar { bottom: 10px; padding: 6px 8px; border-radius: 20px; }
    .nav-divider { display: none; }
    .topbar h2 { font-size: 22px; }
    .classes-wrap { padding: 16px 12px; }
    .classes-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .classes-header h1 { font-size: 22px; }
    .classes-header-right { flex-wrap: wrap; gap: 6px; }
    .classes-grid { grid-template-columns: 1fr; }
    .main { padding: 16px 12px 130px; }
    .topbar { flex-wrap: wrap; gap: 8px; }
    .topbar-right { flex-wrap: wrap; gap: 6px; }
    .nav { max-width: calc(100vw - 16px); overflow-x: auto; }
    .nav-txt { display: none; }
    .nav-item { padding: 9px 10px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .modal-overlay { padding: 8px; align-items: flex-start; }
    .modal { max-width: 100%; }
    input, select, textarea { font-size: 16px !important; }
    .btn { min-height: 40px; }
    .card { padding: 14px; }
    .tab table, .card table { display: block; overflow-x: auto; white-space: nowrap; }
    .member-row { flex-wrap: wrap; }
    .class-request-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .checkbox-grid { grid-template-columns: 1fr 1fr; }
    .overview-header { flex-wrap: wrap; }
    .edit-btn-txt { display: none; }
    .student-card { flex-wrap: wrap; }
    .student-card-actions { margin-left: auto; }
}

.modal-header.danger { background: var(--red); }
#confirm-text { line-height: 1.6; }
#admin-comp-class { max-width: 340px; }

.storage-full-banner { background: #c0392b; color: #fff; text-align: center; padding: 10px 16px; font-size: 13px; font-weight: 700; position: sticky; top: 0; z-index: 400; }

input[hidden] { display: none !important; }

.file-chip-size { color: var(--text-secondary); font-size: 11px; font-weight: 600; white-space: nowrap; }
.attachment-thumb-wrap { display: inline-flex; flex-direction: column; gap: 3px; align-items: center; max-width: 120px; }
.attachment-caption { font-size: 10px; color: var(--text-secondary); text-align: center; word-break: break-all; line-height: 1.3; }

.compress-preview { display: block; max-width: 100%; max-height: 220px; margin: 0 auto 14px; border-radius: 12px; box-shadow: var(--shadow-md); }
.compress-sizes { display: flex; align-items: stretch; gap: 10px; margin-bottom: 16px; }
.compress-size-box {
    flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center;
    background: var(--bg-tint); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px;
}
.compress-size-new { background: var(--green-soft); border-color: var(--green); }
.compress-size-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.compress-size-value { font-size: 16px; font-weight: 800; color: var(--text); }
.compress-arrow { align-self: center; font-size: 20px; color: var(--text-secondary); }
#compress-quality { accent-color: var(--accent); padding: 0; border: none; background: transparent; height: 32px; }

#online-users { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    #online-users { max-width: 150px; }
}
.overview-click { cursor: pointer; border-radius: 10px; transition: background .12s; }
.overview-click:hover { background: var(--bg-tint); }
.report-view { position: fixed; inset: 0; z-index: 500; background: #fff; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.report-view-bar { display: flex; justify-content: flex-end; gap: 8px; position: sticky; top: 0; background: #fff; padding: 4px 0 10px; z-index: 2; }

input[type=date], input[type=time], input[type=datetime-local] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
input::-webkit-date-and-time-value { text-align: left; }

@media (max-width: 760px) {
    input[type=date], input[type=time], input[type=datetime-local] { min-width: 0; width: 100%; min-height: 44px; }
    .date-row { flex-direction: column; }
    .date-row label, .form-row label { min-width: 0; }
    .member-add-row { flex-wrap: wrap; }
    .member-add-row select { min-width: 0; flex: 1 1 140px; }
    .modal-body, .modal { overflow-x: hidden; }
    .modal { max-height: 92vh; max-height: 92dvh; }
    .modal-body { -webkit-overflow-scrolling: touch; }
    .card-header { flex-wrap: wrap; }
    .card-header-right { flex-wrap: wrap; gap: 6px; }
    .birthday-row { grid-template-columns: 1fr auto auto; row-gap: 2px; padding: 10px 14px; }
    .birthday-name { grid-column: 1 / -1; }
    .birthday-days { white-space: nowrap; justify-self: end; }
    #tab-admin table { font-size: 12px; }
    .admin-user-actions { flex-wrap: wrap; }
}

@media (display-mode: standalone) {
    #screen-auth::before, #screen-auth::after { display: none; }
    .nav { gap: 4px; }
    .nav-item { padding: 11px 14px; }
    .nav-ico { font-size: 23px; }
}

@media (max-width: 760px) {
    .modal-body { padding: 16px 14px; }
    input[type=date], input[type=time], input[type=datetime-local] { max-width: 100%; }
}
@media (display-mode: standalone) {
    html, body { overscroll-behavior-y: none; }
    .sidebar { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .nav-item:hover:not(.active) { background: transparent; color: var(--text-secondary); }
}

.online-person, .presence-chip { cursor: pointer; }
.online-person:hover { border-color: var(--accent); }
.presence-chip:hover { filter: brightness(1.15); }
.uprof-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.uprof-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.uprof-name { font-weight: 800; font-size: 17px; }
.uprof-tags { display: flex; gap: 8px; margin-top: 5px; align-items: center; flex-wrap: wrap; }
.uprof-status { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.uprof-table { border-collapse: collapse; width: 100%; }
.uprof-table td { padding: 7px 14px 7px 0; font-size: 13px; vertical-align: top; border-bottom: 1px solid var(--border); }
.uprof-table tr:last-child td { border-bottom: none; }
.uprof-table td:first-child { font-weight: 700; width: 130px; color: var(--text-secondary); }

.tpl-row { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; background: #fbfcfe; }
.tpl-row-head { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.tpl-row-head input { flex: 1; margin: 0; }
.tpl-del { flex-shrink: 0; color: var(--red); }
.tpl-row textarea { min-height: 64px; margin: 0; }
#btn-template-add { margin-bottom: 16px; }
#account-templates:empty::before { content: 'Nog geen eigen templates.'; display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 10px; }
