/* ============================================
   EXPERTISE TOTAAL — PORTAAL STIJLEN
   ============================================ */

/* LOGIN */
.portaal-login-body {
  min-height: 100vh;
  background: var(--warm-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 4px 40px rgba(0,0,0,.1);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 44px; margin: 0 auto 16px; }
.login-logo h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--navy); margin-bottom: 6px; }
.login-logo p { font-size: 14px; color: var(--text-light); }

.login-error {
  background: #FEF2F2; border: 1px solid #FCA5A5; color: #DC2626;
  padding: 12px 16px; border-radius: 8px; font-size: 14px;
  margin-bottom: 20px; display: none;
}

.demo-accounts { background: var(--cool-bg); border-radius: 8px; padding: 16px; margin-top: 24px; }
.demo-accounts h4 { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.demo-account {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--gray-200);
  cursor: pointer; transition: opacity .15s;
}
.demo-account:last-child { border-bottom: none; }
.demo-account:hover { opacity: .75; }
.demo-role {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0;
}
.demo-role.mw { background: var(--navy); color: white; }
.demo-role.kl { background: var(--orange-light); color: var(--orange-dark); }
.demo-email { font-size: 13px; color: var(--text); flex: 1; }
.demo-pass { font-size: 12px; color: var(--text-light); }

/* NAV PORTAAL KNOP */
.nav-portaal {
  border: 1.5px solid rgba(255,255,255,.3) !important;
  margin-left: 4px;
}
.nav-portaal:hover {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.55) !important;
  color: white !important;
}

/* PORTAAL TOPBAR */
.portaal-topbar {
  background: var(--navy);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.portaal-topbar .logo-img { height: 30px; }
.portaal-topbar-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.4); }
.portaal-user {
  margin-left: auto; display: flex; align-items: center;
  gap: 10px; color: rgba(255,255,255,.8); font-size: 14px;
}
.portaal-avatar {
  width: 32px; height: 32px; background: var(--orange); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.portaal-logout-btn {
  background: rgba(255,255,255,.1); border: none; color: rgba(255,255,255,.7);
  padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer;
  transition: background .15s; font-family: var(--font-body);
}
.portaal-logout-btn:hover { background: rgba(255,255,255,.18); color: white; }

/* PORTAAL MAIN */
.portaal-layout { min-height: 100vh; display: flex; flex-direction: column; }
.portaal-main {
  flex: 1; background: var(--cool-bg); padding: 32px 28px;
  max-width: 1200px; width: 100%; margin: 0 auto;
}

/* STATS */
.portal-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 20px 24px; border: 1px solid var(--gray-200);
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--navy); line-height: 1; margin-bottom: 6px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); font-weight: 500; }
.stat-card.nieuw .stat-value { color: #2563EB; }
.stat-card.behandeling .stat-value { color: var(--orange); }
.stat-card.afgerond .stat-value { color: #16A34A; }

/* FILTERS */
.portal-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 16px; border-radius: 20px; border: 1.5px solid var(--gray-200);
  background: white; color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: var(--font-body);
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.filter-btn.nieuw.active { background: #2563EB; border-color: #2563EB; }
.filter-btn.behandeling.active { background: var(--orange); border-color: var(--orange); }
.filter-btn.afgerond.active { background: #16A34A; border-color: #16A34A; }
.portal-search { margin-left: auto; }
.portal-search input {
  padding: 8px 16px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; color: var(--navy);
  background: white; width: 220px; transition: border-color .2s;
}
.portal-search input:focus { outline: none; border-color: var(--orange); }

/* CASES TABLE */
.cases-table { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; }
.cases-table table { width: 100%; border-collapse: collapse; }
.cases-table th {
  padding: 13px 20px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-light);
  background: var(--cool-bg); border-bottom: 1px solid var(--gray-200);
}
.cases-table td {
  padding: 16px 20px; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--gray-200); vertical-align: middle;
}
.cases-table tr:last-child td { border-bottom: none; }
.cases-table tbody tr { cursor: pointer; transition: background .15s; }
.cases-table tbody tr:hover { background: var(--cool-bg); }
.case-id { font-size: 12px; color: var(--text-light); font-weight: 600; }
.case-klant { font-weight: 600; color: var(--navy); }
.case-klant-email { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* STATUS BADGES */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-badge[data-status="Nieuw"] { background: #EFF6FF; color: #1D4ED8; }
.status-badge[data-status="Nieuw"]::before { background: #2563EB; }
.status-badge[data-status="In behandeling"] { background: #FFF7ED; color: #C2410C; }
.status-badge[data-status="In behandeling"]::before { background: var(--orange); }
.status-badge[data-status="Afgerond"] { background: #F0FDF4; color: #15803D; }
.status-badge[data-status="Afgerond"]::before { background: #16A34A; }

/* BACK BTN */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-light);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: color .15s;
  background: none; border: none; padding: 0; margin-bottom: 20px; font-family: var(--font-body);
}
.back-btn:hover { color: var(--navy); }

/* CASE HEADER */
.case-header {
  background: white; border-radius: var(--radius); border: 1px solid var(--gray-200);
  padding: 28px 32px; margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.case-header-id { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); margin-bottom: 6px; }
.case-header h1 { font-family: var(--font-display); font-size: 1.6rem; color: var(--navy); margin-bottom: 4px; }
.case-header-dienst { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.case-header-meta { display: flex; gap: 28px; flex-wrap: wrap; }
.case-meta-item { font-size: 14px; color: var(--text-light); }
.case-meta-item strong { color: var(--navy); display: block; font-size: 13px; margin-bottom: 2px; }
.case-status-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.status-select {
  padding: 8px 14px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--navy);
  cursor: pointer; background: white; transition: border-color .2s;
}
.status-select:focus { outline: none; border-color: var(--orange); }

/* TABS */
.case-tabs {
  display: flex; background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--gray-200); border-bottom: none; overflow: hidden;
}
.tab-btn {
  padding: 14px 26px; border: none; background: none; font-family: var(--font-body);
  font-size: 15px; font-weight: 500; color: var(--text-light); cursor: pointer;
  border-bottom: 3px solid transparent; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--orange); font-weight: 600; }
.tab-panel {
  background: white; border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--gray-200); border-top: none; display: none;
}
.tab-panel.active { display: block; }

/* DOSSIER TAB */
.dossier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 28px 32px 8px; }
.dossier-field { margin-bottom: 20px; }
.dossier-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); display: block; margin-bottom: 5px; }
.dossier-field p { font-size: 15px; color: var(--navy); }
.dossier-omschrijving { padding: 0 32px 28px; }
.dossier-omschrijving label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); display: block; margin-bottom: 8px; padding-top: 4px; border-top: 1px solid var(--gray-200); padding-top: 20px; }
.dossier-omschrijving p { font-size: 15px; color: var(--text); line-height: 1.7; background: var(--cool-bg); padding: 16px; border-radius: 8px; }

