/* Klaslink Atheneum GO! Geel – huisstijl (kleuren uit het schoollogo: marineblauw, groen, geel) */
:root {
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --school-navy: #1c3b6a;
  --school-green: #77b02e;
  --school-yellow: #ffec00;
  --brand: #1c3b6a;
  --brand-hover: #14305a;
  --brand-pressed: #0f2443;
  --brand-tint: #e8eef7;
  --bg: #f3f5ef;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f0f0f0;
  --stroke: #e0e0e0;
  --stroke-strong: #d1d1d1;
  --text: #242424;
  --text-2: #424242;
  --text-3: #707070;
  --green: #107c10;
  --green-tint: #f1faf1;
  --orange: #bc4b09;
  --orange-tint: #fff9f5;
  --red: #c50f1f;
  --red-tint: #fdf3f4;
  --purple: #8764b8;
  --shadow-4: 0 2px 4px rgba(0,0,0,.08), 0 0 2px rgba(0,0,0,.08);
  --shadow-16: 0 8px 16px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);
  --shadow-64: 0 32px 64px rgba(0,0,0,.24), 0 0 8px rgba(0,0,0,.2);
  --r-s: 4px;
  --r-m: 6px;
  --r-l: 8px;
  --r-xl: 12px;
  color-scheme: light;
}
/* data-theme wordt gezet door lib/theme.js (systeem / licht / donker) */
:root[data-theme="dark"] {
  --brand: #8fb3e6;
  --brand-hover: #a7c4ec;
  --brand-pressed: #6f97d1;
  --brand-tint: #16253c;
  --bg: #121722;
  --surface: #1b2230;
  --surface-2: #171d29;
  --surface-3: #252e3f;
  --stroke: #2e3849;
  --stroke-strong: #44506a;
  --text: #ffffff;
  --text-2: #d6d6d6;
  --text-3: #a3a3a3;
  --green: #54b054;
  --green-tint: #052505;
  --orange: #f98845;
  --orange-tint: #411200;
  --red: #f1707b;
  --red-tint: #3b0509;
  --purple: #b696e0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--school-green) 0 33.33%, var(--school-navy) 33.33% 66.66%, var(--school-yellow) 66.66% 100%); }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 20px; line-height: 28px; }
h3 { font-size: 16px; line-height: 22px; }
a { color: var(--brand); }
.muted { color: var(--text-3); }
.small { font-size: 12px; line-height: 16px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 12px;
  border-radius: var(--r-m); border: 1px solid var(--stroke-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background .1s, border-color .1s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #000; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.subtle { background: transparent; border-color: transparent; }
.btn.subtle:hover { background: var(--surface-3); }
.btn.large { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.toggled { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }
.icon-btn { width: 32px; padding: 0; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.input, textarea.input, select.input {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--stroke-strong); border-bottom-color: var(--text-3);
  border-radius: var(--r-s); min-height: 32px; padding: 5px 10px; width: 100%;
  outline: none;
}
.input:focus { border-bottom: 2px solid var(--brand); padding-bottom: 4px; box-shadow: 0 0 0 2px var(--school-yellow); }
.btn:focus-visible { outline: 3px solid var(--school-yellow); outline-offset: 1px; }
textarea.input { min-height: 80px; resize: vertical; }

/* Cards */
.card {
  background: var(--surface); border-radius: var(--r-l);
  box-shadow: var(--shadow-4); border: 1px solid var(--stroke);
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; line-height: 16px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.orange { background: var(--orange-tint); color: var(--orange); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.brand { background: var(--brand-tint); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* Monitoring banner – moet altijd zichtbaar zijn */
.monitor-banner {
  display: flex; align-items: center; gap: 8px;
  background: #4f7d16; color: #fff;
  font-weight: 700; font-size: 13px; padding: 8px 14px;
}
:root[data-theme="dark"] .monitor-banner { background: #5f9420; color: #fff; }
.monitor-banner .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: kl-pulse 1.6s infinite; }
@keyframes kl-pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* Message bar */
.msgbar { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid; font-size: 13px; }
.msgbar.error { background: var(--red-tint); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--text); }
.msgbar.warn { background: var(--orange-tint); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.msgbar.info { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

/* Dialog */
dialog {
  border: 0; border-radius: var(--r-xl); padding: 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-64); width: min(520px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog .dlg-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Segmented */
.segmented { display: inline-flex; background: var(--surface-3); border-radius: var(--r-m); padding: 2px; }
.segmented button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--text-2); padding: 4px 12px; border-radius: var(--r-s); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-4); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--surface-3); font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 999px; }
.chip button:hover { background: var(--stroke); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 10px; border: 3px solid var(--bg); }
