/* ===== Kadaster Oranjestad — design system ===== */

:root {
  --navy: #0d2b52;
  --navy-light: #153b6e;
  --gold: #c9a14a;
  --gold-light: #e0c077;
  --success: #1f9d55;
  --warning: #e08a2c;
  --danger: #d64545;

  --background: #f7f9fb;
  --foreground: #0b1220;
  --card: #ffffff;
  --card-foreground: #0b1220;
  --muted: #eef1f5;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --ring: #c9a14a;
  --radius: 12px;

  --shadow-soft: 0 2px 10px -2px rgba(13, 43, 82, 0.08), 0 1px 3px -1px rgba(13, 43, 82, 0.06);
  --shadow-card: 0 4px 20px -4px rgba(13, 43, 82, 0.1);
}

html.dark {
  --background: #0a1220;
  --foreground: #eef2f7;
  --card: #101a2c;
  --card-foreground: #eef2f7;
  --muted: #182338;
  --muted-foreground: #94a3b8;
  --border: #223046;
  --shadow-soft: 0 2px 10px -2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
}

/* ===== Scrollbars ===== */

.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.scroll-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 999px;
}
.scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== Utility ===== */

.text-muted { color: var(--muted-foreground); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.text-2xl { font-size: 24px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  background: transparent;
  color: var(--foreground);
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-light); }

.btn-gold {
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--muted); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--muted); }

.btn-danger-text { color: var(--danger); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { opacity: 0.9; }

/* ===== Cards ===== */

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-header {
  padding: 18px 20px 0 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
}
.card-description {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.card-content {
  padding: 20px;
}
.card-content-flush {
  padding: 0;
}

/* ===== Badges ===== */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: rgba(31, 157, 85, 0.12); color: var(--success); }
.badge-warning { background: rgba(224, 138, 44, 0.12); color: var(--warning); }
.badge-danger { background: rgba(214, 69, 69, 0.12); color: var(--danger); }
.badge-neutral { background: var(--muted); color: var(--muted-foreground); }
.badge-gold { background: rgba(201, 161, 74, 0.15); color: var(--gold); }

/* ===== Stat cards ===== */

.stat-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
}
.stat-card .stat-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.stat-card .stat-value { font-size: 24px; font-weight: 600; margin-top: 8px; letter-spacing: -0.01em; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.navy { background: rgba(13, 43, 82, 0.08); color: var(--navy); }
html.dark .stat-icon.navy { background: rgba(13, 43, 82, 0.4); color: #fff; }
.stat-icon.gold { background: rgba(201, 161, 74, 0.15); color: var(--gold); }
.stat-icon.success { background: rgba(31, 157, 85, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(224, 138, 44, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(214, 69, 69, 0.1); color: var(--danger); }

/* ===== App shell ===== */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--muted); color: var(--foreground); }
.nav-item.active { background: var(--navy); color: #fff; }
.nav-item.active svg { color: var(--gold); }
.sidebar-footer {
  padding: 14px 20px;
  font-size: 11px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
  .sidebar { display: none; }
}

.mobile-menu-btn { display: none; }
@media (max-width: 1024px) {
  .mobile-menu-btn { display: inline-flex; }
}

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
@media (max-width: 640px) {
  .main-content { padding: 16px; }
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.logo-text-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.logo-text-slogan { font-size: 11px; color: var(--muted-foreground); }

/* ===== Search input ===== */

.search-box {
  position: relative;
  width: 100%;
  max-width: 320px;
}
.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-foreground);
  pointer-events: none;
}
.search-box input { padding-left: 32px; }

/* ===== Forms ===== */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(201, 161, 74, 0.15);
}
.textarea { min-height: 80px; resize: vertical; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ===== Table ===== */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted-foreground);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--foreground); }
.data-table th svg { width: 12px; height: 12px; vertical-align: -1px; flex-shrink: 0; }
/* .data-table th's own text-align:left otherwise always wins over .text-right
   by specificity, so a right-aligned column's header never lined up with its
   (correctly right-aligned) data cells - explicit override here. */
.data-table th.text-right { text-align: right; }

.alert-success svg { width: 16px; height: 16px; flex-shrink: 0; }
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--muted); }
.text-right { text-align: right; }
.table-empty { text-align: center; padding: 40px; color: var(--muted-foreground); }
.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.table-meta { margin-top: 12px; font-size: 12px; color: var(--muted-foreground); }

/* ===== Tabs ===== */

