/* Huisstijl House of Sports, toegepast als House of Athletes.
   Bron: De Arena (globals.css) en Context/platform/huisstijl.md.
   Harde regel: geen kleine witte tekst op oranje — op het merkoranje staat bijna-zwart (6,3:1). */
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/HankenGrotesk-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/HankenGrotesk-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/HankenGrotesk-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/HankenGrotesk-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/HankenGrotesk-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --bg: #F4F4F4;            /* grond: gebroken wit */
  --card: #ffffff;
  --ink: #0F0D0B;           /* warm zwart */
  --ink-2: #2F2F2F;
  --muted: #6B6763;         /* warm grijs */
  --line: #E6E6E6;
  --line-2: #D9D6D2;
  --orange: #FF5C01;        /* merkoranje */
  --orange-hover: #EB5E1E;  /* diep oranje */
  --amber: #F8A815;
  --orange-soft: #FFF1E8;
  --orange-ink: #A33E00;    /* oranje tekst op licht vlak */
  --flame: linear-gradient(90deg, #F8A815 0%, #FF5C01 55%, #EB5E1E 100%);
  /* grafiekreeksen (De Arena): vaste volgorde, reeks 1 is altijd oranje */
  --chart-1: #FF5C01;
  --chart-2: #1D4ED8;
  --chart-3: #0D9488;
  --chart-4: #7C3AED;
  --ok: #15803D;
  --ok-soft: #E8F5EC;
  --warn: #9A5B00;
  --warn-soft: #FDF3E0;
  --danger: #C8322A;
  --info: #1D4ED8;
  --info-soft: #EAF0FD;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: none;
  font-family: 'Hanken Grotesk', ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--ink); font-family: inherit; }
