/* ============================================================
   declaratie-theme.css — Declaratiesysteem
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600&family=Inter:wght@400;500&display=swap');

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

:root {
  --navy:       #1B2A4A;
  --navy-dark:  #0F1B35;
  --navy-light: #2C3F6A;
  --gold:       #C9952A;
  --gold-light: #F5E6C0;
  --surface:    #F8F7F4;
  --white:      #FFFFFF;
  --border:     rgba(0,0,0,0.1);
  --border-s:   rgba(0,0,0,0.06);

  --text:       #1A1A1A;
  --text-m:     #6B7280;
  --text-l:     #9CA3AF;

  --red:        #C0392B;
  --red-bg:     #FADBD8;
  --red-text:   #7B241C;
  --orange:     #D68910;
  --orange-bg:  #FDEBD0;
  --orange-text:#784212;
  --green:      #1E8449;
  --green-bg:   #D5F5E3;
  --green-text: #0E5E34;

  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.1);

  --sidebar-w:  230px;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #ECEAE5;
}

h1, h2, h3, h4, .sora { font-family: 'Sora', sans-serif; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .logo-icon {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.sidebar-brand .logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand .app-naam {
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 600;
}
.sidebar-brand .klant-naam {
  color: rgba(255,255,255,0.5);
  font-size: 11px; margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.actief {
  background: rgba(201,149,42,0.18);
  color: var(--gold);
  border-left: 3px solid var(--gold);
  font-weight: 600;
}
.sidebar-nav a .icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-nav a .icon svg, .sidebar-nav a i { width: 16px; height: 16px; stroke: currentColor; }
.sidebar-nav .nav-groep {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 18px 4px;
}
.sidebar-nav .badge-nav {
  margin-left: auto;
  background: var(--gold); color: var(--navy);
  border-radius: 10px; font-size: 10px; font-weight: 700;
  padding: 1px 6px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
}
.sidebar-user .naam { font-size: 12px; color: rgba(255,255,255,0.85); }
.sidebar-user .rol  { font-size: 10px; color: rgba(255,255,255,0.45); }
.sidebar-user .uitloggen {
  margin-left: auto; color: rgba(255,255,255,0.4);
  font-size: 16px; cursor: pointer;
}
.sidebar-user .uitloggen:hover { color: var(--red); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-s);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.page-header h1 { font-size: 18px; font-weight: 600; }
.page-header .sub { font-size: 12px; color: var(--text-m); margin-top: 2px; }

.page-body { padding: 24px 28px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border-s);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-s);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 13px; font-weight: 500; font-family: 'Sora', sans-serif; }
.card-body { padding: 18px 20px; }

/* ── KPI TILES ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--border-s); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi.danger { background: var(--red-bg); border-color: rgba(192,57,43,0.2); }
.kpi.warning { background: var(--orange-bg); border-color: rgba(214,137,16,0.2); }
.kpi-label { font-size: 10px; color: var(--text-m); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.kpi.danger .kpi-label { color: var(--orange-text); }
.kpi.warning .kpi-label { color: var(--orange-text); }
.kpi-value { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 600; }
.kpi.danger .kpi-value { color: var(--red-text); }
.kpi.warning .kpi-value { color: var(--orange-text); }
.kpi-sub { font-size: 11px; color: var(--text-m); margin-top: 3px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: var(--surface); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-light); box-shadow: 0 2px 8px rgba(27,42,74,0.25); }
.btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.btn-gold:hover { background: #B8841F; box-shadow: 0 2px 8px rgba(201,149,42,0.3); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border-color: rgba(192,57,43,0.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 9px; font-size: 11px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-green  { background: #EAF3DE; border: 0.5px solid #97C459; color: #27500A; }
.badge-orange { background: #FAEEDA; border: 0.5px solid #EF9F27; color: #633806; }
.badge-red    { background: #FCEBEB; border: 0.5px solid #F09595; color: #791F1F; }
.badge-gray   { background: #F1EFE8; border: 0.5px solid #B4B2A9; color: #444441; }
.badge-navy   { background: #E6F1FB; border: 0.5px solid #85B7EB; color: #0C447C; }

/* Voeg toe aan een badge zonder icoon voor de gekleurde dot */
.badge-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.badge-green.badge-dot::before  { background: #639922; }
.badge-orange.badge-dot::before { background: #BA7517; }
.badge-red.badge-dot::before    { background: #E24B4A; }
.badge-gray.badge-dot::before   { background: #888780; }
.badge-navy.badge-dot::before   { background: #378ADD; }

/* ── ALERTS ── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; border-left: 3px solid; }
.alert-warning { background: var(--orange-bg); border-color: var(--orange); color: var(--orange-text); }
.alert-danger  { background: var(--red-bg);    border-color: var(--red);    color: var(--red-text); }
.alert-info    { background: #EBF5FB; border-color: #2E86C1; color: #1A5276; }
.alert-success { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }

/* ── FORMS ── */
.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 12px; color: var(--text-m); margin-bottom: 5px; font-weight: 500; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,42,74,0.1); }
.form-control.is-invalid { border-color: var(--red); }
.form-error { font-size: 11px; color: var(--red-text); margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── TABLE ── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; font-size: 10px; font-weight: 600; color: var(--text-m); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border-s); background: var(--surface); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border-s); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(0,0,0,0.015); }

/* ── PROGRESS BARS ── */
.pb-wrap { height: 8px; background: #E5E7EB; border-radius: 4px; overflow: hidden; }
.pb-fill  { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.pb-green  { background: var(--green); }
.pb-orange { background: var(--orange); }
.pb-red    { background: var(--red); }

/* ── LIMIET ROWS (BI) ── */
.limiet-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-s); }
.limiet-row:last-child { border-bottom: none; }
.limiet-naam  { font-size: 12px; font-weight: 500; min-width: 150px; }
.limiet-bedrag { font-size: 11px; min-width: 100px; text-align: right; white-space: nowrap; }

/* ── HANDTEKENING PAD ── */
.sig-wrap { position: relative; }
.sig-canvas-container {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: crosshair;
}
.sig-canvas-container canvas { display: block; }
.sig-label-overlay {
  position: absolute; bottom: 8px; left: 12px;
  font-size: 10px; color: var(--text-l);
  pointer-events: none;
}
.sig-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.sig-done .sig-canvas-container { border-color: var(--green); border-style: solid; }

/* ── STAP INDICATOR ── */
.steps { display: flex; align-items: center; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-m); white-space: nowrap; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: #E5E7EB; color: var(--text-m); flex-shrink: 0; }
.step.actief .step-num  { background: var(--navy); color: #fff; }
.step.klaar .step-num   { background: var(--green); color: #fff; }
.step.actief { color: var(--navy); font-weight: 500; }
.step.klaar  { color: var(--green-text); }
.step-lijn { flex: 1; height: 1px; background: #E5E7EB; margin: 0 10px; }

/* ── WACHTRIJ ITEM ── */
.wq-item { background: var(--white); border: 1px solid var(--border-s); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.wq-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.wq-titel { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; }
.wq-sub { font-size: 11px; color: var(--text-m); margin-top: 2px; }
.wq-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--surface); border-radius: var(--radius); }

/* ── GRIDS ── */
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-6-4   { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.col-4-6   { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(16px);
  transition: transform 0.2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-s); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 14px; font-weight: 600; font-family: 'Sora', sans-serif; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-s); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-m); font-size: 18px; line-height: 1; }
.modal-close:hover { color: var(--red); }

/* ── TOAST NOTIFICATIONS ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--white); border: 1px solid var(--border-s);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow-md);
  font-size: 13px; min-width: 260px; max-width: 360px;
  animation: toastIn 0.2s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── MISC ── */
.sep { border: none; border-top: 1px solid var(--border-s); margin: 16px 0; }
.footnote { font-size: 11px; color: var(--text-l); margin-top: 6px; }
.text-muted { color: var(--text-m); }
.text-danger { color: var(--red-text); }
.text-success { color: var(--green-text); }
.text-warning { color: var(--orange-text); }
.fw-500 { font-weight: 500; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 14px; }  .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 8px; }.mb-2 { margin-bottom: 14px; }.mb-3 { margin-bottom: 20px; }
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-2 { gap: 8px; }

/* ── LOGIN PAGINA ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0F1B35 0%, #1B2A4A 60%); padding: 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-logo img { width: 150px; height: 150px; object-fit: contain; }
.login-card { background: var(--white); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
  .col-6-4, .col-4-6, .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}

/* ── CHECKLIST ── */
.checklist-item { display: flex; align-items: center; gap: 8px; color: var(--text-l); transition: color 0.2s; }
.checklist-item.klaar { color: var(--green-text); font-weight: 500; }
.checklist-icon {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
.checklist-item.klaar .checklist-icon {
  background: var(--green); border-color: var(--green);
}
.checklist-icon svg { width: 10px; height: 10px; color: #fff; }

/* Lucide icons mogen NOOIT click events blokkeren - geldt voor alle iconen overal */
svg[class*="lucide"], i[data-lucide], i[data-lucide] svg,
.btn svg, .btn i, .btn i svg,
[onclick] svg, [onclick] i, [onclick] i svg,
button svg, button i, a svg, a i {
  pointer-events: none !important;
}
