/* ═══════════════════════════════════════════════════════════════════════
   Personeelsdossier — Dé Plek BSO
   Kleuren: --groen #13342B, --lichtgroen #86C79D, --oranje #E37A41, --creme #F5F0E8
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --groen: #13342B;
  --lichtgroen: #86C79D;
  --oranje: #E37A41;
  --creme: #F5F0E8;
  --wit: #ffffff;
  --grijs-50: #f9fafb;
  --grijs-100: #f3f4f6;
  --grijs-200: #e5e7eb;
  --grijs-300: #d1d5db;
  --grijs-400: #9ca3af;
  --grijs-500: #6b7280;
  --grijs-700: #374151;
  --rood: #dc2626;
  --rood-licht: #fef2f2;
  --sidebar-w: 260px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--grijs-50);
  color: var(--grijs-700);
  font-size: 14px;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ─── Login ──────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--creme);
}

.login-card {
  background: var(--wit);
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { color: var(--groen); font-size: 28px; font-weight: 700; }
.login-logo p { color: var(--grijs-500); margin-top: 4px; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--grijs-700);
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--grijs-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--lichtgroen);
  box-shadow: 0 0 0 3px rgba(134,199,157,.25);
}
textarea { resize: vertical; min-height: 80px; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.error-msg {
  background: var(--rood-licht);
  color: var(--rood);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--groen); color: var(--wit); }
.btn-primary:hover { background: #1a4a3a; }
.btn-secondary { background: var(--grijs-200); color: var(--grijs-700); }
.btn-orange { background: var(--oranje); color: var(--wit); }
.btn-danger { background: var(--rood); color: var(--wit); }
.btn-ghost { background: transparent; color: var(--grijs-500); }
.btn-ghost:hover { background: var(--grijs-100); }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── App layout ─────────────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--groen);
  color: var(--wit);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header h2 { font-size: 20px; font-weight: 700; }
.sidebar-sub { font-size: 12px; color: var(--lichtgroen); }

.sidebar-filter {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-filter label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--lichtgroen);
  margin-bottom: 4px;
  display: block;
}
.sidebar-filter select {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--wit);
  padding: 6px 10px;
  font-size: 13px;
}
.sidebar-filter select option { color: var(--grijs-700); background: var(--wit); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--wit); }
.nav-item.active { background: rgba(255,255,255,.12); color: var(--wit); font-weight: 500; }
.nav-icon { font-size: 16px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--lichtgroen);
  color: var(--groen);
  font-weight: 600;
  text-transform: uppercase;
}

/* ─── Main content ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px 32px;
  max-width: 1200px;
}

/* ─── Page header ────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; color: var(--groen); font-weight: 700; }

.page-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  width: 260px;
  padding: 7px 12px 7px 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

/* ─── Cards & Tables ─────────────────────────────────────────────────── */
.card {
  background: var(--wit);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--grijs-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 16px; color: var(--groen); }
.card-body { padding: 20px; }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--grijs-200);
}
th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--grijs-500);
  background: var(--grijs-50);
}
tr:hover td { background: var(--grijs-50); }
tr.clickable { cursor: pointer; }

/* ─── Status badges ──────────────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.status-actief { background: #dcfce7; color: #166534; }
.status-kandidaat { background: #fef3c7; color: #92400e; }
.status-archief { background: var(--grijs-200); color: var(--grijs-500); }
.status-concept { background: #dbeafe; color: #1e40af; }
.status-ondertekend { background: #dcfce7; color: #166534; }

/* ─── Detail page ────────────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.detail-header .back-link {
  color: var(--grijs-500);
  text-decoration: none;
  font-size: 20px;
  cursor: pointer;
}
.detail-header .back-link:hover { color: var(--groen); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.info-label { font-weight: 500; color: var(--grijs-500); }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--grijs-200);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--grijs-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab:hover { color: var(--groen); }
.tab.active { color: var(--groen); border-bottom-color: var(--oranje); }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--wit);
  border-radius: 12px;
  width: 560px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grijs-200);
}
.modal-header h3 { font-size: 18px; color: var(--groen); }
.modal-close {
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--grijs-400);
}
.modal-body { padding: 24px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--grijs-200);
  margin-top: 20px;
}

/* ─── Empty state ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--grijs-400);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ─── Loading ────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px; color: var(--grijs-400); }

/* ─── Tab content ────────────────────────────────────────────────────── */
.tab-content.hidden { display: none; }

/* ─── Placeholder tabel (handleiding) ────────────────────────────────── */
.placeholder-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.placeholder-table th {
  text-align: left; padding: 8px 12px; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--grijs-500);
  border-bottom: 2px solid var(--grijs-200);
}
.placeholder-table td { padding: 8px 12px; border-bottom: 1px solid var(--grijs-100); }
.placeholder-table td:first-child { font-weight: 500; white-space: nowrap; }
.placeholder-table td:last-child { color: var(--grijs-400); font-size: 12px; white-space: nowrap; }
.placeholder-table tbody tr:hover { background: var(--grijs-50); }

/* ─── Toast / notifications ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--groen);
  color: var(--wit);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideIn .3s ease;
}
.toast.error { background: var(--rood); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } }

/* ─── Periodieken ────────────────────────────────────────────────────── */
.periodiek-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-aandacht { background: #fff3e0; color: #e65100; }
.badge-binnenkort { background: #fbe9e7; color: #bf360c; }
.badge-verlopen { background: #ffcdd2; color: #b71c1c; }
.badge-max { background: #e3f2fd; color: #1565c0; }

.row-verlopen { background: #fff5f5 !important; }
.row-binnenkort { background: #fffbf0 !important; }
.row-aandacht { background: #fffdf5 !important; }

.periodieken-legenda {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.legenda-item { display: flex; align-items: center; gap: 4px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-verlopen { background: #ef5350; }
.dot-binnenkort { background: #ff9800; }
.dot-aandacht { background: #ffc107; }
.dot-ok { background: #66bb6a; }
.dot-max { background: #42a5f5; }

/* Notificatie badge in sidebar */
.notificatie-badge {
  background: var(--oranje);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: auto;
}

/* Notificatie lijst */
.notificatie-lijst {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notificatie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fffdf5;
  border-radius: 6px;
  border: 1px solid #f0e8d0;
}
.notificatie-tekst {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notificatie-tekst small { color: #999; font-size: 0.78rem; }

/* Nav item met badge: flex */
.nav-item {
  display: flex;
  align-items: center;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; }
  .main-content { margin-left: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}