a { color: var(--ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; text-decoration-thickness: 2px; }
p a, .small a, .muted a { color: var(--orange-ink); }
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
code { background: #ECEAE7; border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

/* Bovenbalk: warm zwart met het merk, daaronder de vlamstreep */
.topbar { background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; position: sticky; top: 0; z-index: 20; }
.flame-stripe { height: 4px; background: var(--flame); position: sticky; top: 62px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none !important; }
.brand img { width: 38px; height: 38px; display: block; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.02em; line-height: 1; text-transform: lowercase; }
.brand-name small { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: #B9B4AE; margin-top: 4px; }
.top-user { display: flex; align-items: center; gap: 10px; }
.top-user .who { text-align: right; line-height: 1.25; }
.top-user .who b { display: block; font-size: 13px; }
.top-user .who span { font-size: 11.5px; color: #B9B4AE; }
.top-user .btn-ghost { color: #D9D6D2; }
.top-user .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 66px); }
.shell.no-side { grid-template-columns: 1fr; }
.sidebar { padding: 20px 12px 16px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 66px; height: calc(100vh - 66px); overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .side-btn { display: flex; align-items: center; gap: 11px; color: var(--ink-2); padding: 9px 12px; border-radius: 10px; text-decoration: none !important; font-weight: 600; font: inherit; font-weight: 600; border: 0; background: none; width: 100%; cursor: pointer; text-align: left; }
.nav a svg, .side-btn svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--muted); }
.nav a:hover, .side-btn:hover { background: #EAE8E5; color: var(--ink); }
.nav a.active { background: var(--orange); color: var(--ink); }
.nav a.active svg { color: var(--ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-count { margin-left: auto; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav a.active .side-count { background: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #ECEAE7; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.topbar .avatar { background: var(--orange); color: var(--ink); }
.main { padding: 28px 32px 70px; max-width: 1340px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); display: inline-block; margin-bottom: 6px; text-decoration: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Kaarten komen omhoog zonder schaduw: de grond eromheen is niet wit */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head a, .crumb, .nav a, .tabs a, .btn, .badge, .brand, tr a, h3 a { text-decoration: none; }

/* KPI-kaarten */
.kpi { display: flex; flex-direction: column; gap: 6px; min-height: 126px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--flame); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--orange-soft); display: grid; place-items: center; color: var(--orange-ink); }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: auto; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi-value.xl { font-size: 46px; }
.trend { font-size: 11.5px; font-weight: 700; background: var(--ok-soft); color: var(--ok); border-radius: 7px; padding: 2px 7px; letter-spacing: 0; }
.trend.neutral { background: #EFEDEA; color: var(--muted); }

/* Knoppen: primair = merkoranje met warm-zwarte tekst */
button, .btn { font: inherit; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none !important; white-space: nowrap; }
button:hover, .btn:hover { background: #F7F6F4; border-color: #C9C5BF; color: var(--ink); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); color: var(--ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 5px 9px; }
.btn-ghost:hover { background: #EFEDEA; border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }
button svg, .btn svg { width: 16px; height: 16px; }

input, select, textarea { font: inherit; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(255, 92, 1, .22); border-color: var(--orange); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--orange); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
label.field > span.q { color: var(--ink); font-size: 15px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.check input { margin-top: 3px; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 40px; background: #F4F4F4; border-color: transparent; }
.search input:focus { background: #fff; }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #EFEDEA; color: var(--muted); white-space: nowrap; }
.badge-enquete { background: var(--info-soft); color: var(--info); }
.badge-research { background: #E6F4F2; color: #0B6B62; }
.badge-intern { background: #EFEDEA; color: #4D4A47; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-accent { background: var(--orange-soft); color: var(--orange-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: #FBE8E7; color: var(--danger); }
.badge-dark { background: var(--ink); color: #fff; }
.tag { display: inline-block; background: #F1EFEC; border-radius: 7px; padding: 1px 8px; margin: 1px 3px 1px 0; }

/* Filterpaneel (brandfit) */
.filter-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.filter-panel { position: sticky; top: 86px; }
.facet { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.facet:first-of-type { border-top: 0; }
.facet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 6px; }
.facet-item { display: flex; align-items: center; gap: 9px; padding: 5px 2px; cursor: pointer; border-radius: 8px; }
.facet-item:hover { background: #F7F6F4; }
.facet-item .n { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); background: #F1EFEC; border-radius: 6px; padding: 1px 7px; }
.facet-item.zero { opacity: .45; }
.facet-item input { pointer-events: none; }

/* Tabellen & lijsten */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #FAF9F8; }
.table-wrap { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 6px 0; }

.progress { height: 6px; background: #ECEAE7; border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--flame); border-radius: 99px; }
.progress.good > span { background: var(--ok); }

/* Profiel */
.profile-hero { display: flex; gap: 18px; align-items: center; }
.profile-hero .avatar { width: 64px; height: 64px; font-size: 22px; background: var(--ink); color: #fff; box-shadow: inset 0 -4px 0 var(--orange); }
.kv { display: grid; grid-template-columns: 200px 1fr auto; gap: 0 14px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.kv .v { white-space: pre-wrap; word-break: break-word; }
.kv .m { text-align: right; display: flex; gap: 5px; justify-content: flex-end; align-items: flex-start; }
.kv .is-empty { color: #C4C0BA; }
.person-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.panel { background: #F7F6F4; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }

.hook { font-size: 13px; padding: 2px 0; }
.hook b { color: var(--muted); font-weight: 600; }
mark { background: #FFD9BF; padding: 0 2px; border-radius: 3px; color: var(--ink); }
.warn-line { font-size: 12.5px; color: var(--warn); margin-top: 6px; }

.event { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event .when { min-width: 92px; font-size: 12.5px; color: var(--muted); font-weight: 600; padding-top: 1px; }
.event.today .when { color: var(--orange-ink); }
.event .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

pre.note { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; background: #F7F6F4; border-radius: 10px; padding: 10px 12px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; background: #fff; padding: 5px; border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 13px; color: var(--ink-2); border-radius: 9px; text-decoration: none !important; font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.tabs a.active { background: var(--orange); color: var(--ink); }
.tabs a .side-count { margin-left: 0; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.feedback-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.reply { background: #F7F6F4; border-left: 3px solid var(--orange); border-radius: 8px; padding: 9px 12px; margin-top: 8px; font-size: 13.5px; }
.reply small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 13, 11, .5); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; padding: 24px 26px; border-top: 4px solid var(--orange); }
.modal h2 { font-size: 19px; margin-bottom: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 60; font-weight: 600; border-bottom: 3px solid var(--orange); }
.toast.error { background: var(--danger); border-bottom-color: #8E1F19; }

/* Inloggen: zelfde opbouw — zwart vlak met merk, vlamstreep, witte kaart */
.auth { max-width: 420px; margin: 9vh auto; padding: 0; overflow: hidden; }
.auth-head { background: var(--ink); color: #fff; padding: 22px 26px 20px; }
.auth-head + .flame-stripe { position: static; }
.auth-body { padding: 24px 26px 26px; }

/* Enquête (openbare link) */
.survey-body { background: var(--bg); }
.survey { max-width: 700px; margin: 0 auto; padding: 28px 18px 80px; }
.survey .hero { margin-bottom: 20px; }
.q-card { margin-bottom: 12px; }
.current { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.sticky-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 12px; }
.survey-brand { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px 14px 0 0; }
.survey-brand img { width: 30px; height: 30px; }
.survey-brand + .flame-stripe { position: static; margin-bottom: 22px; border-radius: 0 0 4px 4px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}
@media (max-width: 1000px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; }
  .top-user .who { display: none; }
  .brand-name small { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 12px; gap: 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 7px 10px; }
  .main { padding: 18px 16px 60px; }
  .form-grid, .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr auto; }
  .kv .k { grid-column: 1 / -1; border-bottom: 0 !important; padding-bottom: 0 !important; }
  .person-row { grid-template-columns: 1fr 1fr; }
  .kpi-value.xl { font-size: 36px; }
}

/* Foto's */
.avatar.photo { padding: 0; overflow: hidden; background: #ECEAE7; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.profile-hero .avatar.photo { box-shadow: 0 0 0 3px var(--orange); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; border-radius: 10px; overflow: hidden; background: #F4F4F4; border: 2px solid transparent; }
.photo-grid figure.primary { border-color: var(--orange); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-grid figcaption { display: flex; justify-content: space-between; align-items: center; padding: 4px; gap: 2px; }

/* Selectie in brandfit */
.pick { margin-left: auto; display: flex; padding: 4px; cursor: pointer; }
.pick input { width: 18px; height: 18px; }
.pick-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px 10px 18px; display: flex; gap: 12px; align-items: center; z-index: 30; border-bottom: 3px solid var(--orange); }
.pick-bar .btn-ghost { color: #D9D6D2; }

/* Meldingenbel */
.bell { position: relative; }
.bell-count { position: absolute; top: -2px; right: -2px; background: var(--orange); color: var(--ink); font-size: 10.5px; font-weight: 800; border-radius: 99px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
