/* ══════════════════════════════════════════════════════════
   REINERIE MAKELAARS — Apple-style design system
   ══════════════════════════════════════════════════════════ */

/* ── THEME TOKENS ── */
:root {
  /* Spacing & shape */
  --sidebar-w: 220px;
  --radius:    16px;
  --radius-sm: 10px;
  --radius-modal: 20px;

  /* Shadows */
  --shadow:    0 2px 12px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.22);

  /* Brand */
  --accent: #c8a84b;
  --accent-light: #e8c870;
}

/* ── LIGHT MODE ── */
:root, [data-theme="light"] {
  --bg:          #F2F2F7;
  --surface:     #FFFFFF;
  --surface-2:   #F2F2F7;
  --surface-3:   #E5E5EA;
  --border:      rgba(60,60,67,0.12);
  --border-soft: rgba(60,60,67,0.06);
  --text:        #1C1C1E;
  --text-muted:  #6E6E73;
  --text-3:      #AEAEB2;
  --primary:     #1C3A5C;
  --primary-rgb: 28,58,92;
  --blue:        #007AFF;
  --blue-bg:     rgba(0,122,255,0.10);
  --success:     #34C759;
  --success-fg:  #1A7A34;
  --success-bg:  rgba(52,199,89,0.12);
  --warning:     #FF9500;
  --warning-fg:  #7A4800;
  --warning-bg:  rgba(255,149,0,0.12);
  --danger:      #FF3B30;
  --danger-fg:   #7A1E1A;
  --danger-bg:   rgba(255,59,48,0.12);
  --info-bg:     rgba(0,122,255,0.08);
  --sidebar-bg:  #1C3A5C;
  --sidebar-fg:  rgba(255,255,255,0.82);
  --sidebar-blur: none;
  --card-bg:     #FFFFFF;
  --hover-bg:    rgba(0,0,0,0.04);
}

/* ── DARK MODE (auto + manual) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #000000;
    --surface:     #1C1C1E;
    --surface-2:   #2C2C2E;
    --surface-3:   #3A3A3C;
    --border:      rgba(255,255,255,0.10);
    --border-soft: rgba(255,255,255,0.05);
    --text:        #FFFFFF;
    --text-muted:  #98989D;
    --text-3:      #6E6E73;
    --primary:     #FFFFFF;
    --primary-rgb: 255,255,255;
    --blue:        #0A84FF;
    --blue-bg:     rgba(10,132,255,0.18);
    --success:     #30D158;
    --success-fg:  #30D158;
    --success-bg:  rgba(48,209,88,0.15);
    --warning:     #FF9F0A;
    --warning-fg:  #FF9F0A;
    --warning-bg:  rgba(255,159,10,0.15);
    --danger:      #FF453A;
    --danger-fg:   #FF453A;
    --danger-bg:   rgba(255,69,58,0.15);
    --info-bg:     rgba(10,132,255,0.14);
    --sidebar-bg:  rgba(28,28,30,0.72);
    --sidebar-fg:  rgba(255,255,255,0.78);
    --card-bg:     #1C1C1E;
    --hover-bg:    rgba(255,255,255,0.06);
  }
}

[data-theme="dark"] {
  --bg:          #000000;
  --surface:     #1C1C1E;
  --surface-2:   #2C2C2E;
  --surface-3:   #3A3A3C;
  --border:      rgba(255,255,255,0.10);
  --border-soft: rgba(255,255,255,0.05);
  --text:        #FFFFFF;
  --text-muted:  #98989D;
  --text-3:      #6E6E73;
  --primary:     #FFFFFF;
  --primary-rgb: 255,255,255;
  --blue:        #0A84FF;
  --blue-bg:     rgba(10,132,255,0.18);
  --success:     #30D158;
  --success-fg:  #30D158;
  --success-bg:  rgba(48,209,88,0.15);
  --warning:     #FF9F0A;
  --warning-fg:  #FF9F0A;
  --warning-bg:  rgba(255,159,10,0.15);
  --danger:      #FF453A;
  --danger-fg:   #FF453A;
  --danger-bg:   rgba(255,69,58,0.15);
  --info-bg:     rgba(10,132,255,0.14);
  --sidebar-bg:  rgba(28,28,30,0.72);
  --sidebar-fg:  rgba(255,255,255,0.78);
  --card-bg:     #1C1C1E;
  --hover-bg:    rgba(255,255,255,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

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

.login-box {
  background: var(--surface);
  border-radius: var(--radius-modal);
  padding: 44px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-img {
  max-width: 190px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

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

/* ── SIDEBAR — frosted glass ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
}

.sidebar-logo {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
}

.sidebar-logo-img {
  max-width: 150px;
  max-height: 52px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover  { background: rgba(255,255,255,0.10); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }
.nav-icon { width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-info {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#sidebar-username {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: color 0.15s;
}
#sidebar-username:hover { color: var(--blue); }
.sidebar-greeting {
  font-size: 10px;
  opacity: 0.6;
  font-weight: 400;
  line-height: 1.2;
}
.sidebar-naam {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dark mode toggle */
#theme-toggle-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
  transition: background 0.15s;
}

