/* ============================================================
   CAEMAN — Design System v3 "Sovereign"
   Geïnspireerd op Sovereign Estate stijl
   ============================================================ */

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

:root {
  /* Sidebar */
  --sidebar-bg:      #1a1f36;
  --sidebar-border:  rgba(255,255,255,.07);
  --sidebar-text:    rgba(255,255,255,.5);
  --sidebar-active:  rgba(255,255,255,.1);
  --sidebar-w:       260px;

  /* Page */
  --bg:        #f0f2f8;
  --surface:   #ffffff;
  --surface2:  #f8f9fc;
  --border:    #e8eaf0;
  --border-med:#d0d4e0;

  /* Typography */
  --text:      #1a1f36;
  --text-2:    #6b7280;
  --text-3:    #9ca3af;
  --font:      'Inter', system-ui, sans-serif;
  --font-display: 'Manrope', system-ui, sans-serif;

  /* Accent — groen */
  --accent:       #16a34a;
  --accent-dark:  #15803d;
  --accent-light: #dcfce7;

  /* Status */
  --green:       #16a34a;
  --green-light: #dcfce7;
  --amber:       #d97706;
  --amber-light: #fef3c7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --blue:        #2563eb;
  --blue-light:  #eff6ff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,31,54,.06), 0 1px 2px rgba(26,31,54,.04);
  --shadow:    0 4px 16px rgba(26,31,54,.08), 0 1px 4px rgba(26,31,54,.04);
  --shadow-lg: 0 10px 40px rgba(26,31,54,.12);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  line-height: 1.2;
}