/* BERICHTEN */
.berichten-wrap { display: flex; flex-direction: column; height: 500px; }
.berichten-lijst {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.bericht { display: flex; gap: 10px; max-width: 78%; }
.bericht.inkomend { align-self: flex-start; }
.bericht.uitgaand { align-self: flex-end; flex-direction: row-reverse; }
.bericht-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; align-self: flex-end;
}
.bericht.inkomend .bericht-avatar { background: var(--navy-mid); }
.bericht.uitgaand .bericht-avatar { background: var(--orange); }
.bericht-bubble {
  padding: 11px 15px; border-radius: 16px; font-size: 14px;
  line-height: 1.6; max-width: 100%;
}
.bericht.inkomend .bericht-bubble { background: var(--cool-bg); color: var(--navy); border-bottom-left-radius: 4px; }
.bericht.uitgaand .bericht-bubble { background: var(--navy); color: white; border-bottom-right-radius: 4px; }
.bericht-meta { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.bericht.inkomend .bericht-meta { text-align: left; }
.bericht.uitgaand .bericht-meta { text-align: right; }
.berichten-input {
  border-top: 1px solid var(--gray-200); padding: 14px 20px;
  display: flex; gap: 10px; align-items: flex-end;
}
.berichten-input textarea {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--gray-200);
  border-radius: 12px; font-family: var(--font-body); font-size: 14px;
  color: var(--navy); resize: none; min-height: 44px; max-height: 100px;
  transition: border-color .2s; line-height: 1.5;
}
.berichten-input textarea:focus { outline: none; border-color: var(--orange); }
.btn-send {
  background: var(--orange); color: white; border: none; padding: 11px 18px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s; white-space: nowrap; font-family: var(--font-body);
}
.btn-send:hover { background: var(--orange-dark); }

/* DOCUMENTEN */
.documenten-wrap { padding: 24px 28px; }
.upload-zone {
  border: 2px dashed var(--gray-200); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; margin-bottom: 20px;
}
.upload-zone:hover { border-color: var(--orange-muted); background: var(--orange-light); }
.upload-zone .upload-icon { font-size: 28px; margin-bottom: 10px; }
.upload-zone p { font-size: 14px; color: var(--text-light); }
.upload-zone strong { color: var(--orange); }
.docs-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--cool-bg); border-radius: 8px; border: 1px solid var(--gray-200);
  transition: border-color .2s;
}
.doc-item:hover { border-color: var(--orange-muted); }
.doc-icon { font-size: 22px; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-naam { font-size: 14px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.doc-by { font-weight: 600; }
.doc-by.medewerker { color: var(--navy); }
.doc-by.klant { color: var(--orange-dark); }
.btn-download {
  font-size: 12px; color: var(--navy); font-weight: 600; padding: 6px 12px;
  border: 1px solid var(--gray-200); border-radius: 6px; transition: all .15s;
  white-space: nowrap; background: white; cursor: pointer; flex-shrink: 0;
}
.btn-download:hover { background: var(--navy); color: white; border-color: var(--navy); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 16px; padding: 40px; max-width: 560px;
  width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { font-family: var(--font-display); font-size: 1.4rem; color: var(--navy); }
.modal-close {
  background: none; border: none; font-size: 20px; color: var(--text-light);
  cursor: pointer; padding: 4px; transition: color .15s;
}
.modal-close:hover { color: var(--navy); }

/* KLANT VIEW */
.klant-status-banner {
  background: white; border-radius: var(--radius); border: 1px solid var(--gray-200);
  padding: 22px 28px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px;
}
.klant-status-icon { font-size: 36px; flex-shrink: 0; }
.klant-status-info h2 { font-family: var(--font-display); font-size: 1.25rem; color: var(--navy); margin-bottom: 4px; }
.klant-status-info p { font-size: 14px; color: var(--text-light); }
.klant-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.klant-card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; }
.klant-card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--gray-200); background: var(--cool-bg);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .klant-grid { grid-template-columns: 1fr; }
  .portal-stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .case-header { flex-direction: column; }
  .case-status-wrap { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .dossier-grid { grid-template-columns: 1fr; }
  .portaal-main { padding: 20px 16px; }
  .bericht { max-width: 90%; }
  .cases-table th:nth-child(4) { display: none; }
  .cases-table td:nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  .login-card { padding: 32px 24px; }
  .portal-stats { grid-template-columns: 1fr 1fr; }
  .portal-search { width: 100%; margin-left: 0; }
  .portal-search input { width: 100%; }
}
