/* Proper Access portaal, basisstijl.
   Merktokens, toegankelijke focus, target size >=24px, self-hosted fonts. */

/* --- Zelf-gehoste fonts (AVG + performance, geen Google CDN) --- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-sans-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/static/fonts/nunito-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/static/fonts/nunito-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --magenta: #A30D4B;
  --magenta-dark: #840a3d;   /* donkerder voor AA-tekst op wit indien nodig */
  --donkerblauw: #1F2937;
  --petrol: #004050;
  --lichtgrijs: #F5F5F5;
  --wit: #FFFFFF;

  --tekst: var(--donkerblauw);
  --link: var(--petrol);
  --focus: var(--magenta);

  --font-kop: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-tekst: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 64rem;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: var(--font-tekst);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tekst);
  background: var(--wit);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-kop);
  font-weight: 800;
  line-height: 1.2;
  color: var(--donkerblauw);
}
h1 { font-size: 2rem; margin: 0 0 0.5em; }
h2 { font-size: 1.5rem; margin: 1.5em 0 0.5em; }
h3 { font-size: 1.2rem; margin: 1.25em 0 0.4em; }

p { margin: 0 0 1em; }

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--magenta-dark); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 34rem; }
/* Brede pagina's (rapport met sidebar, portfolio-tabel): pagina vullend. */
.main-content--wide { max-width: none; }