.tagline {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav { padding: 16px 14px; flex: 1; }

.nav-label {
  font-size: 10px;
  color: rgba(255,255,255,.25);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 0 8px;
  margin: 20px 0 6px;
  font-weight: 600;
}

.nav-label:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.nav-item.active svg { opacity: 1; }
.nav-item svg { flex-shrink: 0; opacity: .65; }
.nav-dot { display: none; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: rgba(255,255,255,.3);
  line-height: 1.6;
}

.sidebar-user {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  margin-bottom: 2px;
}

/* ── Main ── */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

/* ── Topbar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.topbar-date { font-size: 12px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Content ── */
.content { padding: 28px 32px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover { background: #2d3456; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-med);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm  { padding: 6px 14px; font-size: 12px; }
.btn-xs  { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 6px 8px; color: var(--text-3); }
.btn-icon:hover { color: var(--red); border-color: var(--red); }
.btn-login {
  display: block; width: 100%; padding: 11px;
  background: var(--text); color: #fff; border: none;
  border-radius: var(--r-md); font-family: var(--font);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-login:hover { background: #2d3456; }
.btn-actions { display: flex; gap: 6px; align-items: center; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-sub { font-size: 13px; color: var(--text-3); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-ok       { background: var(--green-light); color: var(--green); }
.badge-soon     { background: var(--amber-light); color: var(--amber); }
.badge-overdue  { background: var(--red-light);   color: var(--red);   }
.badge-never    { background: var(--surface2);    color: var(--text-3); border: 1px solid var(--border-med); }
.badge-admin    { background: var(--blue-light);  color: var(--blue); }
.badge-actief   { background: var(--green-light); color: var(--green); }
.badge-inactief { background: var(--surface2);    color: var(--text-3); border: 1px solid var(--border-med); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span2 { grid-column: 1 / -1; }

.form-group label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea,
.select {
  padding: 9px 12px;
  border: 1.5px solid var(--border-med);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}

.form-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  grid-column: 1 / -1;
  margin-top: 4px;
}

.form-actions { display: flex; gap: 10px; padding-top: 4px; }

/* ── Zoekbare huurder-dropdown ── */
.hs-wrap  { position: relative; }
.hs-input { width: 100%; }
.hs-list  {
  display: none; position: fixed;
  background: var(--surface); border: 1px solid var(--border-med);
  border-radius: var(--r-md); box-shadow: var(--shadow); z-index: 600;
  max-height: 200px; overflow-y: auto;
}
.hs-list.open { display: block; animation: popIn .12s ease; }
.hs-item  { padding: 8px 12px; font-size: 13px; color: var(--text); cursor: pointer; }
.hs-item:hover { background: var(--surface2); }
.hs-empty { padding: 8px 12px; font-size: 13px; color: var(--text-3); }

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,31,54,.5);
  z-index: 600;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: flex; animation: fadeIn .15s ease; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px;
  width: 520px;
  max-width: 96vw;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  letter-spacing: -.02em;
}

.modal-sub  { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }
.modal-header { margin-bottom: 16px; }
.modal-body { margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; padding-top: 4px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 20px; line-height: 1;
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

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

/* ── Notifications ── */
.notif {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--text);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 14px 18px;
  min-width: 260px; max-width: 340px;
  z-index: 900;
  display: none;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow-lg);
}
.notif.visible { display: flex; animation: slideUp .2s ease; }
.notif-icon    { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.notif-content { flex: 1; }
.notif-title   { font-weight: 600; font-size: 13px; }
.notif-body    { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 2px; }
.notif-close   { background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; font-size: 16px; padding: 0; line-height: 1; }
.notif-close-btn { background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; font-size: 18px; padding: 0; margin-left: 8px; }

/* ── Animations ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn   { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Dropdown ── */
.more-dropdown {
  display: none;
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  min-width: 190px;
  z-index: 500;
  overflow: hidden;
  padding: 4px;
}
.more-dropdown.open { display: block; animation: popIn .15s ease; }

.more-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px; color: var(--text-2);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  border-radius: var(--r-sm);
  transition: background .1s;
  font-family: var(--font);
  font-weight: 500;
}
.more-item:hover { background: var(--surface2); color: var(--text); }
.more-item.danger { color: var(--red); }
.more-item.danger:hover { background: var(--red-light); }
.more-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--r-md); font-size: 13px; margin-bottom: 16px; }
.alert-ok      { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-err     { background: var(--red-light);   color: var(--red);   border: 1px solid #fca5a5; }
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #fca5a5; }
.alert-timeout { background: var(--amber-light); color: var(--amber); border: 1px solid #fde68a; }
.alert-info    { background: var(--blue-light);  color: var(--blue);  border: 1px solid #bfdbfe; }
.alert-warn    { background: var(--amber-light); color: var(--amber); border: 1px solid #fde68a; }
.alert-bar {
  display: flex; background: var(--amber-light);
  border: 1px solid #fde68a; border-radius: var(--r-md);
  padding: 14px 18px; margin-bottom: 20px; gap: 12px; align-items: flex-start;
}
.alert-title { font-weight: 600; color: var(--amber); font-size: 13px; }
.alert-item  { font-size: 12px; color: #78350f; padding: 2px 0; }

/* ============================================================
   Dashboard
   ============================================================ */

.kpi-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
}
.kpi-badge.red    { background: var(--red-light);   color: var(--red); }
.kpi-badge.amber  { background: var(--amber-light); color: var(--amber); }
.kpi-badge.green  { background: var(--green-light); color: var(--green); }

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-section {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3);
  margin: 16px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.porto-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.porto-row:last-child { border-bottom: none; }
.porto-adres  { font-size: 13px; font-weight: 600; color: var(--text); }
.porto-sub    { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.porto-right  { text-align: right; }
.porto-huur   { font-size: 13px; font-weight: 600; color: var(--text); }

.idx-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.idx-row:last-child { border-bottom: none; }
.idx-left   { flex: 1; min-width: 0; }
.idx-huurder { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx-adres  { font-size: 11px; color: var(--text-3); }
.idx-right  { text-align: right; flex-shrink: 0; margin-left: 12px; }
.idx-pct    { font-size: 13px; font-weight: 600; color: var(--green); }
.idx-datum  { font-size: 11px; color: var(--text-3); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  text-decoration: none; color: var(--text);
  transition: all .15s;
}
.quick-btn:hover { background: var(--surface); border-color: var(--border-med); box-shadow: var(--shadow-sm); }
.quick-icon  { width: 36px; height: 36px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-title { font-size: 13px; font-weight: 600; }
.quick-sub   { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.empty-state { text-align: center; padding: 28px; color: var(--text-3); font-size: 13px; }

/* ============================================================
   Gebouwen / Panden
   ============================================================ */
.section-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.gebouw-list   { display: flex; flex-direction: column; gap: 14px; }

.gebouw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.gebouw-card:hover { box-shadow: var(--shadow); }

.gebouw-header {
  padding: 18px 22px;
  display: flex; align-items: flex-start; justify-content: space-between;
  cursor: pointer; user-select: none; transition: background .15s;
  border-radius: var(--r-lg);
}
.gebouw-header:hover { background: var(--surface2); }

.gebouw-adres {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
}
.gebouw-meta-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.gebouw-meta-row span { font-size: 12px; color: var(--text-3); }

.gebouw-info-bar {
  padding: 12px 22px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 28px;
}
.gi-item  { display: flex; flex-direction: column; gap: 2px; }
.gi-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.gi-value { font-size: 13px; font-weight: 600; color: var(--text); }

.gebouw-right  { display: flex; align-items: center; gap: 12px; }
.gebouw-totaal { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.gebouw-totaal span { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 1px; }
.chevron { transition: transform .2s; color: var(--text-3); flex-shrink: 0; }
.gebouw-card.open .chevron { transform: rotate(180deg); }

.eenheden-wrap { display: none; }
.gebouw-card.open .eenheden-wrap { display: block; }

.eenheid-row {
  padding: 16px 22px; border-top: 1px solid var(--border);
  position: relative; padding-left: 32px;
}
.eenheid-row::before {
  content: ''; position: absolute; left: 22px; top: 0; bottom: 0;
  width: 3px; background: var(--border-med); border-radius: 2px;
}
.eenheid-row.status-overdue::before { background: var(--red); }
.eenheid-row.status-soon::before    { background: var(--amber); }
.eenheid-row.status-ok::before      { background: var(--green); }
.eenheid-row.status-never::before   { background: var(--border-med); }

.eenheid-top    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.eenheid-label  { font-size: 14px; font-weight: 600; color: var(--text); }
.eenheid-subtype{ font-size: 11px; color: var(--text-3); margin-top: 1px; }
.eenheid-meta   { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 10px; }
.meta-label     { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 3px; font-weight: 600; }
.meta-value     { font-size: 13px; font-weight: 600; color: var(--text); }
.eenheid-footer { display: flex; align-items: center; gap: 8px; }

.add-eenheid-row {
  padding: 14px 22px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.add-eenheid-hint { font-size: 12px; color: var(--text-3); }
.more-wrap        { position: relative; }

.hist-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hist-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 600; padding: 8px 10px;
  text-align: left; border-bottom: 1px solid var(--border);
}
.hist-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.hist-table tr:last-child td { border-bottom: none; }

.idx-result {
  font-size: 13px; margin-top: 12px; padding: 12px;
  background: var(--surface2); border-radius: var(--r-md); color: var(--text);
}
.result-new { color: var(--green); font-weight: 600; }
.empty { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }


/* ============================================================
   Historiek
   ============================================================ */
.adres-cell { font-weight: 600; color: var(--text); }
.pct        { color: var(--green); font-weight: 600; }

/* ============================================================
   Rendement
   ============================================================ */
.calc-grid    { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.inp-row      { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.inp-row:last-child { border-bottom: none; }
.inp-label    { font-size: 13px; color: var(--text-2); flex: 1; }
.inp-wrap     { display: flex; align-items: center; gap: 6px; }
.inp-wrap input {
  width: 110px; padding: 6px 10px;
  border: 1.5px solid var(--border-med); border-radius: var(--r-sm);
  font-family: var(--font); font-size: 12px; color: var(--text);
  background: var(--bg); text-align: right; outline: none;
  transition: border-color .15s, background .2s;
}
.inp-wrap input:focus { border-color: var(--accent); background: #fff; }
.inp-wrap input.from-fiche { border-color: #93c5fd; background: #eff6ff; }
.inp-unit   { font-size: 11px; color: var(--text-3); min-width: 14px; }
.inp-label  { font-size: 13px; color: var(--text-2); flex: 1; }

.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }

.rc-benchmark { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.rc-benchmark.ok   { background: var(--green-light); color: var(--green); }
.rc-benchmark.warn { background: var(--amber-light); color: var(--amber); }
.rc-benchmark.bad  { background: var(--red-light);   color: var(--red); }

.sum-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.sum-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sum-table tr:last-child td { border-bottom: none; font-weight: 600; }
.sum-table td:last-child { text-align: right; font-weight: 600; }
.total { border-top: 1px solid var(--border-med) !important; font-weight: 700 !important; }

.tabs { display: flex; gap: 2px; margin-bottom: 14px; background: var(--surface2); padding: 3px; border-radius: var(--r-md); width: fit-content; }
.tab  { padding: 7px 18px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-3); transition: all .15s; border: none; background: none; font-family: var(--font); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-content        { display: none; }
.tab-content.active { display: block; }
.table-scroll { overflow-x: auto; }

.groei-table, .aflos-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.groei-table th, .aflos-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 600; padding: 8px 12px;
  text-align: left; border-bottom: 1px solid var(--border);
  background: var(--surface2); white-space: nowrap;
}
.groei-table td, .aflos-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.groei-table tr:last-child td, .aflos-table tr:last-child td { border-bottom: none; }
.groei-table tr:hover td, .aflos-table tr:hover td { background: var(--surface2); }
.year-end { background: var(--surface2) !important; font-weight: 600; }

.preset-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface2); border-radius: var(--r-md); margin-bottom: 16px; flex-wrap: wrap; }
.preset-bar label { font-size: 13px; color: var(--text-2); font-weight: 500; white-space: nowrap; }

.active-scenario-bar { display: none; align-items: center; justify-content: space-between; background: var(--green-light); border: 1px solid #bbf7d0; border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 14px; }
.active-scenario-bar.visible { display: flex; }
.asb-name { font-size: 13px; font-weight: 600; color: var(--green); }
.asb-meta { font-size: 11px; color: var(--green); margin-top: 1px; }
.asb-actions { display: flex; gap: 8px; }

.sc-list { display: flex; flex-direction: column; gap: 8px; }
.sc-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; cursor: pointer; transition: all .15s;
}
.sc-card:hover { background: var(--surface); border-color: var(--border-med); box-shadow: var(--shadow-sm); }
.sc-card-active { border-color: var(--accent) !important; background: var(--surface) !important; }
.sc-card-top    { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.sc-naam        { font-size: 13px; font-weight: 600; color: var(--text); }
.sc-omschrijving { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.sc-badges      { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-badge       { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--surface2); color: var(--text-2); border: 1px solid var(--border); font-weight: 500; }
.sc-actions     { display: flex; gap: 6px; }

/* ============================================================
   Account / Gebruikers
   ============================================================ */
.info-row   { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-3); font-weight: 500; }
.result-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: none; }

.card-header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.user-name   { font-weight: 600; color: var(--text); }
.user-email  { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.hint        { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.toggle-track { position: relative; width: 32px; height: 18px; background: var(--border-med); border-radius: 9px; transition: background .2s; display: inline-block; }

/* ============================================================
   Rapport
   ============================================================ */
.report-wrap {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
.print-toolbar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.print-toolbar-info { font-size: 13px; color: var(--text-2); }

/* ============================================================
   Huurders
   ============================================================ */
.hk { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; transition: box-shadow .15s; }
.hk:hover { box-shadow: var(--shadow); }
.hk-top { padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; transition: background .15s; }
.hk-top:hover { background: var(--surface2); }
.hk-av { width: 38px; height: 38px; border-radius: 50%; background: var(--text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.hk-naam { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; font-family: var(--font-display); }
.hk-sub  { font-size: 12px; color: var(--text-3); }
.hk-contact { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.hk-ci  { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.hk-ci a { color: var(--text-2); text-decoration: none; }
.hk-ci a:hover { color: var(--accent); }
.hk-right  { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.hk-prijs  { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text); }
.hk-body   { display: none; border-top: 1px solid var(--border); }
.hk.open .hk-body { display: block; }
.hk-tabs   { display: flex; background: var(--surface2); border-bottom: 1px solid var(--border); }
.htab      { padding: 10px 18px; font-size: 12px; font-weight: 600; color: var(--text-3); cursor: pointer; border: none; border-bottom: 2px solid transparent; background: none; font-family: var(--font); transition: all .15s; }
.htab:hover { color: var(--text); }
.htab.on   { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }
.htab-c    { display: none; padding: 18px 22px; }
.htab-c.on { display: block; }

.bet-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; margin-bottom: 10px; }
.bet-col  { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bet-lbl  { font-size: 10px; color: var(--text-3); text-transform: uppercase; text-align: center; line-height: 1.3; font-weight: 600; }
.bet-btn  { width: 100%; height: 36px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface2); cursor: pointer; font-size: 14px; transition: all .15s; position: relative; }
.bet-btn.ok  { background: var(--green-light); border-color: #86efac; }
.bet-btn.nok { background: var(--red-light);   border-color: #fca5a5; }
.bet-btn.fut { opacity: .3; pointer-events: none; }
.bet-btn.cur::after { content: ''; position: absolute; top: -4px; right: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.bet-leg { display: flex; gap: 14px; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.leg-d   { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.not-row { display: flex; gap: 8px; margin-bottom: 12px; }
.not-row textarea { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border-med); border-radius: var(--r-md); font-family: var(--font); font-size: 13px; resize: none; height: 56px; outline: none; transition: border-color .15s; }
.not-row textarea:focus { border-color: var(--accent); }
.not-item  { background: var(--surface2); border-radius: var(--r-md); padding: 11px 14px; display: flex; gap: 12px; margin-bottom: 8px; }
.not-txt   { flex: 1; font-size: 13px; color: var(--text); line-height: 1.5; }
.not-meta  { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.not-del   { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; padding: 0; line-height: 1; }
.not-del:hover { color: var(--red); }
.not-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 16px 0; }

.ci-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
.ci-box  { background: var(--surface2); border-radius: var(--r-md); padding: 12px 14px; }
.ci-lbl  { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; font-weight: 600; }
.ci-val  { font-size: 13px; font-weight: 600; color: var(--text); }

.h-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.h-stat  { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.h-stat.green  { border-top-color: var(--green); }
.h-stat.blue   { border-top-color: var(--blue); }
.h-stat.amber  { border-top-color: var(--amber); }
.h-stat.accent { border-top-color: var(--accent); }
.h-stat-l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; font-weight: 600; }
.h-stat-v { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.h-stat-s { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.warn-bar { background: var(--amber-light); border: 1px solid #fde68a; border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 20px; font-size: 13px; color: var(--amber); }

/* ============================================================
   Login pagina
   ============================================================ */
.wrap  { width: 420px; max-width: 95vw; }
.logo  { text-align: center; margin-bottom: 36px; }
.footer { text-align: center; font-size: 11px; color: rgba(255,255,255,.25); margin-top: 24px; }

/* Login card */
.card { background: var(--surface); border-radius: var(--r-xl); padding: 36px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }

/* Lform */
.lform-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.lform-group label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.lform-group input {
  padding: 10px 13px; border: 1.5px solid var(--border-med); border-radius: var(--r-md);
  font-family: var(--font); font-size: 13px; color: var(--text); background: var(--bg);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.lform-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.footer-login { text-align: center; font-size: 11px; color: rgba(255,255,255,.25); margin-top: 24px; }

/* ============================================================
   Misc
   ============================================================ */
.gbc   { }
.green { color: var(--green); }
.amber { color: var(--amber); }
.blue  { color: var(--blue); }
.accent { color: var(--accent); }
.danger { color: var(--red); }
.on    { }
.active { }
.visible { }
.open  { }
.span2 { grid-column: 1 / -1; }
.teIndexeren { }

.more-btn {
  background: none; border: 1.5px solid var(--border-med);
  border-radius: var(--r-sm); padding: 4px 8px; cursor: pointer;
  color: var(--text-3); font-size: 13px; line-height: 1;
  transition: all .15s; display: flex; align-items: center;
}
.more-btn:hover { background: var(--surface2); color: var(--text); }

/* Dashboard — porto chart stats */
.porto-stats { display:grid; grid-template-columns:repeat(5,1fr); gap:16px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
.porto-stat-lbl { font-size:11px; color:var(--text-3); margin-bottom:2px; }
.chart-legend { display:flex; gap:16px; font-size:11px; font-weight:400; text-transform:none; letter-spacing:0; }
.legend-item { display:flex; align-items:center; gap:5px; }
.porto-row-right { display:flex; align-items:center; gap:12px; }
.porto-rend-info { font-size:11px; color:var(--text-3); text-align:right; }
.porto-rend-val { font-weight:500; color:var(--text); }
.porto-rend-sub { font-size:11px; }

/* Utility classes */
.flex-gap-10 { display:flex; align-items:center; gap:10px; }
.flex-min    { flex:1; min-width:0; }
.pos-rel     { position:relative; }
.mt-14       { margin-top:14px; }
.mt-20       { margin-top:20px; }
.empty-icon  { font-size:36px; opacity:.3; margin-bottom:12px; }
.txt-sm-muted  { color:var(--text-3); font-size:13px; }
.txt-xs-muted  { font-size:12px; color:var(--text-3); }
.txt-green-bold { color:var(--green); font-weight:500; }
.txt-med     { font-weight:500; color:var(--text); }
.txt-muted   { color:var(--text-3); }
.txt-lg      { font-size:18px; }
.txt-md-tight { font-size:16px; line-height:1.2; }
.modal--lg   { width:580px; }
.modal--xl   { width:700px; }

/* Extra utility classes */
.col-end       { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.txt-center    { text-align:center; }
.panel--flush  { padding:0; overflow:hidden; }
.mb-14         { margin-bottom:14px; }
.mb-20         { margin-bottom:20px; }
.mb-24         { margin-bottom:24px; }
.form-micro-label { font-size:10px; color:var(--text-3); text-transform:uppercase; letter-spacing:.07em; font-weight:600; margin-bottom:6px; }
.surface-box   { background:var(--surface2); border-radius:var(--r-md); padding:12px; }

/* ============================================================
   AI Widget
   ============================================================ */
.ai-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #6366f1;
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.ai-widget-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #6366f1;
}
.ai-widget-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}
.ai-widget-body p { margin: 0 0 6px; }
.ai-widget-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #6366f1;
}
.ai-dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #818cf8;
  animation: aiDot 1.2s infinite;
  margin: 0 1px;
}
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.ai-refresh {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 15px;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  line-height: 1;
}
.ai-refresh:hover { background: var(--surface2); color: #6366f1; }

/* ============================================================
   Responsive — Mobile (≤ 768px)
   ============================================================ */

/* Hamburger knop — verborgen op desktop */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.hamburger:hover { background: var(--border); }

/* Sidebar overlay (achtergrond bij open menu) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
}
body.sidebar-open .sidebar-overlay { display: block; }

@media (max-width: 768px) {

  /* ── Sidebar: slide-in overlay ── */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* ── Hamburger tonen ── */
  .hamburger { display: flex; }

  /* ── Main: geen vaste margin ── */
  .main { margin-left: 0; }

  /* ── Topbar: ruimte voor hamburger ── */
  .topbar {
    padding: 0 16px 0 56px;
  }
  .topbar-title { font-size: 15px; }

  /* ── Content: minder padding ── */
  .content { padding: 16px; }

  /* ── Grids → 1 kolom ── */
  .two-col,
  .form-grid,
  .quick-grid,
  .results-grid,
  .calc-grid { grid-template-columns: 1fr; }

  .eenheid-meta  { grid-template-columns: 1fr 1fr; }
  .h-stats       { grid-template-columns: 1fr 1fr; }
  .ci-grid       { grid-template-columns: 1fr 1fr; }
  .porto-stats   { grid-template-columns: repeat(3,1fr); }
  .bet-grid      { grid-template-columns: repeat(4,1fr); }

  /* ── Gebouw info bar: wrap ── */
  .gebouw-info-bar { flex-wrap: wrap; gap: 12px; }

  /* ── Tabellen: horizontaal scrollen ── */
  .panel--flush { overflow-x: auto; }
  .table-scroll { overflow-x: auto; }

  /* ── Modals: bottom sheet op mobile ── */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 92vh;
    margin: 0;
  }

  /* ── Notif: volle breedte ── */
  .notif {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    min-width: 0;
  }

  /* ── Panel padding ── */
  .panel { padding: 16px; }

  /* ── Huurder kaarten ── */
  .hk-top  { padding: 14px 16px; }
  .htab-c  { padding: 14px 16px; }

  /* ── Gebouw header padding ── */
  .gebouw-header { padding: 14px 16px; }
  .eenheid-row   { padding: 14px 16px 14px 28px; }
  .add-eenheid-row { padding: 12px 16px; }

  /* ── Topbar-right buttons ── */
  .topbar-right .btn { padding: 7px 12px; font-size: 12px; }

  /* ── btn-actions op mobile: wrap ── */
  .btn-actions { flex-wrap: wrap; }

  /* ── Form actions: wrap ── */
  .form-actions { flex-wrap: wrap; }

  /* ── Print toolbar ── */
  .print-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* ── Rendement inputs ── */
  .inp-wrap input { width: 90px; }
}
