/* =============================================================
   EnergieLuitjes — Gebruikersportaal CSS
   Consistente huisstijl met het admin panel
   ============================================================= */

:root {
  --green-dark:  #1a5c3a;
  --green-mid:   #2d8653;
  --green-light: #4caf78;
  --green-pale:  #e8f5ee;
  --accent:      #f0b429;
  --text-dark:   #111827;
  --text-mid:    #4b5563;
  --text-light:  #9ca3af;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --sidebar-w:   240px;
  --topbar-h:    60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--gray-100);
  min-height: 100vh;
  display: flex;
}

/* ─── SIDEBAR ─── */

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  border-radius: 0;
}

.sidebar-nav li a svg {
  width: 18px; height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.sidebar-nav li a:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
}

.sidebar-nav li.active a {
  background: rgba(255,255,255,.15);
  color: var(--white);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 14px 20px 4px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user-info {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  margin-bottom: 10px;
  line-height: 1.4;
}

.sidebar-user-info strong {
  color: var(--white);
  display: block;
  font-size: 13px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}

.logout-link svg {
  width: 16px; height: 16px;
  fill: currentColor;
}

.logout-link:hover { color: var(--white); }

/* ─── MAIN CONTENT ─── */

.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(--gray-200);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.page-header-sub {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 2px;
}

.content-area {
  padding: 24px 28px;
  flex: 1;
}

.page-footer {
  padding: 16px 28px;
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

/* ─── CARDS ─── */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.card-body {
  padding: 20px;
}

/* ─── STAT CARDS ─── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card.stat-green {
  background: var(--green-pale);
  border-color: var(--green-light);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 500;
}

/* ─── STATUS BANNER ─── */

.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid;
}

.status-banner.status-nieuw { background: #eff6ff; border-color: #bfdbfe; }
.status-banner.status-in_behandeling { background: #fffbeb; border-color: #fde68a; }
.status-banner.status-goedgekeurd { background: var(--green-pale); border-color: #6ee7b7; }
.status-banner.status-afgewezen { background: #fef2f2; border-color: #fecaca; }
.status-banner.status-geannuleerd { background: var(--gray-100); border-color: var(--gray-200); }

.status-icon { font-size: 28px; }

.status-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.status-info p { font-size: 13px; color: var(--text-mid); }

/* ─── TIJDLIJN ─── */

.timeline {
  list-style: none;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 1;
}

.timeline-dot.dot-green {
  border-color: var(--green-mid);
  background: var(--green-pale);
}

.timeline-dot.dot-blue {
  border-color: #3b82f6;
  background: #eff6ff;
}

.timeline-date {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.timeline-body {
  font-size: 12.5px;
  color: var(--text-mid);
  margin-top: 3px;
}

/* ─── DETAIL GRID ─── */

.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  align-items: start;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  padding-top: 2px;
}

.detail-value {
  font-size: 13.5px;
  color: var(--text-dark);
}

/* ─── BADGES ─── */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ─── KNOPPEN ─── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}

.btn:hover { opacity: .88; }

.btn-primary {
  background: var(--green-mid);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--green-mid);
  border: 1.5px solid var(--green-mid);
}

.btn-gray {
  background: var(--gray-100);
  color: var(--text-dark);
  border: 1px solid var(--gray-200);
}

.btn-danger {
  background: #ef4444;
  color: var(--white);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* ─── FORMULIEREN ─── */

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-dark); }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color .15s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-mid);
}

.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--text-light); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

/* ─── MELDINGEN ─── */

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ─── TABEL ─── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-dark);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

/* ─── LOGIN PAGINA ─── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  padding: 24px;
}

.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 24px;
}

.login-box h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.login-box p.subtitle {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 24px;
}

/* ─── UITBETALING TABEL ─── */

.amount { font-weight: 700; color: var(--green-dark); }
.amount-net { font-size: 16px; color: var(--green-mid); }

/* ─── STAT KAART ICOON ─── */

.stat-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

/* ─── EERSTE UITBETALING BANNER ─── */

.first-payout-banner {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border: none;
  color: var(--white);
}

.first-payout-banner .card-body {
  padding: 24px;
}

/* ─── GRAFIEK ─── */

.chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-bottom: 36px; /* ruimte voor labels */
  position: relative;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.chart-bars {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: flex-end;
}

.chart-bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  transition: opacity .15s;
  cursor: default;
  min-height: 4px;
}

.chart-bar:hover { opacity: .8; }

.chart-bar-kwh { background: #4caf78; }
.chart-bar-net { background: var(--green-dark); }

.chart-label-top {
  font-size: 10px;
  font-weight: 700;
  color: var(--green-dark);
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-label-bottom {
  font-size: 11px;
  color: var(--text-light);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-label-kwh {
  font-size: 9.5px;
  color: var(--text-light);
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 48px;
  font-size: 12px;
  color: var(--text-mid);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── TAKENLIJST (ONBOARDING) ─── */

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.task-item:last-child { border-bottom: none; }

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--white);
  background: var(--white);
}

.task-item.task-done .task-check {
  background: var(--green-mid);
  border-color: var(--green-mid);
}

.task-text { flex: 1; }

.task-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.task-item.task-done .task-label {
  color: var(--text-light);
  text-decoration: line-through;
}

.task-hint {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 2px;
}

/* ─── VRIENDEN PAGINA ─── */

.referral-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.referral-hero-icon {
  font-size: 40px;
  flex-shrink: 0;
  line-height: 1;
}

.referral-code-box {
  background: var(--gray-50);
  border: 2px dashed var(--green-mid);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}

.referral-code-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

.referral-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--green-dark);
}

.referral-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .15s;
}

.referral-link-box:hover { background: var(--gray-100); }

.referral-link-text {
  flex: 1;
  font-size: 12px;
  color: var(--green-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── FEE BREAKDOWN ─── */

.fee-display {
  text-align: center;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 16px;
}

.fee-value {
  font-size: 52px;
  font-weight: 900;
  color: var(--green-dark);
  line-height: 1;
}

.fee-label {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 6px;
}

.fee-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
}

.fee-row-base {
  color: var(--text-mid);
  background: var(--gray-50);
}

.fee-row-discount {
  color: var(--green-dark);
  background: var(--green-pale);
  font-weight: 600;
}

.fee-row-total {
  color: var(--text-dark);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  margin-top: 4px;
}

/* ─── HOE WERKT HET LIJST ─── */

.how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.how-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.how-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-mid);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.how-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.how-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.how-text span {
  font-size: 12.5px;
  color: var(--text-mid);
}

/* ─── RESPONSIEF ─── */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 120px 1fr; }
  .chart-label-kwh { display: none; }
  .referral-hero { flex-direction: column; gap: 12px; }
}
