/* Doe Maar Dutch portal — mockup stylesheet.
   One shared visual language for every page. Echoes the public site:
   white base, black text, grotesque-ish headings, pill buttons,
   pastel accent blocks (yellow / pink / green / blue / beige-orange),
   rounded 12px cards. No external fonts or CDNs — system font stack only. */

:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --grey: #67686a;
  --grey-mid: #9a9b9d;
  --grey-light: #efeff0;
  --grey-line: #e2e2e4;
  --yellow: #ffeb66;
  --pink: #ffc2d0;
  --green: #00953c;
  --green-soft: #66bf8a;
  --blue: #0071ff;
  --blue-grey: #7393b3;
  --burnt-orange: #cc5500;
  --creme: #ffddb8;
  --creme-soft: rgba(255, 221, 184, 0.5);

  --font-body: "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --font-head: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;

  --radius: 12px;
  --radius-pill: 9999rem;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

a { color: var(--blue); }

p { margin: 0 0 0.8rem; }

.muted { color: var(--grey); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* ---------- Demo switch bar (top) ---------- */
.demobar {
  background: var(--black);
  color: var(--white);
  font-size: 0.82rem;
}
.demobar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.4rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.demobar-inner .label { color: var(--grey-mid); }
.demobar a {
  color: var(--white);
  text-decoration: none;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid #444;
}
.demobar a:hover { background: #333; }
.demobar a.on { background: var(--creme); color: var(--black); border-color: var(--creme); }

/* ---------- Navigation ---------- */
nav.portalnav {
  position: sticky;
  top: 0;
  z-index: 10;
}
nav.portalnav.admin { background: var(--creme); }
nav.portalnav.student { background: var(--blue-grey); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--black);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
nav.portalnav.student .nav-brand { color: var(--white); }
.nav-brand .tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--black);
  color: var(--white);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
}
nav.portalnav.student .nav-brand .tag { background: var(--white); color: var(--blue-grey); }