/* --- Skip-link --- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--magenta);
  color: var(--wit);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; color: var(--wit); }

/* --- Zichtbare focus overal (WCAG 2.4.11/2.4.13) --- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Header / merk --- */
.site-header {
  background: var(--wit);
  border-bottom: 3px solid var(--magenta);
  box-shadow: 0 1px 4px rgba(31, 41, 55, 0.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  /* Volle breedte met dezelfde zijmarge als .container, zodat het logo links
     uitlijnt met de sidebar/inhoud. */
  padding: 0.7rem 1.25rem;
}
.header-right { display: flex; align-items: center; gap: 1rem; }
.lang-switch { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.lang-switch a { color: var(--petrol); text-decoration: none; padding: 0.1rem 0.3rem; border-radius: 4px; }
.lang-switch a:hover { background: var(--lichtgrijs); text-decoration: underline; }
.lang-switch__current { font-weight: 700; color: var(--donkerblauw); padding: 0.1rem 0.3rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__mark { flex: 0 0 auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--font-kop); font-weight: 800; font-size: 1.2rem;
  color: var(--magenta-dark);
}
.brand__sub {
  font-family: var(--font-kop); font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--petrol);
}
.brand:hover .brand__name { color: var(--magenta); }

/* --- Navigatie (mobile-first; details = toegankelijk uitklapmenu, geen JS) --- */
.nav { position: relative; }
.nav__menu a {
  color: var(--donkerblauw); text-decoration: none; font-weight: 700;
  padding: 0.5rem 0.7rem; border-radius: var(--radius); line-height: 1.3;
}
.nav__menu a:hover { background: var(--lichtgrijs); color: var(--magenta-dark); }
.nav__menu a[aria-current="page"] {
  color: var(--magenta-dark); box-shadow: inset 0 -3px 0 var(--magenta);
}
.nav__user { color: #444; font-size: 0.95rem; padding: 0 0.4rem; }
.nav__logout { margin: 0; }

/* Hamburger-knop (de summary) */
.nav__toggle {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-weight: 700; padding: 0.5rem 0.7rem; border: 2px solid #6b7280;
  border-radius: var(--radius); list-style: none;
}
.nav__toggle::-webkit-details-marker { display: none; }
.nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
  content: ""; display: block; width: 20px; height: 2px;
  background: var(--donkerblauw); border-radius: 2px;
}
.nav__toggle-bars { position: relative; }
.nav__toggle-bars::before { position: absolute; top: -6px; }
.nav__toggle-bars::after { position: absolute; top: 6px; }

/* Smal scherm: het menu klapt uit onder de knop (details[open]). */
.nav[open] .nav__menu {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem;
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 50;
  background: var(--wit); border: 2px solid #e3e3e3; border-radius: var(--radius);
  padding: 0.5rem; min-width: 13rem; box-shadow: 0 6px 18px rgba(31, 41, 55, 0.15);
}

/* Breed scherm: geen hamburger, menu altijd zichtbaar als rij.
   !important + ::details-content overrulen het inklappen van een gesloten
   <details>, zodat de links op desktop altijd zichtbaar zijn. */
@media (min-width: 56rem) {
  .nav__toggle { display: none; }
  .nav__menu { display: flex !important; align-items: center; gap: 0.3rem; position: static; }
  .nav::details-content { content-visibility: visible; }
}

.main-content { flex: 1 0 auto; padding-top: 2rem; padding-bottom: 3rem; }
.main-content:focus { outline: none; }

.site-footer {
  background: var(--donkerblauw);
  color: var(--wit);
  padding: 1.25rem 0;
  font-size: 0.95rem;
}
.site-footer a { color: var(--wit); }

/* --- Formulieren --- */
.form { margin-top: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field__help { margin: 0.35rem 0 0; font-size: 0.95rem; color: #444; }
input[type="email"],
input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 2px solid #6b7280;
  border-radius: var(--radius);
  background: var(--wit);
  color: var(--tekst);
}
input:focus-visible, textarea:focus-visible { border-color: var(--petrol); }

/* --- Knoppen (target size >=24px, ruim) --- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn--primary { background: var(--magenta); color: var(--wit); }
.btn--primary:hover { background: var(--magenta-dark); color: var(--wit); }
.btn--ghost {
  background: transparent;
  color: var(--donkerblauw);
  border-color: #6b7280;
}
.btn--ghost:hover { background: #e9e9e9; color: var(--donkerblauw); }

/* --- Rapportlijst --- */
.report-list { list-style: none; padding: 0; margin: 1rem 0; }
.report-list__item {
  padding: 1rem;
  border: 2px solid #e3e3e3;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.report-list__meta { display: block; color: #444; font-size: 0.95rem; margin-top: 0.25rem; }
.empty { color: #444; }

/* --- Hulpklassen --- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.muted { color: #444; }

/* --- Breadcrumb / rapport-subkop --- */
.breadcrumb { font-size: 0.95rem; margin-bottom: 0.5rem; }
.report-sub { color: #444; margin-top: -0.5rem; }

/* --- Bevinding --- */
.finding {
  border: 2px solid #e3e3e3;
  border-left: 6px solid var(--petrol);
  border-radius: var(--radius);
  margin: 1rem 0;
  scroll-margin-top: 1rem;
}
.finding-body :first-child { margin-top: 0; }
.finding-body :last-child { margin-bottom: 0; }

.finding-meta { margin: 0 0 1rem; }
.finding-meta > div { display: flex; gap: 0.5rem; padding: 0.15rem 0; }
.finding-meta dt { font-weight: 700; min-width: 5.5rem; margin: 0; }
.finding-meta dd { margin: 0; }

.user-story {
  border-left: 4px solid var(--magenta);
  background: var(--lichtgrijs);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-style: italic;
}

.screenshot { margin: 1rem 0; }
.screenshot img {
  max-width: 100%;
  height: auto;
  border: 2px solid #e3e3e3;
  border-radius: var(--radius);
}

/* --- Status (nooit alleen kleur: tekstlabel + accent) --- */
.status { font-weight: 700; }
.status--open { color: var(--donkerblauw); }
.status--klant_opgelost { color: #8a5a00; }
.status--goedgekeurd { color: #1b5e20; }
.status--afgekeurd { color: var(--magenta-dark); }
.status--niet_oplosbaar { color: #444; }

/* --- Acties / controle --- */
.finding-actions { margin: 1.25rem 0; }
.verify-form fieldset, .comment-form fieldset {
  border: 2px solid #e3e3e3; border-radius: var(--radius); padding: 1rem;
}
.verify-form legend { font-weight: 700; padding: 0 0.4rem; }
.radio-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.radio-row input { width: 1.15rem; height: 1.15rem; }
.radio-row label { font-weight: 400; margin: 0; }

/* --- Discussiedraad --- */
.thread { margin-top: 1.5rem; border-top: 2px solid #e3e3e3; padding-top: 1rem; }
.comments { list-style: none; padding: 0; margin: 0 0 1rem; }
.comment {
  border: 1px solid #e3e3e3; border-radius: var(--radius);
  padding: 0.75rem 1rem; margin-bottom: 0.75rem;
}
.comment--internal { background: #fff7e6; border-color: #e0c97f; }
.comment-meta { font-size: 0.9rem; color: #444; margin: 0 0 0.35rem; display: flex; gap: 0.75rem; align-items: center; }
.comment-author { font-weight: 700; color: var(--donkerblauw); }
.comment-body :first-child { margin-top: 0; }
.comment-body :last-child { margin-bottom: 0; }
.badge {
  background: var(--donkerblauw); color: var(--wit);
  font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px;
}

/* --- Notificatiebel --- */
.bell { position: relative; text-decoration: none; font-weight: 700; }
.bell__count {
  background: var(--magenta); color: var(--wit);
  border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.8rem; margin-left: 0.25rem;
}

/* --- Datatabel --- */
.data-table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.data-table th, .data-table td {
  text-align: left; padding: 0.6rem 0.75rem; border-bottom: 2px solid #e3e3e3;
}
.data-table thead th { border-bottom: 3px solid var(--donkerblauw); }

/* --- Samenvatting / voortgang --- */
.report-actions { margin-top: -0.5rem; }
.summary-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.data-table.mini { width: auto; min-width: 16rem; }
.data-table.mini th[scope="row"] { font-weight: 400; }

.progress { margin: 1.25rem 0; }
.progress-line { margin-bottom: 0.5rem; }
.progress-bar {
  background: #e3e3e3; border-radius: 999px; height: 1rem; overflow: hidden;
  max-width: 30rem;
}
.progress-bar__fill { background: #1b5e20; height: 100%; }
.progress-detail { margin: 0.75rem 0 0; padding-left: 1.25rem; }

.uren-form { max-width: 32rem; }
.btn--small { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.9rem; }

/* --- Statistiekenpaneel + tijdlijn --- */
.stats-panel {
  background: var(--lichtgrijs);
  border: 2px solid #e3e3e3;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
}
.stat-cards {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.stat-cards li {
  background: var(--wit); border: 2px solid #e3e3e3; border-radius: var(--radius);
  padding: 0.6rem 1rem; min-width: 7rem; font-size: 0.95rem; color: #333;
}
.stat-num { display: block; font-family: var(--font-kop); font-weight: 800;
  font-size: 1.6rem; color: var(--magenta-dark); line-height: 1; }

.timeline { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.timeline__pt { font-size: 0.95rem; color: #333; white-space: nowrap; }
.timeline .progress-bar { flex: 1 1 10rem; max-width: none; margin: 0; }

/* --- Layout: sidebar + main --- */
.report-layout { display: grid; grid-template-columns: 17rem 1fr; gap: 1.75rem; align-items: start; }
.report-sidebar {
  position: sticky; top: 1rem; align-self: start;
  max-height: calc(100vh - 2rem); overflow: auto;
  border: 2px solid #e3e3e3; border-radius: var(--radius); padding: 1rem;
  background: var(--wit);
}
.sidebar-title { font-size: 1.1rem; margin: 0 0 0.5rem; }
.sidebar-page { margin: 0.75rem 0 0.25rem; font-weight: 700; }
.sidebar-page a { text-decoration: none; }
.sidebar-findings { list-style: none; margin: 0; padding: 0; }
.sidebar-findings li { margin: 0; }
.sidebar-findings a {
  display: flex; gap: 0.4rem; align-items: baseline;
  padding: 0.3rem 0.4rem; border-radius: 6px; text-decoration: none;
  font-size: 0.92rem; line-height: 1.3;
}
.sidebar-findings a:hover { background: var(--lichtgrijs); }
.sidebar-general { margin-top: 1rem; padding-top: 0.75rem; border-top: 2px solid #e3e3e3; font-weight: 700; }
.sidebar-legend {
  list-style: none; margin: 0 0 1rem; padding: 0.6rem 0.7rem;
  background: var(--lichtgrijs); border-radius: var(--radius);
  font-size: 0.85rem; color: #4b5563;
}
.sidebar-legend li { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
.sidebar-legend .ico { width: 1.2rem; height: 1.2rem; font-size: 0.8rem; }

@media (max-width: 56rem) {
  .report-layout { grid-template-columns: 1fr; }
  .report-sidebar { position: static; max-height: none; }
}

/* --- Statusicoon --- */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 999px;
  font-weight: 800; font-size: 0.9rem; flex: 0 0 auto;
  border: 2px solid currentColor;
}
.ico--todo { color: #6b7280; }
.ico--opgelost { color: #1b5e20; background: #e3f3e4; }
.ico--vragen { color: var(--magenta-dark); background: #fbe3ee; }

/* --- Team-badge --- */
.team {
  font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.55rem;
  border-radius: 999px; white-space: nowrap;
}
.team--content { background: #e6eef9; color: #1c4ca0; }
.team--techniek { background: #fde7e7; color: #9b1c1c; }
.team--design { background: #efe7fb; color: #5b21a6; }

/* --- Ingeklapte bevinding (details/summary) --- */
.finding > details { margin: 0; }
.finding-summary {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.1rem; cursor: pointer; list-style: none;
}
.finding-summary::-webkit-details-marker { display: none; }
.finding-summary::after {
  content: "▸"; margin-left: auto; color: #6b7280; font-size: 1.1rem;
}
.finding > details[open] .finding-summary::after { content: "▾"; }
.finding-summary:hover { background: var(--lichtgrijs); }
.finding-summary .finding-title { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.finding-detail { padding: 0 1.1rem 1.25rem; }
.finding-content .screenshot img { max-width: 100%; }

/* Twee kolommen: inhoud links (leesbare breedte), controle + gesprek rechts.
   Beide kolommen hebben een nette maximumbreedte en lijnen samen links uit, zodat
   er geen gat tussen tekst en paneel zit. Resterende ruimte komt rechts. */
.finding-grid { display: grid; gap: 1.5rem 2rem; align-items: start; }
.finding-content { min-width: 0; }
@media (min-width: 64rem) {
  .finding-grid {
    grid-template-columns: minmax(0, 42rem) minmax(22rem, 32rem);
    justify-content: start;
  }
  .finding-aside { position: sticky; top: 1rem; }
}
.finding-aside {
  background: var(--lichtgrijs);
  border: 1px solid #e3e3e3;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.finding-aside .finding-actions { margin-top: 0; }
.finding-aside .thread { max-width: none; }

/* --- Horizontale meta --- */
.meta-h {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 0 0 1rem;
  padding: 0.75rem 0; border-top: 1px solid #e3e3e3; border-bottom: 1px solid #e3e3e3;
}
.meta-h > div { display: flex; flex-direction: column; }
.meta-h dt { font-size: 0.8rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; }
.meta-h dd { margin: 0; font-weight: 700; }
.meta-h dd.status { font-weight: 700; }

.progress-form fieldset { border: 2px solid #e3e3e3; border-radius: var(--radius); padding: 1rem; }
.progress-form legend { font-weight: 700; padding: 0 0.4rem; }

/* Team wijzigen, compacte inline-vorm */
.team-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 0 0 1rem;
}
.team-form label { font-weight: 700; font-size: 0.9rem; }
.team-form select {
  font: inherit; padding: 0.4rem 0.6rem; border: 2px solid #6b7280;
  border-radius: var(--radius); background: var(--wit);
}

/* --- Algemene vragen --- */
.general-questions {
  border: 2px solid #e3e3e3; border-left: 6px solid var(--magenta);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