.tabs-list {
  display: inline-flex;
  gap: 2px;
  background: var(--muted);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.tab-trigger {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
}
.tab-trigger.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Modal / dialog ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--background);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  padding: 4px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--muted); }
.modal-close svg { width: 16px; height: 16px; flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.modal-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.modal-description { font-size: 13px; color: var(--muted-foreground); margin-bottom: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.modal-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

/* ===== Toasts (bottom-right, e.g. "dat bestaat al" duplicate warnings) ===== */

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10050;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  min-width: 260px;
  animation: toast-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-danger { border-left-color: var(--danger); }
.toast.leaving { animation: toast-out 0.22s ease forwards; }
.toast-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 138, 44, 0.14);
  color: var(--warning);
}
.toast.toast-danger .toast-icon { background: rgba(214, 69, 69, 0.14); color: var(--danger); }
.toast-icon svg { width: 16px; height: 16px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--muted-foreground); line-height: 1.4; }
.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  border-radius: 6px;
  cursor: pointer;
}
.toast-close:hover { background: var(--muted); }
.toast-close svg { width: 13px; height: 13px; }
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--warning);
  opacity: 0.35;
  transform-origin: left;
  animation: toast-shrink linear forwards;
}
.toast.toast-danger .toast-progress { background: var(--danger); }

@keyframes toast-in {
  0% { transform: translateX(120%) rotate(4deg) scale(0.9); opacity: 0; }
  60% { transform: translateX(-6px) rotate(-1.5deg) scale(1.02); opacity: 1; }
  100% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(110%) rotate(3deg); opacity: 0; }
}
@keyframes toast-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ===== Mobile sidebar sheet ===== */

.mobile-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
}
.mobile-sheet-overlay.hidden { display: none; }
.mobile-sheet {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--card);
  z-index: 9001;
  display: flex;
  flex-direction: column;
}

/* ===== Dropdowns ===== */

.dropdown { position: relative; }
.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  z-index: 50;
  min-width: 220px;
}
.dropdown-panel.hidden { display: none; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--foreground);
}
.dropdown-item svg { width: 14px; height: 14px; }
.dropdown-item:hover { background: var(--muted); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-label { padding: 8px 14px 4px; font-size: 11px; font-weight: 600; color: var(--muted-foreground); }

.notif-panel { width: 320px; padding: 0; }
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.notif-head button { font-size: 12px; font-weight: 500; color: var(--navy); background: none; border: none; }
html.dark .notif-head button { color: var(--gold); }

.link-accent { color: var(--navy); font-weight: 500; }
html.dark .link-accent { color: var(--gold); }
.link-accent:hover { text-decoration: underline; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: var(--muted); }
.notif-row svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.notif-title { font-weight: 500; }
.notif-body { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.notif-foot { padding: 8px; border-top: 1px solid var(--border); }
.notif-foot .btn { width: 100%; }

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ===== Avatar ===== */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.user-btn:hover { background: var(--muted); }
.user-btn .user-name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.user-btn .user-role { font-size: 11px; color: var(--muted-foreground); }

/* ===== Login page ===== */

.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(201, 161, 74, 0.12);
  filter: blur(60px);
  pointer-events: none;
}
.login-glow.a { top: -120px; left: -120px; }
.login-glow.b { bottom: -120px; right: -120px; }
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 560px; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 28px; }
.login-brand-logo {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 28px;
  box-shadow: var(--shadow-card);
}
.login-brand-logo img { display: block; max-width: 280px; width: 100%; height: auto; }

.login-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(6px);
}
.login-card h2 { color: #fff; font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.login-card .login-sub { color: rgba(255, 255, 255, 0.6); font-size: 13px; margin-bottom: 20px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 500; }
.login-input.input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.login-input.input::placeholder { color: rgba(255, 255, 255, 0.35); }
.login-input.input:focus { border-color: var(--gold); }
.login-error {
  background: rgba(214, 69, 69, 0.15);
  border: 1px solid rgba(214, 69, 69, 0.35);
  color: #f3a9a9;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
}
.login-submit { width: 100%; justify-content: center; }

.login-demo-hint { margin-top: 18px; }
.login-demo-hint summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  user-select: none;
}
.login-demo-hint summary:hover { color: rgba(255, 255, 255, 0.8); }
.login-demo-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.login-demo-row:last-child { border-bottom: none; }
.login-demo-row .text-muted { color: rgba(255, 255, 255, 0.4); }
.login-demo-row.login-demo-pw { margin-top: 4px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.15); border-bottom: none; }

.login-footer { text-align: center; color: rgba(255, 255, 255, 0.4); font-size: 11px; margin-top: 20px; }

