/* ============ Rapida — portaal ============ */
.portal-body { background: var(--mist); min-height: 100vh; }

/* ---- Inlogpoort ---- */
.login-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; align-items: center; justify-items: stretch; padding: 24px;
  background:
    radial-gradient(700px 400px at 80% -10%, rgba(96,165,250,.25), transparent 60%),
    radial-gradient(600px 400px at 0% 110%, rgba(37,99,235,.25), transparent 60%),
    var(--ink);
  overflow-y: auto;
}
.login-gate[hidden] { display: none; }
.login-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 34px;
  width: 100%; max-width: 420px; min-width: 0;
  box-shadow: var(--shadow-lg);
}
.brand-dark .brand-name { color: var(--ink); }
.login-card h1 { font-size: 1.5rem; margin: 18px 0 20px; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--mist); border-radius: 10px; padding: 5px; margin-bottom: 22px; }
.login-tab { font: inherit; font-weight: 600; font-size: .95rem; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.login-tab[aria-selected="true"] { background: var(--paper); color: var(--blue-deep); box-shadow: var(--shadow); }
#login-form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
#login-form input { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: .97rem; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
#login-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.login-error { color: #c2333a; font-size: .88rem; margin-bottom: 12px; background: #fdecee; padding: 10px 12px; border-radius: 8px; }
.login-error[hidden] { display: none; }
.login-alt { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 16px; }
.login-alt a { color: var(--blue-deep); font-weight: 600; text-decoration: none; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: .8rem; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-demos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-demos .btn { width: 100%; }

.portal-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--ink);
  border-bottom: 1px solid var(--line-dark);
}
.portal-bar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 24px;
}
.portal-roleswitch {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px; padding: 4px;
  margin-left: 12px;
}
.role-btn {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  color: var(--muted-dark);
  background: transparent; border: 0;
  padding: 8px 16px; border-radius: 7px; cursor: pointer;
}
.role-btn[aria-selected="true"] { background: var(--blue); color: #fff; }
.portal-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.portal-who { color: #fff; font-size: 0.85rem; font-weight: 600; }

/* Zichtbare uitlogknop */
.btn-logout { background: #fff; color: var(--ink); border-color: #fff; font-weight: 700; }
.btn-logout:hover { background: var(--light); border-color: var(--light); }
.btn-danger { background: #e5484d; color: #fff; border-color: #e5484d; }
.btn-danger:hover { background: #cf3a3f; border-color: #cf3a3f; }

.portal-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }

.portal-tabs { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.ptab {
  font: inherit; font-weight: 600; font-size: 0.98rem;
  color: var(--muted); background: none; border: 0;
  padding: 12px 18px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ptab[aria-selected="true"] { color: var(--blue-deep); border-bottom-color: var(--blue); }

/* Filterbar */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
  align-items: center;
}
.filterbar input[type="search"], .filterbar select, .filterbar input[type="date"] {
  font: inherit; font-size: 0.9rem;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--paper); color: var(--text);
}
.filter-search { flex: 1 1 220px; min-width: 180px; }
.filter-date { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.filter-reset {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--blue-deep); background: none; border: 0;
  cursor: pointer; padding: 8px 10px; margin-left: auto;
}
.filter-reset:hover { text-decoration: underline; }
.result-count { color: var(--muted); font-size: 0.88rem; margin-bottom: 16px; }

/* Kandidaat-grid */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.pcard-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pcard-title { min-width: 0; }
.pcard-title strong { display: block; font-size: 0.98rem; line-height: 1.3; }
.pcard-title span { font-size: 0.82rem; color: var(--muted); }
.pcard-head .badge-verified { margin-left: auto; }
.pcard-avail {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--light); border-radius: 9px;
  padding: 10px 12px; margin-bottom: 14px;
}
.pcard-avail span { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue-deep); }
.pcard-avail strong { font-size: 0.9rem; color: var(--ink); }
.pcard-specs { margin-bottom: 16px; }
.pcard-specs > div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.pcard-specs > div:last-child { border-bottom: 0; }
.pcard-specs dt { color: var(--muted); }
.pcard-specs dd { font-weight: 600; }
.pcard-specs .rate, .rate { color: var(--blue); font-weight: 700; }
.pcard .btn { margin-top: auto; }

.avatar-light { background: var(--light); border-color: transparent; color: var(--blue-deep); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.05rem; }
.badge-verified {
  flex: none; font-size: 0.7rem; font-weight: 700;
  color: var(--blue-deep); background: var(--light);
  padding: 5px 10px; border-radius: 20px; white-space: nowrap;
}

.empty { color: var(--muted); padding: 32px; text-align: center; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Kandidaat-detail modal */
.detail-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.detail-head h3 { font-size: 1.3rem; }
.detail-sub { color: var(--muted); font-size: 0.92rem; }
.detail-avail {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--light); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
}
.detail-avail span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue-deep); }
.detail-avail strong { color: var(--ink); }
.detail-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; margin-bottom: 16px; }
.detail-specs > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.detail-specs dt { color: var(--muted); }
.detail-specs dd { font-weight: 600; text-align: right; }
.detail-note { color: var(--muted); font-size: 0.92rem; background: var(--mist); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.detail-cv {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 18px;
}
.detail-cv .file-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--light); display: grid; place-items: center; font-size: 1.2rem; }
.detail-cv b { display: block; font-size: 0.92rem; }
.detail-cv small { color: var(--muted); font-size: 0.8rem; }
.detail-cv .btn { margin-left: auto; }
.detail-actions { display: flex; gap: 12px; }
.detail-actions .btn { flex: 1; }