#theme-toggle-btn:hover { background: rgba(255,255,255,0.20); }

/* ── MAIN ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

.page { padding: 28px 32px; }

.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border);
  border-radius: 4px 0 0 4px;
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .stat-number { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }

.stat-card.status-prospect::before  { background: #6E6E73; }
.stat-card.status-aanmelding::before { background: #BF5AF2; }
.stat-card.status-beschikbaar::before { background: #007AFF; }
.stat-card.status-onderbod::before   { background: #FF9500; }
.stat-card.status-verkochtovb::before { background: #FF6B00; }
.stat-card.status-verkocht::before   { background: #34C759; }

/* ── PROPERTY LIST ── */
.property-grid { display: flex; flex-direction: column; gap: 0; }

.property-row {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.property-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.property-row:last-child  { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.property-row:only-child  { border-radius: var(--radius); border-bottom: none; }
.property-row:hover { background: var(--hover-bg); }

/* Wrap property list in a card-like container */
.property-grid {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.property-row-main { flex: 1; min-width: 0; }

.property-row-address {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.property-row-location {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}

.property-row-verkopers {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.property-upcoming-date {
  font-size: 12px;
  color: var(--warning-fg);
  font-weight: 500;
  white-space: nowrap;
}

.property-row-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.property-tasks-badge { font-size: 12px; color: var(--text-muted); }
.tasks-done { color: var(--success-fg); font-weight: 600; }

/* ── STATUS BADGES ── */
.badge, .status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge { background: rgba(255,255,255,0.18); color: #fff; }

.status-prospect    { background: rgba(110,110,115,0.15); color: var(--text-muted); }
.status-aanmelding  { background: rgba(191,90,242,0.14);  color: #BF5AF2; }
.status-beschikbaar { background: var(--blue-bg);          color: var(--blue); }
.status-onderbod    { background: var(--warning-bg);       color: var(--warning-fg); }
.status-verkochtovb { background: rgba(255,107,0,0.14);   color: #FF6B00; }
.status-verkocht    { background: var(--success-bg);       color: var(--success-fg); }
.status-ingetrokken { background: var(--danger-bg);        color: var(--danger-fg); }

.am-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── PRIORITEIT ── */
.prio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: middle;
}

.property-row-prio { border-left: 3px solid var(--danger); }
.prio-btn-active { color: var(--danger) !important; }

/* ── URGENTE TAKEN ── */
.task-urgent { color: var(--danger) !important; font-weight: 600; }

/* ── ALERTS ── */
.alert-indicator { position: relative; display: inline-flex; align-items: center; cursor: pointer; }

.alert-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  position: absolute;
  top: -2px; right: -2px;
  border: 2px solid var(--surface);
}

.property-alert-icon {
  font-size: 13px;
  cursor: pointer;
  color: var(--danger);
  flex-shrink: 0;
  position: relative;
}

.property-alert-tooltip {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: pre-wrap;
  max-width: 260px;
  z-index: 200;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.property-alert-icon:hover .property-alert-tooltip { display: block; }

.alert-banner {
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--warning-fg);
}

.alert-banner-icon { font-size: 16px; flex-shrink: 0; }
.alert-banner-text { flex: 1; line-height: 1.4; }
.alert-banner-edit {
  background: none; border: none; cursor: pointer;
  color: var(--warning-fg); font-size: 12px; padding: 0;
  text-decoration: underline; flex-shrink: 0;
}

/* ── TASK DUE DATE ── */
.task-due-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.task-due-future  { background: var(--info-bg); color: var(--blue); }
.task-due-soon    { background: var(--warning-bg); color: var(--warning-fg); }
.task-due-overdue { background: var(--danger-bg); color: var(--danger-fg); }

/* ── TAAK DATUM KNOP ── */
.task-date-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px 4px;
  border-radius: 6px; font-size: 13px;
  opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
}
.task-item:hover .task-date-btn { opacity: 1; }
.task-date-btn:hover { background: var(--blue-bg); color: var(--blue); }
.task-date-btn.has-date { opacity: 1; color: var(--blue); }

/* ── AGENDA PAGINA ── */
.agenda-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); font-size: 15px;
}

.agenda-property-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.agenda-property-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.agenda-property-header:hover { background: var(--hover-bg); }

.agenda-property-adres { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; }
.agenda-property-meta  { font-size: 12px; color: var(--text-muted); }

.agenda-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.agenda-task-row:last-child { border-bottom: none; }

.agenda-task-title   { flex: 1; font-size: 14px; }
.agenda-task-overdue { color: var(--danger-fg); font-weight: 600; }
.agenda-task-today   { color: var(--warning-fg); font-weight: 600; }

.agenda-date-label {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.agenda-count-badge {
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 7px;
  min-width: 20px; text-align: center;
}

/* ── DETAIL PAGE ── */
.back-btn { color: var(--text-muted); }

#detail-title-area      { flex: 1; }
#detail-title-area h2   { font-size: 20px; color: var(--text); font-weight: 700; letter-spacing: -0.2px; }
#detail-meta            { margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.select-status {
  font-weight: 600;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: var(--surface);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px 320px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.main-content {
  overflow-x: hidden;
}

.detail-middle { display: none; }

@media (max-width: 1200px) { .detail-grid { grid-template-columns: 1fr 320px; } }
@media (max-width: 900px)  { .detail-grid { grid-template-columns: 1fr; } }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }

/* ── TASKS ── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.12s;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--hover-bg); }

.task-item input[type="checkbox"] {
  width: 17px; height: 17px;
  cursor: pointer; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--blue);
}

.task-title     { flex: 1; font-size: 14px; line-height: 1.4; }
.task-title.done { text-decoration: line-through; color: var(--text-muted); }
.task-meta      { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.task-delete {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 4px; border-radius: 6px;
  opacity: 0; transition: opacity 0.15s; font-size: 14px;
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { background: var(--danger-bg); color: var(--danger-fg); }

/* ── DATES ── */
.rw-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  background: var(--blue-bg); color: var(--blue);
  border-radius: 4px; padding: 1px 4px;
  letter-spacing: 0.03em; vertical-align: middle; margin-left: 4px;
}

.dates-section { padding: 16px; }
.date-group    { margin-bottom: 12px; }
.date-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}

.date-input-row { display: flex; gap: 8px; align-items: center; }

.date-input-row input[type="date"],
.date-input-row input[type="time"] {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.date-input-row input[type="date"]:focus,
.date-input-row input[type="time"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* ── CONTACTS ── */
.contact-item { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.contact-item:last-child { border-bottom: none; }

.contact-name   { font-weight: 600; font-size: 14px; }
.contact-detail { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.contact-detail a { color: var(--blue); text-decoration: none; }
.contact-actions { margin-top: 8px; display: flex; gap: 6px; }

/* ── NOTES ── */
.note-item { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.note-item:last-child { border-bottom: none; }
.note-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.note-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }

.note-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; align-items: flex-end;
}

.note-input-area textarea {
  flex: 1; padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; resize: none; font-family: inherit;
  background: var(--surface); color: var(--text);
}

.note-input-area textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* ── ADMIN — segmented tabs ── */
.admin-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 18px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.template-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.template-row:last-child { border-bottom: none; }

.template-status { width: 110px; flex-shrink: 0; }
.template-title  { flex: 1; font-size: 14px; }

.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.user-row:last-child { border-bottom: none; }
.user-name { flex: 1; font-weight: 500; }

/* ── FORMS ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0066DD; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--hover-bg); }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 { font-size: 17px; font-weight: 600; color: var(--text); }

.modal-close {
  background: var(--surface-2); border: none;
  font-size: 18px; cursor: pointer;
  color: var(--text-muted); line-height: 1;
  padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: var(--surface-3); }
.modal-body { padding: 20px; }

/* ── UTILITIES ── */
.error {
  background: var(--danger-bg); color: var(--danger-fg);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 13px; margin-top: 8px;
}

.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 32px; margin-bottom: 8px; }

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; width: 240px;
  background: var(--surface); color: var(--text);
}
.search-input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

.select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface); color: var(--text);
  cursor: pointer;
}