/* ===== Page header ===== */

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.page-header .page-desc { font-size: 13px; color: var(--muted-foreground); margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ===== Vrije locaties cards ===== */

.location-card-media {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 43, 82, 0.06);
  color: var(--navy);
  border-radius: var(--radius) var(--radius) 0 0;
}
html.dark .location-card-media { background: rgba(13, 43, 82, 0.3); color: #fff; }
.location-card-media svg { width: 32px; height: 32px; opacity: 0.6; }

/* ===== Timeline (geschiedenis) ===== */

.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
}
.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.timeline-icon svg { width: 15px; height: 15px; }

/* ===== Animations ===== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 0.35s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.2s ease-out both; }

/* ===== Toggle switch ===== */

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background-color 0.15s;
  cursor: pointer;
}
.switch-track::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-track { background: var(--navy); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }

/* ===== Kaart (Leaflet tiled map) ===== */

.map-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.map-controls .spacer { flex: 1; }

.map-viewer {
  position: relative;
  height: 65vh;
  min-height: 420px;
  background: #0fa8d2;
}
.map-viewer.add-mode { cursor: crosshair; }
.map-viewer.add-mode .leaflet-container { cursor: crosshair; }

.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: var(--muted-foreground);
  text-align: center;
  padding: 24px;
}
.map-fallback svg { width: 40px; height: 40px; opacity: 0.5; }

.leaflet-map-pin {
  background: none;
  border: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
  transition: filter 0.1s;
}
.leaflet-map-pin:hover { filter: drop-shadow(0 2px 5px rgba(0,0,0,0.55)) brightness(1.08); }

.leaflet-tooltip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: var(--shadow-soft);
}
.leaflet-tooltip-top:before { border-top-color: var(--border); }

.leaflet-tooltip.map-tooltip {
  padding: 10px 12px;
  min-width: 160px;
}
.map-tooltip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.map-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  padding: 2px 0;
}
.map-tooltip-row .text-muted { flex-shrink: 0; }

/* ===== Official document letterhead (Huurovereenkomst, Factuur) ===== */

.doc-paper {
  position: relative;
  overflow: hidden;
  padding: 28px 32px 24px;
}

.doc-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%) rotate(-6deg);
  opacity: 0.05;
  pointer-events: none;
}

.doc-letterhead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 20px;
}

.doc-letterhead-seal {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
}

.doc-letterhead-text {
  flex: 1;
}

.doc-letterhead-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

html.dark .doc-letterhead-name { color: var(--gold); }

.doc-letterhead-tagline {
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-letterhead-doc {
  text-align: right;
}

.doc-letterhead-doc-title {
  font-size: 16px;
  font-weight: 700;
}

.doc-letterhead-doc-id {
  font-size: 12px;
  color: var(--muted-foreground);
  font-family: monospace;
}

.doc-footer-note {
  position: relative;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.doc-generated {
  position: relative;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 8px;
}

.doc-total-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--navy);
  font-size: 16px;
  font-weight: 700;
}

/* ===== Huurcontract (full official form) ===== */

