/* ============================================================
   Vastgoed Platform — main.css
   Gedeeld design systeem voor alle pagina's
   ============================================================ */

:root {
  --kleur-achtergrond: #f7f8fa;
  --kleur-sidebar: #1a2332;
  --kleur-sidebar-tekst: #e8ecf0;
  --kleur-wit: #ffffff;
  --kleur-tekst: #1a1a2e;
  --kleur-subtekst: #6b7280;
  --kleur-border: #e5e7eb;
  --kleur-groen: #2d7d52;
  --kleur-oranje: #e07b3a;
  --kleur-rood: #c0392b;
  --kleur-blauw: #2563eb;

  /* EPC labels */
  --epc-aplus: #00a650;
  --epc-a: #50b848;
  --epc-b: #a8c83c;
  --epc-c: #ffd700;
  --epc-d: #ffb300;
  --epc-e: #ff8c00;
  --epc-f: #ff4500;
  --epc-g: #cc0000;

  --radius-kaart: 6px;
  --radius-badge: 4px;
  --schaduw: 0 1px 3px rgba(0, 0, 0, 0.08);
  --schaduw-zwaar: 0 4px 16px rgba(0, 0, 0, 0.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--kleur-tekst);
  background: var(--kleur-achtergrond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 { font-size: 32px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }

a {
  color: var(--kleur-blauw);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--kleur-tekst);
}

.muted { color: var(--kleur-subtekst); }
.klein { font-size: 12px; }
.rechts { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Kaart (card) ---------- */
.kaart {
  background: var(--kleur-wit);
  border: 1px solid var(--kleur-border);
  border-radius: var(--radius-kaart);
  box-shadow: var(--schaduw);
  padding: 20px;
}

.kaart-titel {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---------- EPC badge ---------- */
.badge-epc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  line-height: 1;
}
.badge-epc.epc-aplus { background: var(--epc-aplus); }
.badge-epc.epc-a { background: var(--epc-a); }
.badge-epc.epc-b { background: var(--epc-b); }
.badge-epc.epc-c { background: var(--epc-c); color: #1a1a2e; text-shadow: none; }
.badge-epc.epc-d { background: var(--epc-d); color: #1a1a2e; text-shadow: none; }
.badge-epc.epc-e { background: var(--epc-e); }
.badge-epc.epc-f { background: var(--epc-f); }
.badge-epc.epc-g { background: var(--epc-g); }
.badge-epc.epc-onbekend { background: #9ca3af; }

/* ---------- Score dot ---------- */
.score-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.score-dot.groen { background: var(--kleur-groen); }
.score-dot.oranje { background: var(--kleur-oranje); }
.score-dot.rood { background: var(--kleur-rood); }
.score-dot.grijs { background: #9ca3af; }

/* ---------- Algemene badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 500;
  background: #eef2f7;
  color: var(--kleur-subtekst);
}
.badge.rood { background: #fbe9e7; color: var(--kleur-rood); }
.badge.oranje { background: #fdf0e6; color: var(--kleur-oranje); }
.badge.groen { background: #e6f4ec; color: var(--kleur-groen); }
.badge.blauw { background: #e8effd; color: var(--kleur-blauw); }
.badge.grijs { background: #eef2f7; color: var(--kleur-subtekst); }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--kleur-border);
  border-radius: var(--radius-badge);
  background: var(--kleur-wit);
  color: var(--kleur-tekst);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  user-select: none;
}
.btn:hover { background: #f1f3f6; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--kleur-blauw);
  border-color: var(--kleur-blauw);
  color: #fff;
}
.btn-primary:hover { background: #1d4fd0; }

.btn-secondary {
  background: #eef1f5;
  border-color: #e0e4ea;
  color: var(--kleur-tekst);
}
.btn-secondary:hover { background: #e2e6ec; }

.btn-full { width: 100%; }

/* ---------- Tab bar ---------- */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--kleur-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  padding: 11px 16px;
  border: none;
  background: none;
  color: var(--kleur-subtekst);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--kleur-tekst); }
.tab.actief {
  color: var(--kleur-blauw);
  border-bottom-color: var(--kleur-blauw);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--kleur-border);
  border-top-color: var(--kleur-blauw);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-centraal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Lege staat ---------- */
.leeg-staat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--kleur-subtekst);
}
.leeg-staat svg { opacity: 0.4; }
.leeg-staat h3 { color: var(--kleur-tekst); }

/* ---------- Prijs tag ---------- */
.prijs-tag {
  font-size: 20px;
  font-weight: 600;
  color: var(--kleur-tekst);
}
.prijs-tag.groot { font-size: 32px; }
.prijs-tag.groen { color: var(--kleur-groen); }
.prijs-tag.rood { color: var(--kleur-rood); }

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-grid .stat {
  background: var(--kleur-wit);
  border: 1px solid var(--kleur-border);
  border-radius: var(--radius-kaart);
  box-shadow: var(--schaduw);
  padding: 16px;
}
.stat .stat-label {
  font-size: 12px;
  color: var(--kleur-subtekst);
  margin-bottom: 6px;
}
.stat .stat-waarde {
  font-size: 24px;
  font-weight: 600;
}

/* ---------- Detail/gegevens grid ---------- */
.gegevens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 24px;
}
.gegeven .gegeven-label {
  font-size: 12px;
  color: var(--kleur-subtekst);
}
.gegeven .gegeven-waarde {
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius-kaart);
  background: var(--kleur-tekst);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--schaduw-zwaar);
  animation: toast-in 0.25s ease;
}
.toast.succes { background: var(--kleur-groen); }
.toast.fout { background: var(--kleur-rood); }
.toast.uit { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* ---------- Top navigatie (markt/schatting) ---------- */
.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 24px;
  background: var(--kleur-sidebar);
  color: var(--kleur-sidebar-tekst);
}
.top-nav .logo {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.top-nav a {
  color: var(--kleur-sidebar-tekst);
  font-weight: 500;
  opacity: 0.8;
}
.top-nav a:hover { opacity: 1; text-decoration: none; }
.top-nav a.actief { opacity: 1; color: #fff; }

/* ---------- Form velden ---------- */
.veld { margin-bottom: 14px; }
.veld label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--kleur-subtekst);
  margin-bottom: 5px;
}
.invoer,
select.invoer {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--kleur-border);
  border-radius: var(--radius-badge);
  background: var(--kleur-wit);
  outline: none;
  transition: border-color 0.15s;
}
.invoer:focus { border-color: var(--kleur-blauw); }