.sync-status { font-size: 12px; color: var(--text-muted); }

.section-header { margin-bottom: 12px; }
.section-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }

.property-list .property-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width 0.3s; }

/* ===== CHAT WIDGET ===== */
.chat-toggle-btn {
  position: fixed; bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--blue); color: #fff;
  border: none; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.chat-toggle-btn:hover { background: #0066DD; transform: scale(1.06); }

.chat-widget {
  position: fixed; bottom: 24px; right: 24px;
  width: 360px; max-height: 520px;
  background: var(--surface);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  z-index: 1000; overflow: hidden;
  border: 1px solid var(--border);
}

.chat-header {
  background: var(--blue); color: #fff;
  padding: 12px 16px;
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

.chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; opacity: 0.8; }
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 200px;
}

.chat-msg {
  max-width: 85%; padding: 9px 13px;
  border-radius: 16px; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

.chat-msg-user {
  background: var(--blue); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}

.chat-msg-bot {
  background: var(--surface-2); color: var(--text);
  align-self: flex-start; border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input-row input {
  flex: 1; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px;
  font-size: 13px; outline: none;
  background: var(--surface-2); color: var(--text);
}
.chat-input-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }

.chat-input-row .btn { min-width: 36px; border-radius: 10px; font-size: 16px; }

/* ===== ENERGIELABEL ===== */
.energielabel-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; background: #aaa;
}
.energielabel-badge.energielabel-a,
.energielabel-badge.energielabel-a-ppp,
.energielabel-badge.energielabel-a-pp,
.energielabel-badge.energielabel-a-p  { background: #1A7A34; }
.energielabel-badge.energielabel-b    { background: #34A853; }
.energielabel-badge.energielabel-c    { background: #7CB342; }
.energielabel-badge.energielabel-d    { background: #F9AB00; color: #2C1700; }
.energielabel-badge.energielabel-e    { background: #F57C00; }
.energielabel-badge.energielabel-f    { background: #E53935; }
.energielabel-badge.energielabel-g    { background: #B71C1C; }

/* ===== TAKENBADGE ===== */
.nav-badge {
  display: inline-block;
  background: rgba(255,255,255,0.3); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  margin-left: 4px; vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.nav-badge-urgent { background: var(--danger); }

/* ===== VRAGENLIJST ===== */
.vl-details { margin-bottom: 12px; }
.vl-summary { font-weight: 600; font-size: 13px; padding: 8px 4px; cursor: pointer; color: var(--blue); }
.vl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vl-table tr { border-bottom: 1px solid var(--border-soft); }
.vl-table tr:last-child { border-bottom: none; }
.vl-vraag    { padding: 6px 8px 6px 4px; color: var(--text-muted); width: 60%; vertical-align: top; }
.vl-antwoord { padding: 6px 4px; font-weight: 500; color: var(--text); }

/* ===== FOTO ===== */
.property-row-thumb {
  width: 52px; height: 40px;
  object-fit: cover; border-radius: 8px; flex-shrink: 0;
}

.property-row-thumb-empty {
  width: 52px; height: 40px;
  border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.detail-foto-banner { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; max-height: 280px; }
.detail-foto-img    { width: 100%; max-height: 280px; object-fit: cover; display: block; }

/* ===== ACTIVITEITSLOG ===== */
.activity-item {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%; background: var(--blue);
  flex-shrink: 0; margin-top: 5px;
}

.activity-body    { flex: 1; font-size: 12px; }
.activity-actie   { font-weight: 600; color: var(--text); margin-right: 6px; }
.activity-details { color: var(--text-muted); }
.activity-meta    { color: var(--text-3); font-size: 11px; margin-top: 2px; }

/* ===== PANDKAART NIEUWE LAYOUT ===== */
.property-row-sub {
  display: flex; gap: 8px; align-items: center;
  margin-top: 2px; font-size: 12px; color: var(--text-muted);
}

.property-row-verkopers-inline {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}

.property-row-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; }

/* ===== AANWEZIGHEID ===== */
#presence-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.presence-chip {
  background: rgba(200,168,75,0.18); color: var(--text);
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(200,168,75,0.4); white-space: nowrap;
}

/* ===== BEZICHTIGING ===== */
.bez-opties { display: flex; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }

.bez-optie-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; color: var(--text); }

.bez-date-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bez-date-row input[type="date"] { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 13px; background: var(--surface); color: var(--text); }

.bez-remove-btn { padding: 2px 8px; font-size: 16px; line-height: 1; color: var(--text-muted); }

.bez-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.bez-vrij    { background: var(--success-bg); color: var(--success-fg); }
.bez-overleg { background: var(--blue-bg); color: var(--blue); }

/* ===== ROOSTER ===== */
.rooster-table-wrap { overflow-x: auto; }

.rooster-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}

.rooster-table th {
  background: var(--surface-2); color: var(--text);
  font-weight: 600; padding: 10px 14px;
  text-align: left; border-bottom: 1px solid var(--border);
}

.rooster-table td {
  padding: 8px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top;
}
.rooster-table tr:last-child td { border-bottom: none; }
.rooster-table tr:hover td { background: var(--hover-bg); }

.rooster-naam-col { width: 160px; }
.rooster-dag-col  { min-width: 140px; text-transform: capitalize; }

.rooster-vandaag { background: color-mix(in srgb, var(--blue) 8%, transparent); }

.rooster-naam-cel { vertical-align: middle; }
.rooster-naam     { font-weight: 600; display: block; }

.rooster-rol-badge {
  font-size: 10px; background: var(--blue); color: #fff;
  border-radius: 4px; padding: 1px 5px;
}

.rooster-cel-inner { display: flex; flex-direction: column; gap: 4px; }

.rooster-check-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--text); }
.rooster-check-label.rooster-readonly { cursor: default; opacity: 0.75; }
.rooster-check-label.rooster-readonly input[type="checkbox"] { cursor: default; }

.rooster-binnendienst-label { color: var(--blue); font-weight: 600; }
.rooster-binnendienst-label.hidden { display: none; }

.rooster-vandaag-summary { margin-top: 16px; }
.rooster-summary-body { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.rooster-summary-persoon { display: flex; align-items: center; gap: 6px; }
.rooster-summary-naam { font-weight: 600; }

/* Weekoverzicht */
.rooster-week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 12px 16px 16px;
}
.rooster-week-dag {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px;
  min-height: 80px;
}
.rooster-week-vandaag {
  border: 2px solid var(--blue);
}
.rooster-week-dag-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.rooster-week-dagnaam { font-weight: 700; font-size: 13px; }
.rooster-week-datum { font-size: 11px; color: var(--text-muted); flex: 1; }
.rooster-week-count {
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.rooster-week-personen { display: flex; flex-direction: column; gap: 4px; }
.rooster-week-persoon { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.rooster-week-naam { font-weight: 500; }
.rooster-week-leeg { font-size: 12px; color: var(--text-muted); }
.binnendienst-badge { font-size: 10px; font-weight: 600; background: rgba(0,122,255,0.12); color: var(--blue); border-radius: 4px; padding: 1px 5px; }

.binnendienst-badge {
  font-size: 11px; background: var(--blue-bg); color: var(--blue);
  border-radius: 20px; padding: 2px 8px; font-weight: 600;
}

/* ===== AGENDA AANWEZIG BAR ===== */
.agenda-aanwezig-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 14px; }

.aanwezig-chip {
  background: var(--success-bg); color: var(--success-fg);
  border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600;
}

.binnendienst-chip { background: var(--blue-bg); color: var(--blue); }

/* ===== TAAK TOEWIJZING ===== */
.task-assign-select {
  margin-left: auto; font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 8px; padding: 2px 6px;
  background: var(--surface-2); color: var(--text);
  cursor: pointer; max-width: 160px;
}

.task-assigned-badge {
  font-size: 11px; background: rgba(191,90,242,0.13); color: #BF5AF2;
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}

/* ===== DASHBOARD WIDGETS ===== */
.dashboard-widgets { display: flex; flex-direction: column; gap: 0; }
.db-widget { position: relative; }
.db-widget-drag-handle {
  position: absolute;
  top: 16px;
  right: 14px;
  font-size: 18px;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
  z-index: 1;
  line-height: 1;
}
.db-widget:hover .db-widget-drag-handle { opacity: 0.5; }
.db-widget-drag-handle:hover { opacity: 1 !important; }
.widget-dragging { opacity: 0.45; outline: 2px dashed var(--blue); border-radius: 12px; }
.db-rooster-grid { margin: 0 16px 16px; }

/* ===== DASHBOARD AANWEZIG ===== */
.db-aanwezig-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 24px;
}

.db-aanwezig-kaart {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}

.db-aanwezig-naam {
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}

.db-taken-lijst { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.db-taak-row {
  display: flex; flex-direction: column;
  padding: 6px 10px;
  background: var(--surface-2); border-radius: 8px;
  cursor: pointer; font-size: 12px;
  transition: background 0.12s;
}
.db-taak-row:hover { background: var(--hover-bg); }

.db-taak-titel { font-weight: 600; color: var(--text); }
.db-taak-pand  { color: var(--text-muted); font-size: 11px; }
.db-taak-leeg  { font-size: 12px; color: var(--text-muted); padding: 4px 0; }

.db-taken-btn { align-self: flex-end; font-size: 11px; margin-top: 4px; }

.db-niet-toegewezen {
  background: var(--surface); border-radius: var(--radius);
  border: 2px dashed var(--border);
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
}

/* ===== FOTO STRIP ===== */
.foto-strip {
  display: flex; gap: 6px; overflow-x: auto;
  margin-bottom: 20px; scrollbar-width: thin; padding-bottom: 4px;
}

.foto-strip-img {
  height: 140px; width: auto; flex-shrink: 0;
  border-radius: 10px; object-fit: cover; cursor: pointer;
  transition: opacity 0.15s;
}
.foto-strip-img:hover { opacity: 0.85; }

.rooster-bulk-row td { padding: 4px 14px; background: var(--surface-2); }
.rooster-bulk-btns   { display: flex; gap: 4px; }
.btn-xs {
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; color: var(--text);
}
.btn-xs:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Tijdgevoelige taken dashboard ── */
/* ===== WAARSCHUWINGEN ===== */
.waarschuwingen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.waarschuwing-kaart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.waarschuwing-kaart:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.waarschuwing-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wk-prio { font-size: 11px; font-weight: 600; color: #FF9F0A; }
.waarschuwing-adres { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.waarschuwing-plaats { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
/* Datakwaliteit */
.dkw-lijst { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.dkw-kaart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #FF9F0A;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dkw-kaart:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.dkw-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dkw-adres { font-weight: 600; font-size: 14px; }
.dkw-meldingen { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.dkw-melding { font-size: 12px; color: var(--text-muted); padding: 4px 8px; background: rgba(255,159,10,0.08); border-radius: 6px; }

.waarschuwing-alert {
  font-size: 12px;
  background: rgba(255,159,10,0.1);
  color: #FF9F0A;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 4px;
}

.urgent-taken-lijst { margin-bottom: 24px; }
.urgent-groep { margin-bottom: 12px; }
.urgent-groep-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 0 6px; color: var(--text-muted);
}
.urgent-groep-label.overdue { color: var(--danger-fg); }
.urgent-groep-label.today   { color: var(--blue); }
.urgent-groep-label.soon    { color: var(--text-muted); }

.urgent-taak-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
}
.urgent-taak-row:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.urgent-taak-titel { flex: 1; font-size: 14px; font-weight: 500; }
.urgent-taak-pand  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Tekstcontrole banner ── */
.tekst-check-banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
}
.tekst-check-header { font-weight: 600; font-size: 14px; color: var(--warning-fg); margin-bottom: 6px; }
.tekst-check-list   { margin: 0; padding-left: 20px; }
.tekst-check-list li { font-size: 13px; color: var(--warning-fg); margin-bottom: 3px; }

/* ── Template dependency + formula ── */
.dep-arrow       { color: var(--text-muted); font-style: normal; }
.template-formula {
  font-size: 11px; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 5px; margin-left: 6px; font-family: monospace;
}

/* ── Activiteit inklapbaar ── */
.activity-toon-meer {
  width: 100%; background: none; border: none;
  border-top: 1px solid var(--border-soft);
  padding: 8px; font-size: 12px; color: var(--text-muted);
  cursor: pointer; text-align: center;
}
.activity-toon-meer:hover { color: var(--blue); }

/* ── Monetaire bedragen: tabular nums ── */
.property-row-price,
.stat-card .stat-number,
.task-due-date,
.agenda-date-label,
.nav-badge {
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   APPLE ENHANCED v2 — extra polish
   ══════════════════════════════════════════════════════════ */

/* 1. Smooth scroll */
html { scroll-behavior: smooth; }

/* ── Scrollbars: ultra-thin macOS style ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.35); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.55); }
* { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,0.35) transparent; }

/* ── Large Title: iOS-style grote paginatitel ── */
.page-header h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.1;
}

/* ── Nav icon squares: iOS Settings stijl ── */
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}

.nav-item:hover .nav-icon  { transform: scale(1.08); }
.nav-item.active .nav-icon { transform: scale(1.0); }

[data-page="dashboard"]  .nav-icon { background: linear-gradient(145deg,#1C86FF,#0055D4); }
[data-page="properties"] .nav-icon { background: linear-gradient(145deg,#FF9F0A,#E07000); }
[data-page="agenda"]     .nav-icon { background: linear-gradient(145deg,#FF453A,#C0261C); }
[data-page="rooster"]    .nav-icon { background: linear-gradient(145deg,#30D158,#1A9E3A); }
[data-page="waarschuwingen"] .nav-icon { background: linear-gradient(145deg,#FF9F0A,#E07000); }
[data-page="admin"]          .nav-icon { background: linear-gradient(145deg,#636366,#3A3A3C); }

/* ── Inputs: iOS filled stijl (geen border, grijs fill) ── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
textarea, .search-input {
  background: rgba(118,118,128,0.10);
  border: 1px solid transparent;
  transition: box-shadow 0.18s, border-color 0.18s, background 0.15s;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea,
[data-theme="dark"] .search-input {
  background: rgba(118,118,128,0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) input[type="text"],
  :root:not([data-theme="light"]) input[type="email"],
  :root:not([data-theme="light"]) input[type="password"],
  :root:not([data-theme="light"]) input[type="number"],
  :root:not([data-theme="light"]) input[type="date"],
  :root:not([data-theme="light"]) input[type="time"],
  :root:not([data-theme="light"]) textarea,
  :root:not([data-theme="light"]) .search-input {
    background: rgba(118,118,128,0.22);
  }
}

input:focus, textarea:focus {
  background: var(--surface) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3.5px rgba(0,122,255,0.28) !important;
}

/* Select: zelfde filled stijl */
select, .select {
  background: rgba(118,118,128,0.10);
  border: 1px solid transparent;
}

[data-theme="dark"] select,
[data-theme="dark"] .select {
  background: rgba(118,118,128,0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select,
  :root:not([data-theme="light"]) .select {
    background: rgba(118,118,128,0.22);
  }
}

select:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(0,122,255,0.28);
}

/* ── Spring-achtige button animatie ── */
.btn {
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1);
}
.btn:active { transform: scale(0.96) !important; }

/* ── Property rows: iOS table cel stijl met chevron ── */
.property-row {
  position: relative;
  padding-right: 36px;
}

.property-row::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--text-3);
  border-top: 1.8px solid var(--text-3);
  transform: translateY(-50%) rotate(45deg);
  flex-shrink: 0;
}

/* ── Stat cards: iOS widget stijl ── */
.stat-card {
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.stat-card .stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stat-card .stat-number {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-top: 8px;
}

/* ── Card headers: iOS section stijl ── */
.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
  text-transform: none;
}

/* ── Section labels: iOS grouped table header ── */
.section-header h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ── Agenda property header: iOS section header ── */
.agenda-property-header {
  padding: 10px 16px;
}

.agenda-property-adres {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

/* ── Checkboxes: iOS-stijl (groter, blauw) ── */
.task-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Status badges: pill met subtiel tint ── */
.badge, .status-badge {
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
}

/* ── Nav badge: iOS notificatie stijl ── */
.nav-badge {
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
}

.nav-badge-urgent {
  box-shadow: 0 1px 4px rgba(255,59,48,0.5);
}

/* ── Sidebar footer: compacter ── */
.sidebar-footer {
  padding: 10px;
}

.user-info {
  font-size: 12px;
}

/* ── Modal: extra iOS polish ── */
.modal-overlay {
  background: rgba(0,0,0,0.5);
}

.modal {
  border: 1px solid var(--border);
}

/* ── Takenoverzicht chips: iOS segment stijl ── */
.aanwezig-chip, .binnendienst-chip {
  font-size: 13px;
  padding: 5px 14px;
  font-weight: 600;
}

/* ── Aanwezig cards: iOS grouped list stijl ── */
.db-aanwezig-kaart {
  border-radius: 14px;
}

.db-taak-row {
  border-radius: 10px;
}

/* ── Urgent taak rows ── */
.urgent-taak-row {
  border-radius: 12px;
}

/* ── Foto strip afgeronder ── */
.foto-strip-img {
  border-radius: 12px;
}

/* ── Presence chip: iOS stijl ── */
.presence-chip {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── Tekst-check banner ── */
.tekst-check-banner {
  border-radius: 12px;
}

/* ── Link kleur ── */
a { color: var(--blue); }

/* ── Smooth page transitions ── */
.page {
  animation: fadeUp 0.22s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Sidebar versie knop ── */
.sidebar-version {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}
.sidebar-version:hover { background: rgba(255,255,255,0.08); }

/* ── Versie / Changelog modal ── */
.versie-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
}
.versie-tab {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.versie-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.versie-tab-content { animation: fadeUp 0.18s ease both; }

.versie-blok { margin-bottom: 24px; }
.versie-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.versie-tag {
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.versie-datum { font-size: 12px; color: var(--text-muted); }
.versie-lijst {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.versie-lijst li { font-size: 13px; color: var(--text); line-height: 1.4; }

/* ── Feedback items ── */
.feedback-groep-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 0 4px;
}
.feedback-groep-label.done { color: var(--success-fg); }

.feedback-item {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: opacity 0.2s;
}
.feedback-item.feedback-done { opacity: 0.55; }
.feedback-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.feedback-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.feedback-tekst { flex: 1; font-size: 13px; line-height: 1.4; }
.feedback-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; padding-left: 24px; }
.feedback-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.feedback-status-badge.open { background: rgba(255,159,10,0.15); color: #FF9F0A; }
.feedback-status-badge.done { background: rgba(48,209,88,0.15); color: #30D158; }

/* 2. Back button → iOS blauw met ‹ chevron */
.back-btn {
  color: var(--blue) !important;
  font-weight: 500;
  font-size: 16px;
  border: none !important;
  background: none !important;
  padding: 6px 4px !important;
  gap: 2px;
  letter-spacing: -0.2px;
}
.back-btn:hover { opacity: 0.7; background: none !important; }
.back-btn::before { content: '‹'; font-size: 22px; line-height: 1; font-weight: 300; margin-right: 2px; }

/* 3. Circular iOS checkboxes */
.task-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.task-item input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
  transform: scale(1.05);
}
.task-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 11px;
  border: 2px solid #fff;
  border-left: none; border-top: none;
  transform: rotate(45deg);
}
.task-item input[type="checkbox"]:hover:not(:checked) {
  border-color: var(--blue);
}

/* 4. Detail page header opruimen */
#page-detail .page-header {
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 20px;
}

#detail-title-area h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

#detail-meta {
  gap: 6px;
  margin-top: 5px;
}

/* Status select: compacter in header */
.select-status {
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 20px;
}

/* Prio + alert buttons: iOS icon button stijl */
#prio-btn, #alert-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface-2) !important;
  border: none !important;
  flex-shrink: 0;
}
#prio-btn:hover, #alert-btn:hover { background: var(--surface-3) !important; }

/* 5. Sidebar logo: geen harde witte vlak */
.sidebar-logo {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

/* 6. Segmented control (admin tabs): echte iOS pill */
.admin-tabs {
  background: var(--surface-3);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.tab-btn {
  border-radius: 9px;
  font-size: 13px;
  padding: 7px 16px;
  font-weight: 500;
}
.tab-btn.active {
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0.5px 1px rgba(0,0,0,0.06);
}

/* 7. Taak hover: iOS leading-swipe gevoel */
.task-item {
  border-radius: 0;
  transition: background 0.12s;
}
.task-item:hover {
  background: var(--hover-bg);
  padding-left: 20px;
}
.task-item { transition: background 0.12s, padding-left 0.15s cubic-bezier(0.22,1,0.36,1); }

/* Rooster: standaard-dag indicator */
.rooster-default-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.5;
  margin-left: 4px;
  vertical-align: middle;
}

/* 8. Versieregel in sidebar */
.sidebar-version {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.02em;
  margin-top: 2px;
  padding: 0 4px;
}

/* Extra: focus ring verfijnd */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3.5px rgba(0,122,255,0.22) !important;
}

/* Extra: agenda task checkbox ook circulair */
.agenda-task-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.agenda-task-row input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.agenda-task-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1.5px;
  width: 5px; height: 10px;
  border: 2px solid #fff;
  border-left: none; border-top: none;
  transform: rotate(45deg);
}

/* ── Mobiel (max 768px) ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar wordt onderste navigatiebalk */
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 100%;
    height: 60px;
    position: fixed;
    bottom: 0; left: 0; right: 0; top: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 200;
    padding: 0;
  }

  .sidebar-logo,
  .sidebar-footer { display: none; }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10px;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-icon {
    width: 28px; height: 28px;
    font-size: 15px;
    border-radius: 8px;
  }

  .nav-badge {
    position: absolute;
    top: 4px;
    font-size: 9px;
    padding: 1px 4px;
  }

  /* Hoofdinhoud boven de navigatiebalk */
  .main-content {
    margin-left: 0;
    padding-bottom: 70px;
  }

  .page { padding: 16px; }

  .page-header {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
  }

  .page-header h2 { font-size: 22px; }

  .header-actions {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .search-input, .select { width: 100%; }

  /* Stats grid: 2 kolommen op mobiel */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Detail pagina: alles onder elkaar */
  .detail-grid { grid-template-columns: 1fr !important; }

  /* Property kaarten: lijst ipv grid */
  .property-grid { grid-template-columns: 1fr; }

  /* Chat knop hoger zodat hij boven de nav blijft */
  .chat-toggle-btn { bottom: 74px; }
  .chat-widget { bottom: 74px; max-height: calc(100vh - 140px); }

  /* Modals volledig scherm op mobiel */
  .modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 60px; left: 0; right: 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  .modal-overlay { align-items: flex-end; }

  /* Takenbalk compacter */
  .task-item { padding: 10px 0; }
  .task-assign-select { font-size: 11px; max-width: 120px; }

  /* Foto banner minder hoog */
  .detail-foto-banner { height: 180px; }
}
