/*
 * Huisstijl Koninklijke Harmonie Ster van Maastricht: rood beeldmerk, bijna-zwarte
 * zijbalk zoals de header van stervanmaastricht.nl, Open Sans.
 * Alle kleuren staan als variabelen hieronder; de donkere variant volgt de systeeminstelling.
 */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("../fonts/open-sans-latin-30nvAOJ.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url("../fonts/open-sans-latin-ext-5HI45_X.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f3f3f2;
    --surface: #ffffff;
    --line: #dededb;
    --fg: #232323;
    --muted: #5f5f5c;
    --brand: #ff0d0f;          /* huiskleur van de website, alleen voor accenten */
    --accent: #c8102e;         /* diepere tint voor knoppen en links (leesbaar met wit) */
    --accent-fg: #ffffff;
    --accent-soft: #fbe5e7;
    --side: #232323;
    --side-fg: #c4c4c0;
    --side-active: #ffffff;
    --ok: #1f7a46;
    --ok-soft: #e0f1e6;
    --warn: #9a5b00;
    --warn-soft: #fbefd8;
    --bad: #7d1f2a;
    --bad-soft: #f3e1e3;
    --neutral: #5c5f63;
    --neutral-soft: #e9eaea;
    --font: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161616;
        --surface: #1f1f1f;
        --line: #343432;
        --fg: #ececea;
        --muted: #a3a39f;
        --brand: #ff3b3d;
        --accent: #ff4d55;
        --accent-fg: #1a0a0b;
        --accent-soft: #3a1a1d;
        --side: #0f0f0f;
        --side-fg: #a8a8a4;
        --ok: #5cc48a;
        --ok-soft: #163222;
        --warn: #e3aa4c;
        --warn-soft: #34270e;
        --bad: #e88a93;
        --bad-soft: #3a1d21;
        --neutral: #a9adb1;
        --neutral-soft: #2a2c2e;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; }
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App-indeling: zijbalk + inhoud */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { background: var(--side); color: var(--side-fg); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--side-active); font-weight: 600; padding: 0 8px 16px; text-decoration: none; }
.brand img { flex: none; width: 36px; height: 36px; }
.brand span { display: grid; line-height: 1.2; }
.brand small { font-weight: 400; font-size: 0.72rem; color: var(--side-fg); letter-spacing: 0.04em; text-transform: uppercase; }
.side nav { display: contents; }
.side a:not(.brand) { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: 0.92rem; }
.side a:not(.brand):hover { color: var(--side-active); }
.side a[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: var(--side-active); box-shadow: inset 3px 0 0 var(--brand); }
.side .sep { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 10px 4px; }
.side .spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 56px; }
.top .crumb { font-size: 0.88rem; color: var(--muted); }
.top .crumb b { color: var(--fg); font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 0.8rem; }
.content { padding: 24px; display: grid; gap: 18px; align-content: start; min-width: 0; max-width: 1200px; width: 100%; }
.content-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; flex-wrap: wrap; }
.content h1 { font-size: 1.3rem; font-weight: 600; }
.sub { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.scroll { overflow-x: auto; }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }

/* Meldingen */
.flash, .alert { border-radius: 6px; padding: 9px 12px; font-size: 0.9rem; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.alert, .flash-error { background: var(--bad-soft); color: var(--bad); }

/* Knoppen en velden */
.btn { display: inline-block; font: inherit; font-size: 0.85rem; font-weight: 500; line-height: 1.4; border-radius: 6px; padding: 6px 12px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); white-space: nowrap; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 500; }
input[type="text"], input[type="password"], select, textarea { font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.88rem; }
.inline-form select { width: auto; padding-block: 5px; }

/* Lessenoverzicht */
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.zero { color: var(--muted); opacity: 0.6; }
.pill { display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.open { background: var(--warn-soft); color: var(--warn); }
.pill.future { background: var(--neutral-soft); color: var(--neutral); }

/* Aanwezigheid invullen */
.progress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.bar { flex: 1 1 200px; height: 8px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); transition: width 0.25s; }
.saved { font-size: 0.85rem; color: var(--ok); }
.saved.failed { color: var(--bad); }
.student { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.student:last-child { border-bottom: 0; }
.student.open { box-shadow: inset 3px 0 0 var(--warn); }
.student[aria-busy="true"] { opacity: 0.6; }
.who { display: grid; min-width: 0; }
.who b { font-weight: 600; }
.who small { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.choices { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin: 0; }
.choice { font: inherit; font-size: 0.8rem; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.choice:hover { border-color: var(--muted); }
.choice[aria-pressed="true"] { color: var(--surface); }
.choice[aria-pressed="true"].s0 { background: var(--ok); border-color: var(--ok); }
.choice[aria-pressed="true"].s1, .choice[aria-pressed="true"].s4, .choice[aria-pressed="true"].s5 { background: var(--neutral); border-color: var(--neutral); }
.choice[aria-pressed="true"].s2 { background: var(--warn); border-color: var(--warn); }
.choice[aria-pressed="true"].s3 { background: var(--bad); border-color: var(--bad); }
.remark { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.remark summary { cursor: pointer; color: var(--accent); width: fit-content; }
.remark summary q { color: var(--fg); quotes: '\201C' '\201D'; }
.remark summary span { text-decoration: underline; text-underline-offset: 2px; margin-left: 6px; }
.remark form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; flex-wrap: wrap; }
.remark textarea { flex: 1 1 260px; min-height: 2.6em; resize: vertical; }

/* Inloggen */
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); min-height: 100vh; min-height: 100dvh; }
.login-art { background: var(--side); display: grid; place-items: center; padding: 30px; color: var(--side-fg); text-align: center; box-shadow: inset 0 -4px 0 var(--brand); }
.login-art img { width: min(320px, 100%); height: auto; }
.login-art p { margin: 18px 0 0; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.login-form { background: var(--surface); padding: 48px 40px; display: grid; gap: 16px; align-content: center; }
.login-form h1 { font-size: 1.3rem; font-weight: 600; }
.login-form form { display: grid; gap: 16px; }
.login-form .btn { padding: 10px; font-size: 0.95rem; }

@media (max-width: 760px) {
    .app { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); gap: 2px; }
    .brand { padding: 4px 8px; width: 100%; }
    .side .sep, .side .spacer { display: none; }
    .top, .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
    .content { padding-block: 16px; }
    .student { grid-template-columns: minmax(0, 1fr); }
    .choices { justify-content: flex-start; }
    .login { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .login-art { padding: 24px; }
    .login-form { padding: 28px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
    .bar span { transition: none; }
}