/* Mijn aanvragen / aanvraaglijst */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 1.3rem; }
.req-form {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 22px;
}
.req-form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; }
.req-form input, .req-form select, .req-form textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 0.95rem;
  padding: 10px 13px; border: 1.5px solid var(--line);
  border-radius: 9px; background: var(--paper); color: var(--text);
}
.req-form input:focus, .req-form select:focus, .req-form textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.req-form input.invalid { border-color: #e5484d; }

.portal-list { display: flex; flex-direction: column; gap: 14px; }
.reqcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.reqcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.reqcard-top strong { font-size: 1.02rem; }
.reqcard-org { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.reqcard-tag { flex: none; font-size: 0.72rem; font-weight: 700; color: var(--blue-deep); background: var(--light); padding: 5px 10px; border-radius: 20px; }
.reqcard-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.86rem; color: var(--muted); margin-bottom: 8px; }
.reqcard-meta .rate { color: var(--blue); font-weight: 700; }
.reqcard-desc { font-size: 0.92rem; color: var(--text); }

/* Mijn profiel */
.profile-card, .profile-empty {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
  max-width: 760px;
}
.profile-empty { text-align: center; }
.profile-empty h2 { margin-bottom: 8px; }
.profile-empty p { color: var(--muted); margin-bottom: 20px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.profile-head h2 { font-size: 1.4rem; }
.profile-live { margin-left: auto; font-size: 0.82rem; font-weight: 700; color: #157347; }
.profile-hint { margin-top: 16px; font-size: 0.85rem; color: var(--muted); }

/* Beschikbaarheidskalender */
.avail-cal { margin: 18px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.avail-cal-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.avail-hint { font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.avail-mode-bar { display: flex; gap: 6px; margin: 12px 0; background: var(--mist); padding: 4px; border-radius: 10px; width: fit-content; }
.avail-mode {
  font: inherit; font-weight: 600; font-size: 0.85rem;
  padding: 8px 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.avail-mode.is-active { background: var(--paper); color: var(--text); box-shadow: var(--shadow); }
.avail-cal-nav { display: flex; gap: 8px; margin: 10px 0 14px; }
.avail-day.is-pending { box-shadow: 0 0 0 2px var(--blue); }
.avail-save-bar {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 12px 14px;
  background: var(--mist); border-radius: 10px;
  font-size: 0.88rem; color: var(--muted);
}
.avail-save-bar strong, .avail-save-bar span { flex: 1; }
.avail-cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.avail-month-head { font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; text-transform: capitalize; }
.avail-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.avail-dow span { text-align: center; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; }
.avail-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.avail-day {
  aspect-ratio: 1; display: grid; place-items: center;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--text); cursor: default;
}
.avail-day.is-empty { border-color: transparent; background: transparent; }
button.avail-day { cursor: pointer; }
button.avail-day:hover:not(:disabled) { border-color: var(--blue); }
button.avail-day:disabled { cursor: not-allowed; opacity: .55; }
.avail-day.available { background: #e9f9f0; border-color: #bfe8d1; color: #157347; }
.avail-day.unavailable { background: #fdecee; border-color: #f3c1c6; color: #c2333a; }
.avail-day.booked { background: var(--light); border-color: #b9cdf3; color: var(--blue-deep); }
.avail-day.is-locked { background: repeating-linear-gradient(135deg, var(--light), var(--light) 4px, #cfe0fb 4px, #cfe0fb 8px); }
.avail-day.is-today { box-shadow: 0 0 0 2px var(--blue); }
.avail-day.is-past { opacity: .45; }
.avail-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.avail-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.avail-legend .dot.available { background: #157347; }
.avail-legend .dot.unavailable { background: #c2333a; }
.avail-legend .dot.booked { background: var(--blue-deep); }

/* Klikbare aanvraagkaart */
.reqcard.clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.reqcard.clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.reqcard-manage { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--blue-deep); }

/* Chips / specialiteiten */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .82rem; font-weight: 600; color: var(--blue-deep); background: var(--light); padding: 5px 12px; border-radius: 20px; display: inline-flex; align-items: center; gap: 6px; }
.chip-edit button { border: 0; background: none; color: var(--blue-deep); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.muted-text { color: var(--muted); font-size: .88rem; }
.detail-tags { margin-bottom: 16px; }
.detail-tags dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.detail-bio { color: var(--text); font-size: .95rem; background: var(--mist); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; line-height: 1.55; }
.profile-bio { margin-bottom: 18px; }
.profile-bio h4 { font-size: .95rem; margin-bottom: 6px; }
.profile-bio p { color: var(--muted); font-size: .95rem; line-height: 1.55; }

/* Profiel bewerken */
.profile-edit .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-edit label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
.profile-edit input, .profile-edit select, .profile-edit textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: .95rem;
  padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--text);
}
.profile-edit input:focus, .profile-edit select:focus, .profile-edit textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.spec-editor { margin-bottom: 18px; }
.spec-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.spec-add { display: flex; gap: 8px; margin-top: 10px; }
.spec-add input { flex: 1; font: inherit; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 9px; }
.spec-add input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* Mini-reactielijst in aanvraagbeheer */
.mini-title { font-size: .95rem; margin: 6px 0 12px; }
.mini-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.mini-conn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mini-conn-main { min-width: 0; flex: 1; }
.mini-conn-main strong { display: block; font-size: .92rem; }
.mini-conn-main span { font-size: .8rem; color: var(--muted); }
.mini-conn-actions { display: flex; gap: 8px; align-items: center; }
.reacted.big { font-size: .95rem; }
.req-form-title { font-size: 1.1rem; margin-bottom: 16px; }

/* Tab-badges */
.tab-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 20px;
  background: var(--blue); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  vertical-align: middle;
}
.tab-badge[hidden] { display: none; }
.panel-title { font-size: 1.15rem; margin: 4px 0 16px; }
.panel-title:not(:first-child) { margin-top: 32px; }

/* Berichten-inbox */
.msgthread {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease;
}
.msgthread:hover { box-shadow: var(--shadow); border-color: #c9d5e8; }
.msgthread.is-unread { border-color: var(--blue); background: var(--blue-soft); }
.msgthread-main { flex: 1; min-width: 0; }
.msgthread-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.msgthread-top strong { font-size: 0.96rem; }
.msgthread-sub { font-size: 0.78rem; color: var(--muted); }
.msgthread-preview { font-size: 0.88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgthread.is-unread .msgthread-preview { color: var(--text); font-weight: 600; }
.msgthread-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.msgthread-when { font-size: 0.76rem; color: var(--muted); }
.msgthread-badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  background: var(--blue); color: #fff;
  font-size: 0.72rem; font-weight: 700; border-radius: 20px;
}

/* Aanvraag-voettekst */
.reqcard-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.reacted { font-size: 0.85rem; font-weight: 700; color: #157347; }
.reactcount { font-size: 0.85rem; font-weight: 600; color: var(--blue-deep); }

/* Verbindingskaart */
.conncard {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.conncard.is-match { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--shadow); }
.conncard-main { min-width: 0; flex: 1 1 200px; }
.conncard-main strong { display: block; font-size: 0.98rem; }
.conncard-main span { font-size: 0.85rem; color: var(--muted); }
.conncard-side { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.conn-status { font-size: 0.8rem; font-weight: 700; }
.conn-status.open { color: var(--muted); }
.conn-status.match { color: #157347; }
.conn-msgs { font-size: 0.76rem; color: var(--blue-deep); }
.conncard-actions { display: flex; gap: 8px; margin-left: auto; }

/* Chat */
.chat-panel { display: flex; flex-direction: column; max-width: 480px; height: min(70vh, 560px); padding: 0; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
.chat-head strong { font-size: 1.02rem; display: block; }
.chat-head span { font-size: 0.82rem; color: var(--muted); }
.chat-status { font-size: 0.8rem; font-weight: 700; color: #157347; white-space: nowrap; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; background: var(--mist); }
.chat-empty { color: var(--muted); font-size: 0.9rem; text-align: center; margin: auto; }
.msg { max-width: 78%; }
.msg p {
  padding: 10px 14px; border-radius: 14px;
  font-size: 0.92rem; line-height: 1.4;
}
.msg.me { align-self: flex-end; }
.msg.me p { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; }
.msg.them p { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form input {
  flex: 1; font: inherit; font-size: 0.95rem;
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
}
.chat-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

@media (max-width: 480px) {
  .login-demos { grid-template-columns: 1fr; }
  .login-card { padding: 26px 22px; }
}

@media (max-width: 640px) {
  .avail-cal-months { grid-template-columns: 1fr; }
  .conncard-actions { margin-left: 0; width: 100%; }
  .conncard-actions .btn { flex: 1; }
  .portal-bar-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .portal-roleswitch { margin-left: 0; order: 3; width: 100%; }
  .role-btn { flex: 1; }
  .portal-who { display: none; }
  .detail-specs { grid-template-columns: 1fr; }
  .req-form .form-row { grid-template-columns: 1fr; gap: 0; }
}