.nav-links { display: flex; gap: 0.3rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  display: block;
  color: var(--black);
  text-decoration: none;
  padding: 0.4rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
nav.portalnav.student .nav-links a { color: var(--white); }
nav.portalnav.admin .nav-links a:hover { background: #f3c592; }
nav.portalnav.student .nav-links a:hover { background: rgba(255,255,255,0.18); }
nav.portalnav.admin .nav-links a.active { background: var(--blue-grey); color: var(--white); }
nav.portalnav.student .nav-links a.active { background: var(--white); color: var(--blue-grey); }

/* ---------- Layout ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}
.page-head { margin-bottom: 1.5rem; }
.page-head .crumb { font-size: 0.85rem; color: var(--grey); margin-bottom: 0.35rem; }
.page-head .crumb a { color: var(--grey); }

.row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.row > .col { flex: 1 1 320px; min-width: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- Cards & panels ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.card.tint-creme { background: var(--creme-soft); border-color: transparent; }
.card.tint-yellow { background: var(--yellow); border-color: transparent; }
.card.tint-pink { background: var(--pink); border-color: transparent; }
.card.tint-grey { background: var(--grey-light); border-color: transparent; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card + .card { margin-top: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

.section { margin-top: 2rem; }
.section:first-child { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--creme);
  color: var(--black);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 1.3rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  font-family: var(--font-body);
}
.btn:hover { background: #f3c592; }
.btn.primary { background: var(--green); color: var(--white); }
.btn.primary:hover { background: #037e34; }
.btn.blue { background: var(--blue); color: var(--white); }
.btn.blue:hover { opacity: 0.9; }
.btn.ghost { background: transparent; border: 1px solid var(--grey-line); }
.btn.ghost:hover { background: var(--grey-light); }
.btn.small { padding: 0.32rem 0.85rem; font-size: 0.82rem; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--grey-light);
  color: var(--black);
  white-space: nowrap;
}
.pill.level { background: var(--blue-grey); color: var(--white); }
.pill.thema { background: var(--yellow); }
.pill.type { background: var(--pink); }
.pill.gram { background: var(--green-soft); color: #06381d; }
.pill.new { background: var(--burnt-orange); color: var(--white); }
.pill.ghost { background: transparent; border: 1px solid var(--grey-line); font-weight: 500; color: var(--grey); }
.pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--grey-line); }
table.data th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); font-weight: 600; }
table.data tbody tr:hover, table.data tr:hover td { background: #fafafa; }
table.data a { text-decoration: none; font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 1rem; }
label.field > .lab { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
label.field .hint { font-weight: 400; color: var(--grey); font-size: 0.82rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--grey-line);
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
}
textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-grey); outline-offset: 0; border-color: var(--blue-grey); }
.searchbar { position: relative; }
.searchbar input { padding-left: 2.2rem; }
.searchbar::before { content: "\1F50D"; position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); font-size: 0.9rem; opacity: 0.6; }

/* readonly rendered markdown-ish box */
.mdbox { background: var(--grey-light); border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.92rem; }
.mdbox p:last-child { margin-bottom: 0; }

/* ---------- Toggle switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; font-size: 0.88rem; }
.switch .track {
  width: 40px; height: 22px; border-radius: var(--radius-pill);
  background: var(--grey-mid); position: relative; transition: background 0.15s ease; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: var(--white); border-radius: 50%; transition: left 0.15s ease;
}
.switch.on .track { background: var(--green); }
.switch.on .track::after { left: 20px; }
.switch .state { font-weight: 600; }

/* ---------- Rating selector 1-5 ---------- */
.rating { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.rating .dot {
  border: 1px solid var(--grey-line); border-radius: 10px; padding: 0.4rem 0.55rem;
  text-align: center; cursor: pointer; min-width: 3.4rem; background: var(--white); font-size: 0.78rem; line-height: 1.25;
}
.rating .dot .n { display: block; font-weight: 700; font-size: 1.1rem; font-family: var(--font-head); }
.rating .dot.sel { background: var(--blue-grey); color: var(--white); border-color: var(--blue-grey); }

/* difficulty/performance read dots (student page admin history) */
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--grey-line); display: inline-block; }
.dots i.f { background: var(--blue-grey); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--grey-line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs .tab {
  padding: 0.55rem 1.1rem; cursor: pointer; border: none; background: none; font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600; color: var(--grey); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs .tab.active { color: var(--black); border-bottom-color: var(--burnt-orange); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---------- Filter chips ---------- */
.filters { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filtergroup { }
.filtergroup .glab { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); font-weight: 600; margin-bottom: 0.35rem; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--grey-line); background: var(--white); border-radius: var(--radius-pill);
  padding: 0.25rem 0.8rem; font-size: 0.82rem; cursor: pointer; font-family: var(--font-body); color: var(--black);
}
.chip:hover { background: var(--grey-light); }
.chip.on { background: var(--black); color: var(--white); border-color: var(--black); }

/* ---------- Lists / rows ---------- */
.listrow {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--grey-line); flex-wrap: wrap;
}
.listrow:last-child { border-bottom: none; }
.listrow .main { min-width: 0; }
.listrow .main .t { font-weight: 600; }
.listrow.hidden-row { display: none; }

/* file row */
.file {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--grey-line); border-radius: 10px; margin-bottom: 0.5rem; background: var(--white);
}
.file .ic { width: 1.6rem; text-align: center; }
.file .fn { flex: 1 1 auto; min-width: 0; font-size: 0.9rem; }
.file .meta { color: var(--grey); font-size: 0.8rem; }

/* ---------- Drag handle look ---------- */
.dragrow { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; border: 1px solid var(--grey-line); border-radius: 10px; margin-bottom: 0.6rem; background: var(--white); }
.draghandle { color: var(--grey-mid); cursor: grab; font-size: 1.1rem; line-height: 1; flex: none; }
.dragrow .num { font-family: var(--font-head); font-weight: 700; color: var(--burnt-orange); min-width: 3.2rem; }

/* ---------- Grammar tree ---------- */
.tree .theme { border: 1px solid var(--grey-line); border-radius: var(--radius); margin-bottom: 0.9rem; overflow: hidden; }
.tree .theme > summary {
  cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 700; font-family: var(--font-head); list-style: none;
  background: var(--creme-soft); display: flex; justify-content: space-between; align-items: center;
}
.tree .theme > summary::-webkit-details-marker { display: none; }
.tree .theme > summary::after { content: "\25BE"; color: var(--grey); }
.tree .theme[open] > summary::after { content: "\25B4"; }
.tree .topic { padding: 0.9rem 1.1rem; border-top: 1px solid var(--grey-line); }
.tree .topic .th { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tree .topic .th .name { font-weight: 600; }

/* ---------- Calendar ---------- */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { padding: 0.5rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grey); }
.cal td { border: 1px solid var(--grey-line); vertical-align: top; height: 5.5rem; padding: 0.35rem; }
.cal td .d { font-size: 0.8rem; color: var(--grey); }
.cal td.out { background: #fafafa; }
.cal td.today { outline: 2px solid var(--burnt-orange); outline-offset: -2px; }
.ev {
  display: block; font-size: 0.74rem; padding: 0.15rem 0.4rem; border-radius: 6px; margin-top: 0.2rem;
  text-decoration: none; color: var(--black); background: var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev.adib { background: var(--pink); }
.ev.sofia { background: var(--green-soft); }
.ev.future { opacity: 0.6; border: 1px dashed var(--grey-mid); background: var(--white); }
.callegend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; margin-top: 0.8rem; }
.callegend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.callegend .sw { width: 0.9rem; height: 0.9rem; border-radius: 4px; display: inline-block; }

/* ---------- Callout / hints ---------- */
.callout {
  border-left: 4px solid var(--burnt-orange); background: #fff6ee;
  padding: 0.8rem 1rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem;
}
.callout.info { border-left-color: var(--blue-grey); background: #f2f6fa; }
.note-carry { border-left-color: var(--yellow); background: #fffdf0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--creme-soft); }
.login-card { background: var(--white); border-radius: var(--radius); padding: 2.25rem; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.06); }
.login-card h1 { text-align: center; }
.login-brand-tag { text-align: center; color: var(--grey); margin-bottom: 1.5rem; }

/* ---------- Footer ---------- */
footer.portal { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 3rem; color: var(--grey); font-size: 0.82rem; border-top: 1px solid var(--grey-line); }

/* ---------- Utilities ---------- */
.hr { height: 1px; background: var(--grey-line); border: none; margin: 1.25rem 0; }
.stack-sm > * + * { margin-top: 0.5rem; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .cal td { height: 4rem; }
  main { padding: 1.25rem 1rem 3rem; }
}

/* ---------- Invoice status chips ---------- */
.statuschip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.statuschip.draft { background: var(--grey-light); color: var(--grey); }
.statuschip.sent { background: var(--blue); color: var(--white); }
.statuschip.paid { background: var(--green); color: var(--white); }

/* ---------- Printable invoice ---------- */
.invoice-wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.invoice {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 2.5rem 2.5rem 2rem;
}
.invoice .inv-top { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.invoice .inv-top .brand { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; }
.invoice .inv-meta { text-align: right; font-size: 0.9rem; }
.invoice .inv-meta .num { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.invoice .parties { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.75rem 0; }
.invoice .parties .party { flex: 1 1 220px; }
.invoice .parties .lab { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); font-weight: 600; margin-bottom: 0.25rem; }
.invoice table.lines { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 0.5rem; }
.invoice table.lines th, .invoice table.lines td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--grey-line); text-align: left; }
.invoice table.lines th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); }
.invoice table.lines td.num, .invoice table.lines th.num { text-align: right; white-space: nowrap; }
.invoice table.lines tfoot td { border-bottom: none; font-weight: 700; padding-top: 0.9rem; }
.invoice table.lines tfoot td.num { font-size: 1.1rem; }
.invoice .inv-foot { margin-top: 1.75rem; font-size: 0.82rem; color: var(--grey); }

