:root {
  --primary: #0d6efd;
  --dark-bg: #111827;
  --card-bg: #1f2937;
  --border: #374151;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --bs-body-color: #f9fafb;
  --bs-body-bg: #111827;
  --bs-emphasis-color: #f9fafb;
  --bs-secondary-color: #9ca3af;
  --bs-heading-color: #f9fafb;
  --bs-link-color: #60a5fa;
}

body {
  background: var(--dark-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}

/* Navbar */
.navbar {
  background: #0f172a !important;
  border-bottom: 1px solid var(--border);
}

.navbar-brand { font-size: 1rem; }

/* Partners balk */
.partners-bar {
  background: #0d1424;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.partners-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.partners-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

.partners-logos {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  min-width: 120px;
  height: 76px;
}

.logo-pill--dark  { background: #1e293b; }
.logo-pill--light { background: #ffffff; }

.logo-pill img {
  height: 34px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

/* Login pagina logo pills */
.login-logo-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 90px;
  height: 44px;
}

.login-logo-pill--dark  { background: #1e293b; }
.login-logo-pill--light { background: #ffffff; }

.login-logo-pill img {
  height: 28px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.hover-card { transition: border-color 0.15s, box-shadow 0.15s; }
.hover-card:hover { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.card-header {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 14px;
}

.card-body { padding: 16px; }

/* Fase icon */
.fase-icon {
  width: 44px; height: 44px;
  background: rgba(96,165,250,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #60a5fa;
  flex-shrink: 0;
}

/* Avatar */
.avatar-circle {
  width: 40px; height: 40px;
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

/* Stat cards */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card--green { border-color: #16a34a; }
.stat-card--blue  { border-color: #1d4ed8; }
.stat-card--orange{ border-color: #ea580c; }
.stat-num { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Forms */
.form-control, .form-select {
  background: #111827;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  background: #111827;
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.2);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { color: var(--text); }
.form-text  { color: var(--text-muted); }
select option { background: #1f2937; color: var(--text); }

/* Headings & text */
h1,h2,h3,h4,h5,h6 { color: var(--text); }
hr { border-color: var(--border); opacity: 1; }
strong { color: var(--text); }
.text-purple { color: #a78bfa; }

/* Table */
.table {
  color: var(--text);
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-border-color: var(--border);
}
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted) !important; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }

/* List group */
.list-group-item { background: transparent; border-color: var(--border); color: var(--text); }
.list-group-item-action:hover { background: rgba(255,255,255,0.04); color: var(--text); }

/* Buttons */
.btn-primary { background: #2563eb; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-outline-primary { color: #60a5fa; border-color: #2563eb; }
.btn-outline-primary:hover { background: #2563eb; color: #fff; }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border); }
.btn-outline-secondary:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-outline-light { color: #e5e7eb; border-color: #4b5563; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Alerts */
.alert-success { background: rgba(22,163,74,0.15); border-color: #16a34a; color: #4ade80; }
.alert-danger  { background: rgba(220,38,38,0.15); border-color: #dc2626; color: #f87171; }
.alert-warning { background: rgba(234,179,8,0.15); border-color: #ca8a04; color: #fbbf24; }

/* Progress */
.progress { background: rgba(255,255,255,0.1); }

/* Dropdown */
.dropdown-menu { background: var(--card-bg); border-color: var(--border); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.dropdown-header { color: var(--text-muted); }
.dropdown-divider { border-color: var(--border); }

/* Nav tabs */
.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border-color: transparent; }
.nav-tabs .nav-link:hover { color: var(--text); border-color: transparent; }
.nav-tabs .nav-link.active { background: var(--card-bg); border-color: var(--border) var(--border) var(--card-bg); color: var(--text); }

/* Breadcrumb */
.breadcrumb-item a { color: #60a5fa; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ── Timeline ── */
.tl {
  position: relative;
  padding-left: 2rem;
}
.tl::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.tl-item {
  position: relative;
  margin-bottom: 0.625rem;
}
.tl-dot {
  position: absolute;
  left: -2rem;
  top: 0.65rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  background: #1f2937;
  border: 2px solid currentColor;
  z-index: 1;
}
.tl-dag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0.75rem -2rem;
  z-index: 1;
  position: relative;
}
.tl-dag:first-child { margin-top: 0; }
.tl-dag-dot {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.tl-dag-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--dark-bg);
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.tl-card { border-left-width: 3px !important; }
.tl-card--foto     { border-left-color: #3b82f6 !important; }
.tl-card--document { border-left-color: #a78bfa !important; }
.tl-card--notitie  { border-left-color: #fbbf24 !important; }
.tl-card--taak     { border-left-color: #22c55e !important; }

/* Foto lightbox */
.foto-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 9999;
  align-items: center; justify-content: center; cursor: zoom-out;
}
.foto-modal.open { display: flex; }
.foto-modal img { max-width: 95vw; max-height: 90vh; border-radius: 8px; }

/* ── Gantt planning ── */
.gp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gp-table { display: flex; flex-direction: column; min-width: 680px; }
.gp-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.gp-row-header { min-height: 34px; }
.gp-row-fase { min-height: 56px; }
.gp-row-fase:hover { background: rgba(255,255,255,0.02); }
.gp-row-taak { min-height: 30px; }
.gp-row-notice { min-height: 28px; opacity: 0.6; }
.gp-row-edit { background: rgba(255,255,255,0.03); }
.gp-row-legend { min-height: 36px; border-top: 1px solid var(--border); }

.gp-label {
  width: 230px; flex-shrink: 0;
  padding: 6px 10px;
  border-right: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; overflow: hidden;
}
.gp-label-fase { font-weight: 600; }
.gp-label-taak { font-size: 12px; color: var(--text-muted); padding-left: 24px; }

.gp-area {
  flex: 1; position: relative;
  overflow: hidden; min-height: inherit;
}

/* Maandgrid */
.gp-grid-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border); opacity: 0.4; pointer-events: none;
}
.gp-month-label {
  position: absolute; top: 8px; font-size: 10px;
  color: var(--text-muted); transform: translateX(-50%);
  pointer-events: none; white-space: nowrap;
}

/* Vandaag lijn */
.gp-today {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #ef4444; opacity: 0.85; z-index: 3; pointer-events: none;
}
.gp-today-label {
  position: absolute; top: 2px; left: 4px;
  font-size: 9px; font-weight: 700; color: #ef4444;
  text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}

/* Fase balk */
.gp-bar {
  position: absolute; top: 10px; height: 30px; border-radius: 5px;
  overflow: hidden; border: 1.5px solid var(--bar-kleur);
  background: color-mix(in srgb, var(--bar-kleur) 15%, transparent);
  z-index: 2;
}
.gp-bar-prog {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--bar-kleur); opacity: 0.55;
  transition: width 0.3s ease;
}
.gp-bar-lbl {
  position: absolute; left: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: #fff;
  white-space: nowrap; z-index: 1; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Taak ruit */
.gp-milestone {
  position: absolute; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px; z-index: 2; cursor: default;
}

/* Geen datum */
.gp-no-date {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: 12px; font-size: 11px; color: var(--text-muted); font-style: italic;
}

/* Potlood-knop */
.gp-edit-btn {
  background: none; border: none; padding: 2px 4px;
  color: var(--text-muted); cursor: pointer; border-radius: 4px;
  flex-shrink: 0; line-height: 1;
}
.gp-edit-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Legenda */
.gp-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
}

/* ── Slideshow ── */
.ss {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #0a0f1a; border-radius: 8px; overflow: hidden;
}
.ss-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease;
}
.ss-slide.active { opacity: 1; }
.ss-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ss-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  padding: 20px 10px 8px; display: flex; align-items: flex-end; justify-content: space-between;
}
.ss-badge {
  font-size: 11px; font-weight: 600; background: rgba(59,130,246,0.85);
  color: #fff; padding: 2px 8px; border-radius: 99px;
}
.ss-datum { font-size: 11px; color: rgba(255,255,255,0.75); }
.ss-counter {
  position: absolute; top: 8px; right: 10px;
  font-size: 11px; color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5); padding: 2px 7px; border-radius: 99px;
}
.ss-ctrls {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.ss-btn {
  background: rgba(0,0,0,0.55); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: background 0.15s;
  flex-shrink: 0;
}
.ss-btn:hover { background: rgba(0,0,0,0.8); }
.ss-empty {
  aspect-ratio: 16/9; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); background: rgba(255,255,255,0.03);
  border-radius: 8px; border: 1px dashed var(--border);
}

/* ── Voor/Na slider ── */
.ba {
  position: relative; width: 100%; aspect-ratio: 16/9;
  overflow: hidden; border-radius: 8px; cursor: col-resize;
  user-select: none; -webkit-user-select: none;
}
.ba-na, .ba-voor {
  position: absolute; inset: 0;
}
.ba-voor {
  overflow: hidden;
}
.ba-na img, .ba-voor img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;
}
.ba-voor img { width: auto; min-width: 100%; position: absolute; top: 0; left: 0; }
.ba-handle {
  position: absolute; top: 0; bottom: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; z-index: 3;
}
.ba-handle-line { flex: 1; width: 2px; background: #fff; opacity: 0.85; }
.ba-handle-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: #111827;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.ba-label {
  position: absolute; top: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: rgba(0,0,0,0.55);
  padding: 2px 8px; border-radius: 99px; pointer-events: none;
}
.ba-label-voor { left: 10px; }
.ba-label-na   { right: 10px; }
.ba-leeg {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9; color: var(--text-muted); font-size: 14px;
  background: rgba(255,255,255,0.03); border-radius: 8px;
  border: 1px dashed var(--border);
}

/* Verberg spinners op number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Mobile */
@media (max-width: 767.98px) {
  .form-control, .form-select, input, select, textarea { font-size: 16px !important; }
  .form-control, .form-select { min-height: 44px; }
  /* Algemene kleine knoppen: touch-vriendelijk */
  .btn-sm:not(.btn-link) { min-height: 44px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  /* Uitzondering: knoppen BINNEN een tabelcel blijven compact */
  .table .btn-sm:not(.btn-link) { min-height: 34px !important; padding-top: 0.2rem !important; padding-bottom: 0.2rem !important; }
  .table .form-control-sm, .table .form-select-sm { min-height: 34px !important; font-size: 14px !important; }

  .stat-num { font-size: 1.4rem; }
  .alert-dismissible {
    position: fixed; bottom: 20px; left: 12px; right: 12px;
    z-index: 1055; margin-bottom: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  }

  /* Paginaheader: wrap netjes als tekst en badge niet naast elkaar passen */
  .page-header { flex-wrap: wrap; gap: 6px; }
  h1.h3 { font-size: 1.15rem; }

  /* Partners balk: kleiner en scrollbaar */
  .partners-bar { padding: 8px 12px; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .partners-bar::-webkit-scrollbar { display: none; }
  .partners-label { font-size: 10px; }
  .partners-divider { height: 24px; }
  .logo-pill { min-width: 76px; height: 46px; padding: 3px 8px; border-radius: 8px; }
  .logo-pill img { height: 20px; max-width: 100px; }
  .logo-pill--light img { height: 40px; }

  /* Nav tabs: horizontaal scrollbaar, geen wrapping */
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-link { white-space: nowrap; padding: 8px 10px; font-size: 13px; }

  /* Taak status dropdown: touch-vriendelijk */
  .form-select.form-select-sm { min-height: 36px !important; padding-top: 4px; padding-bottom: 4px; }

  /* Card body iets compacter */
  .card-body { padding: 12px; }

  /* Opmerkingen avatar kleiner op small screens */
  .list-group-item .avatar-circle { width: 26px !important; height: 26px !important; font-size: 9px !important; }

  /* Tabel: kleinere tekst */
  .table th, .table td { padding: 8px; font-size: 13px; }

  /* Gantt: smalere labelkolom zodat er meer chartruimte overblijft */
  .gp-label { width: 140px; font-size: 12px; }
  .gp-label-taak { padding-left: 14px; }
  .gp-table { min-width: 520px; }

  /* Planning datum-formulier: stapel inputs verticaal */
  .gp-edit-form form {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .gp-edit-form form input[type="date"] { width: 100% !important; }
  .gp-edit-form form .btn { width: 100%; }
}