.hc-doc {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hc-header {
  background: var(--navy);
  color: #fff;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.hc-header-brand { display: flex; align-items: center; gap: 12px; }
.hc-header-brand img { width: 50px; height: 50px; flex-shrink: 0; }
.hc-header-brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.25; }
.hc-header-brand-tagline { font-size: 9px; letter-spacing: 0.1em; opacity: 0.75; text-transform: uppercase; }
.hc-header-title { text-align: center; flex: 1; }
.hc-header-title h2 { font-size: 26px; font-weight: 800; letter-spacing: 0.05em; margin: 0; }
.hc-title-rule { width: 56px; height: 3px; background: var(--gold); margin: 6px auto; }
.hc-subtitle { font-size: 10px; letter-spacing: 0.08em; opacity: 0.85; text-transform: uppercase; }
.hc-subtitle.gold { color: var(--gold); font-weight: 700; }
.hc-header-number { text-align: center; flex-shrink: 0; }
.hc-header-number-icon {
  width: 42px; height: 42px; border: 2px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 6px;
}
.hc-header-number-icon svg { width: 18px; height: 18px; color: var(--gold); }
.hc-header-number-label { font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }

.hc-body { padding: 26px 28px; }
.hc-intro { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 22px; }

.hc-section { margin-bottom: 26px; }
.hc-section:last-child { margin-bottom: 0; }
.hc-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hc-section-icon {
  width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hc-section-icon svg { width: 15px; height: 15px; }
.hc-section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  border-bottom: 2px solid var(--gold); padding-bottom: 6px; flex: 1;
}

.hc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.hc-field-row { display: flex; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.hc-field-label { font-weight: 600; width: 118px; flex-shrink: 0; }
.hc-field-colon { color: var(--muted-foreground); }
.hc-field-value { flex: 1; }

.hc-object-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.hc-object-photo {
  border: 2px dashed var(--border); border-radius: 10px; height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted-foreground); overflow: hidden; text-align: center; font-size: 11px;
}
.hc-object-photo img { width: 100%; height: 100%; object-fit: cover; }
.hc-object-photo svg { width: 28px; height: 28px; opacity: 0.4; }

.hc-terms-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.hc-terms-list { margin: 0; padding-left: 18px; font-size: 11.5px; line-height: 1.7; color: var(--foreground); }
.hc-terms-list li { margin-bottom: 4px; }
.hc-callout { border: 1px solid var(--gold); background: rgba(201, 161, 74, 0.08); border-radius: 10px; padding: 12px 14px; font-size: 11.5px; }
.hc-callout-title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
html.dark .hc-callout-title { color: var(--gold); }
.hc-callout-title svg { width: 14px; height: 14px; }
.hc-warning {
  margin-top: 14px; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--warning); background: rgba(224, 138, 44, 0.08); border-radius: 10px; padding: 12px 14px; font-size: 11.5px;
}
.hc-warning svg { width: 17px; height: 17px; color: var(--warning); flex-shrink: 0; margin-top: 1px; }

.hc-fin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.hc-fin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hc-fin-table th { text-align: left; background: var(--muted); padding: 7px 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); }
.hc-fin-table td { padding: 7px 10px; border-top: 1px solid var(--border); }
.hc-fin-table tr.hc-fin-total td { font-weight: 700; border-top: 2px solid var(--navy); }
.hc-notes-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 11.5px; color: var(--muted-foreground); min-height: 90px; }

.hc-sign-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; align-items: start; }
.hc-sign-col-title { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.hc-sign-line { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.hc-sign-line span:first-child { width: 82px; flex-shrink: 0; color: var(--muted-foreground); }
.hc-signature-auto { font-family: "Brush Script MT", cursive; font-size: 17px; color: var(--navy); }
html.dark .hc-signature-auto { color: var(--gold); }
.hc-seal-wrap { display: flex; align-items: center; justify-content: center; }
.hc-seal-wrap img { width: 90px; height: 90px; opacity: 0.9; transform: rotate(-6deg); }

.hc-footer {
  background: var(--navy); color: #fff; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 10.5px;
}
.hc-footer-left { display: flex; align-items: center; gap: 10px; }
.hc-footer-left svg { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; }
.hc-footer-left-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.hc-footer-left-sub { opacity: 0.7; font-size: 9.5px; }
.hc-footer-mid { text-align: center; opacity: 0.85; }
.hc-footer-mid-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 9px; opacity: 0.7; }
.hc-footer-right { display: flex; align-items: center; gap: 10px; }
.hc-footer-qr { width: 42px; height: 42px; background: #fff; border-radius: 4px; padding: 2px; flex-shrink: 0; }
.hc-footer-qr svg { display: block; width: 100%; height: 100%; }
.hc-footer-right-text { opacity: 0.85; font-size: 9.5px; max-width: 110px; }

@media print {
  .hc-header, .hc-footer, .hc-section-icon, .hc-footer-qr {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .hc-doc { break-inside: avoid; border: none; }
}

/* ===== Print ===== */

@page {
  margin: 1.5cm;
}

@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar { display: none !important; }
  .main-content { overflow: visible !important; padding: 0 !important; }
  body { background: #fff !important; }

  /* Printed pages must always use the light palette, even if the user has
     dark mode on — dark mode's near-white --foreground would otherwise
     print as near-invisible text on the forced white background. */
  html.dark {
    --background: #f7f9fb;
    --foreground: #0b1220;
    --card: #ffffff;
    --card-foreground: #0b1220;
    --muted: #eef1f5;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
  }

  .card {
    box-shadow: none !important;
  }

  #printable-dossier, .doc-paper {
    break-inside: avoid;
  }

  .tabs-list { display: none !important; }
  .tab-panel { display: block !important; margin-bottom: 20px; }
  .tab-panel::before {
    content: attr(data-print-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
    margin-bottom: 8px;
  }

  .doc-watermark,
  .doc-letterhead-seal {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