/* ---------- Range slider ---------- */
input[type="range"] {
  width: 100%;
  accent-color: var(--kleur-blauw);
}

/* ---------- Knoppen-groep (segment) ---------- */
.knop-groep {
  display: inline-flex;
  border: 1px solid var(--kleur-border);
  border-radius: var(--radius-badge);
  overflow: hidden;
}
.knop-groep button {
  padding: 7px 14px;
  border: none;
  background: var(--kleur-wit);
  color: var(--kleur-subtekst);
  font-weight: 500;
  border-right: 1px solid var(--kleur-border);
}
.knop-groep button:last-child { border-right: none; }
.knop-groep button.actief {
  background: var(--kleur-blauw);
  color: #fff;
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-tussen { display: flex; justify-content: space-between; align-items: center; }
.flex-mid { display: flex; align-items: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.verborgen { display: none !important; }

/* ---------- Tabel ---------- */
.tabel {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tabel th,
.tabel td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--kleur-border);
}
.tabel th {
  font-size: 12px;
  font-weight: 600;
  color: var(--kleur-subtekst);
  background: #fafbfc;
}
.tabel tbody tr:hover { background: #fafbfc; }
.tabel td.num { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  h1 { font-size: 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .top-nav { gap: 14px; padding: 0 14px; overflow-x: auto; }
  .kaart { padding: 16px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}