/* ---------- Print ---------- */
@media print {
  .demobar, nav.portalnav, .noprint, footer.portal { display: none !important; }
  body { background: var(--white); }
  .invoice-wrap { padding: 0; max-width: none; }
  .invoice { border: none; border-radius: 0; padding: 0; }
  a { color: var(--black); text-decoration: none; }
}

/* ---------- Phase 2 additions: login OAuth divider + nav logout ---------- */
.oauth-sep { display: flex; align-items: center; gap: 0.6rem; margin: 1.1rem 0; color: var(--grey); font-size: 0.82rem; }
.oauth-sep::before, .oauth-sep::after { content: ""; height: 1px; background: var(--grey-line); flex: 1 1 auto; }
.oauth-btn-row { display: flex; gap: 0.6rem; }
.oauth-btn-row .btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.nav-links a.logout { opacity: 0.85; }
.forgot { background: none; border: none; padding: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; }

/* ===== Phase 3 (classes + calendar) ===== */
/* Calendar events + legend swatches coloured by student. c0..c7 cycle; the
   existing .ev / .ev.future rules above still apply (a future event keeps its
   colour but gains the dashed border + fade from .ev.future). */
.ev.c0, .sw.c0 { background: var(--pink); color: var(--black); }
.ev.c1, .sw.c1 { background: var(--green-soft); color: #06381d; }
.ev.c2, .sw.c2 { background: var(--yellow); color: var(--black); }
.ev.c3, .sw.c3 { background: var(--blue-grey); color: var(--white); }
.ev.c4, .sw.c4 { background: var(--creme); color: var(--black); }
.ev.c5, .sw.c5 { background: #cbb4e6; color: var(--black); }
.ev.c6, .sw.c6 { background: #a8d5ff; color: var(--black); }
.ev.c7, .sw.c7 { background: #f5b3b3; color: var(--black); }

/* The rating dots and grammar chips on the class page are real form controls
   (radio / checkbox) styled as the mockup's dots and chips; the input itself is
   visually hidden. Give the selected state a clear outline for keyboard focus. */
.rating .dot input:focus-visible + .n,
.chip input:focus-visible { outline: 2px solid var(--blue-grey); }
.rating .dot { position: relative; }
.chip { position: relative; }

/* ===== Phase 4 ===== */
/* Filter chips are links here (not buttons): keep them looking like chips. */
a.chip { display: inline-block; text-decoration: none; }
a.chip.on { color: var(--white); }
