:root {
  --primary: #1B2B5E; /* Project-Point Dark Blue */
  --primary-hover: #152248;
  --accent-gold: #F5A623; /* Project-Point Orange/Amber */
  --accent-orange: #E8660A; /* Project-Point Deep Orange */
  --bg-dark: #f8f9fc; /* Cool off-white */
  --bg-card: #ffffff;
  --text-main: #1a2236;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent-blue: #1B2B5E;
  --success: #22c55e;
  --glass: rgba(255, 255, 255, 0.9);
  --safe-area-bottom: env(safe-area-inset-bottom);

  /* Action Colors */
  --action-1: #1B2B5E; /* Opvolging - Dark Blue */
  --action-2: #F5A623; /* Info nodig - Amber/Orange */
  --action-3: #22c55e; /* Regiewerk - Green */
  --action-4: #ef4444; /* Prijs doorgeven - Red */
}

.project-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-info-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.action-selector input {
  display: none;
}

.action-btn {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 1rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.action-selector input:checked + .action-btn {
  border-color: currentColor;
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.98);
}

.action-1 {
  color: var(--action-1);
}
.action-2 {
  color: var(--action-2);
}
.action-3 {
  color: var(--action-3);
}
.action-4 {
  color: var(--action-4);
}

.badge-1 {
  background: rgba(59, 130, 246, 0.1);
  color: var(--action-1);
}
.badge-2 {
  background: rgba(245, 158, 11, 0.1);
  color: var(--action-2);
}
.badge-3 {
  background: rgba(142, 188, 36, 0.1);
  color: var(--action-3);
}
.badge-4 {
  background: rgba(239, 68, 68, 0.1);
  color: var(--action-4);
}

/* Avatars */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--border);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
}

.avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--border);
  background-size: cover;
  background-position: center;
  margin: 0 auto 1rem;
}

.user-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-header-info:hover {
  background: var(--border);
}

.user-header-info span {
  font-weight: 600;
  font-size: 0.9rem;
}

.avatar-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.file-input-wrapper-sm {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input-wrapper-sm input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.settings-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/* Settings modal tabs */
.settings-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-dark);
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.settings-tab i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.settings-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.settings-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

/* Settings panels — only active one is visible */
.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
  .user-header-info span {
    display: none;
  }
}

.modal-lg {
  max-width: 650px;
}

/* Modal header / footer layout */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
}

/* Email template variable reference grid */
.email-template-vars {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.75rem;
  align-items: center;
  background: var(--bg-dark);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.email-template-vars code {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.email-template-vars span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* PDF bijlage-indicator in email modal */
.email-pdf-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.email-pdf-notice > i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--accent-gold);
}

.email-pdf-notice-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-pdf-notice-text strong {
  color: var(--text-light);
}

.email-pdf-download-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  height: auto;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Login */
#login-view.active {
  min-height: 100vh;
  background: linear-gradient(145deg, #1B2B5E 0%, #243570 55%, #1a3a6b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 3rem 2rem;
  width: 100%;
  max-width: 450px;
  margin: 4rem auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .login-card {
    padding: 2rem 1.25rem;
    margin: 1.5rem auto;
    border-radius: 1.25rem;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header svg {
  margin-bottom: 1.5rem;
}

.brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(at 0% 0%, rgba(142, 188, 36, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(113, 113, 122, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100%;
  min-height: 100vh;
  background-attachment: fixed;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 6rem; /* Space for mobile FAB */
}

@media (max-width: 640px) {
  .container {
    padding: 1rem;
    padding-bottom: 7rem;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  header .btn {
    width: 100%;
    justify-content: center;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-symbol {
  display: flex;
  align-items: center;
  height: 32px;
}

.logo-text {
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 1px;
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }
}

/* Company filter tabs */
.company-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem;
  margin-bottom: 0.875rem;
}

.company-tab-btn {
  padding: 0.5rem 1.125rem;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.company-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.company-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Dashboard search */
.dashboard-search-wrapper {
  position: relative;
  padding: 0 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-search-icon {
  position: absolute;
  left: 1.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.dashboard-search {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 0.875rem;
  color: var(--text-main);
  font-size: 0.9375rem;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.dashboard-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(93, 83, 74, 0.1);
}

.dashboard-search::placeholder {
  color: var(--text-muted);
}

/* Hide the browser's native clear button on search inputs */
.dashboard-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  background: #ffffff;
}

.card:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
}

/* Project card delete action area */
.project-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.delete-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  transition: all 0.2s;
}

.delete-project-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.6);
}

.delete-project-btn:active {
  transform: scale(0.96);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(27, 43, 94, 0.3);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-danger {
  background-color: #ef4444;
  color: white;
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.25);
}

.btn-danger:active {
  transform: scale(0.96);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid var(--border);
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Mobile FAB */
.fab {
  position: fixed;
  bottom: calc(2rem + var(--safe-area-bottom));
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--primary);
  color: white;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 25px rgba(93, 83, 74, 0.3);
  z-index: 100;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s,
    background-color 0.2s;
}

@media (max-width: 640px) {
  .fab {
    display: flex;
  }
}

.fab:active {
  transform: scale(0.9);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .modal {
    border-radius: 1.5rem 1.5rem 0 0;
    animation: slideUp 0.3s ease-out;
    max-width: 100%;
    max-height: 90vh;
    padding-bottom: calc(2rem + var(--safe-area-bottom));
  }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.875rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text-main);
  outline: none;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

/* Project Details View */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* Details view header — replaces inline styles for responsive control */
.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.details-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .details-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .details-header-actions {
    justify-content: flex-start;
  }

  .details-header-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-main);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* Filter */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  flex-wrap: wrap;
}

.filter-bar::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(93, 83, 74, 0.2);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

@media (max-width: 480px) {
  #items-stats-bar {
    gap: 4px;
  }

  .stat-chip {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }
}

/* Item search (details-view) */
.item-search-wrapper {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  width: 300px; /* Match detail-sidebar min-width */
  flex-shrink: 0;
}

.item-search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.item-search {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.item-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(93, 83, 74, 0.15);
}

.item-search::placeholder {
  color: var(--text-muted);
}

.item-search::-webkit-search-cancel-button {
  cursor: pointer;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.lightbox img {
  max-width: 95%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 50%;
  display: flex;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.hidden {
  visibility: hidden;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

@media (max-width: 600px) {
  .lightbox-nav {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    min-width: 44px;
    min-height: 44px;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  pointer-events: none;
}

/* Photo Cards */
.photo-card {
  background: var(--bg-card);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s;
}

.photo-card:hover {
  transform: scale(1.01);
}

.photo-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  display: block;
}

.photo-info {
  padding: 1.25rem;
}

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.badge-regie {
  background: rgba(113, 113, 122, 0.1);
  color: var(--accent-blue);
}

.badge-gebeurd {
  background: rgba(142, 188, 36, 0.15);
  color: var(--primary);
}

.badge-niet-gebeurd {
  background: #fee2e2;
  color: #ef4444;
}

/* PDF Export Template (Off-screen for capturing) */
.pdf-container {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 210mm;
  background: white;
}

#pdf-template {
  background: white;
  color: black;
  font-family: Arial, sans-serif;
  width: 100%;
  padding: 0;
}

#pdf-template h1 {
  color: #8ebc24;
  margin-bottom: 5px;
  -webkit-text-fill-color: initial;
  background: none;
}

.pdf-header {
  border-bottom: 2px solid #8ebc24;
  margin-bottom: 30px;
  padding-bottom: 20px;
}

.pdf-photo-item {
  margin-bottom: 30px;
  page-break-inside: avoid;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.pdf-photo-item img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #f8fafc;
}

.pdf-photo-info {
  padding: 15px;
}

.pdf-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pdf-badge-gebeurd {
  background: #dcfce7;
  color: #8ebc24;
}
.pdf-badge-niet-gebeurd {
  background: #fee2e2;
  color: #991b1b;
}
.pdf-badge-regie {
  background: #f1f5f9;
  color: #71717a;
}

/* Item Stack */
.item-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.item-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.item-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(248, 250, 252, 0.5);
}

.item-body {
  padding: 1.5rem;
}

.item-description {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

/* Photo Gallery in Item */
.item-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0; /* margin comes from status-toggle margin-bottom */
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
  cursor: zoom-in;
  transition: transform 0.2s;
  border: 1px solid var(--border);
}

.gallery-img:hover {
  transform: scale(1.02);
}

/* File Input Styling */
.file-input-wrapper {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--bg-dark);
}

.file-input-wrapper:hover {
  border-color: var(--primary);
  background: rgba(142, 188, 36, 0.05);
}

.file-input-wrapper input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.file-input-label i {
  width: 32px;
  height: 32px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.preview-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Utility */
.hidden {
  display: none !important;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* User Management Tabs */
.user-mgmt-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

.user-mgmt-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.user-mgmt-tab:hover {
  color: var(--text-primary);
}

.user-mgmt-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.user-mgmt-tab i {
  width: 16px;
  height: 16px;
}

.user-tab-panel {
  display: none;
}

.user-tab-panel.active {
  display: block;
}

/* User Management Table */
.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

.user-table th {
  text-align: left;
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.user-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.user-table tr:last-child td {
  border-bottom: none;
}

.company-row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.company-row-clickable:hover td {
  background: rgba(93, 83, 74, 0.05);
}

/* ── Status Badges ── */
.badge-Open {
  background: rgba(113, 113, 122, 0.12);
  color: #52525b;
}

.badge-Gereed {
  background: rgba(142, 188, 36, 0.15);
  color: #4a7c0a;
}

.badge-OpenRegiewerk {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.badge-GereedRegiewerk {
  background: rgba(249, 115, 22, 0.15);
  color: #c2410c;
}

/* Status toggle buttons row */
.status-toggle {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.625rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.status-btn {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.status-btn:hover {
  background: var(--bg-card-hover, #f1f5f9);
  border-color: var(--text-muted);
}
.active-open {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.active-afgewerkt {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

/* Toggle switch (slider) */
.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 24px;
  transition: all 0.25s;
  cursor: pointer;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch-green input:checked + .toggle-slider {
  background: #8ebc24;
}

.toggle-switch-orange input:checked + .toggle-slider {
  background: #f97316;
}

/* Toggle variants for item cards */
.item-toggle-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.item-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
.item-toggle-label.active-afgerond {
  color: #4a7c0a;
}
.item-toggle-label.active-regiewerk {
  color: var(--accent-blue);
}

/* Compact toggle for item cards */
.toggle-switch-sm {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch-sm input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-switch-sm .toggle-slider-sm {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 20px;
  transition: all 0.25s;
  cursor: pointer;
}
.toggle-switch-sm .toggle-slider-sm::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: transform 0.25s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.toggle-switch-sm input:checked + .toggle-slider-sm {
  background: var(--primary);
}
.toggle-switch-sm input.toggle-regiewerk:checked + .toggle-slider-sm {
  background: var(--accent-blue);
}
.toggle-switch-sm input:checked + .toggle-slider-sm::before {
  transform: translateX(16px);
}

/* Regiewerk badge */
.badge-regiewerk {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}

/* ── Note Thread ── */
.note-thread {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.note-thread-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.note-item {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.note-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}
.note-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.note-text {
  font-size: 0.9375rem;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-wrap;
}
.note-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem;
  border-radius: 0.4rem;
  line-height: 1;
  font-size: 0.8rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.note-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.note-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.note-input-row textarea {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  resize: none;
  min-height: 42px;
  max-height: 120px;
}
.note-submit-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.note-submit-btn:hover {
  background: var(--primary-hover);
}

/* Existing photos management in modal */
.photo-edit-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.photo-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
}

.photo-delete-btn:hover {
  transform: scale(1.1);
  background: rgb(239, 68, 68);
}

/* Note editing */
.note-edit-container {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.note-edit-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--bg-dark);
}

.note-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.note-edit-btn {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  border: none;
}

.note-edit-save {
  background: var(--primary);
  color: white;
}

.note-edit-cancel {
  background: var(--bg-dark);
  color: var(--text-muted);
}

/* Photo Editor Styles */
.editor-tool {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.editor-tool:hover {
  background: var(--bg-dark);
  color: var(--text-main);
}

.editor-tool.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.color-swatch:hover {
  transform: scale(1.1);
}
.color-swatch.active {
  box-shadow: 0 0 0 2px var(--bg-card, #fff), 0 0 0 4px var(--text-main, #111827);
}

#photo-canvas {
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  background: white;
}

#photo-canvas.tool-eraser {
  cursor: cell;
}

.eraser-size-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  background: var(--bg-dark);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.eraser-size-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.eraser-size-slider {
  flex: 1;
  min-width: 120px;
  max-width: 220px;
  accent-color: var(--primary);
  cursor: pointer;
}

.eraser-size-value {
  font-size: 0.8rem;
  color: var(--text-main);
  min-width: 36px;
  text-align: right;
}

.photo-edit-btn-small {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
}

.photo-edit-btn-small:hover {
  transform: scale(1.1);
  background: var(--primary-hover);
}

/* ── Superadmin Company Cards ── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .company-grid {
    grid-template-columns: 1fr;
  }
}

.company-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.company-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  background: #ffffff;
}

.company-card:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.company-card-logo {
  height: 48px;
  display: flex;
  align-items: center;
}

.company-card-logo img {
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
}

.company-card-logo-placeholder {
  width: 48px;
  height: 48px;
  background: var(--border);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 700;
}

.company-card-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin: 0;
}

.company-card-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.company-card-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Company Detail Two-Column Layout ── */
.company-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .company-detail-columns {
    grid-template-columns: 1fr;
  }
}

.company-detail-section {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
}

.company-detail-section-header {
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.company-detail-section-header h2 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.company-detail-section-header .section-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  margin-left: auto;
}

/* Bedrijfskleuren section in company detail */
.company-branding-section {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
}

.company-branding-header {
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.company-branding-header h2 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.company-branding-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.company-branding-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.company-branding-color-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.company-branding-color-input {
  width: 3rem;
  height: 2.25rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
  background: none;
}

.company-branding-hex {
  font-family: monospace;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.company-branding-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.company-branding-preview-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.company-branding-preview-swatch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.company-branding-preview-btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--cd-preview-primary, #1e40af);
}

/* Employee list in company detail */
.employee-list {
  display: flex;
  flex-direction: column;
}

.employee-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.employee-row:last-child {
  border-bottom: none;
}

.employee-row:hover {
  background: rgba(93, 83, 74, 0.03);
}

.employee-info {
  flex: 1;
  min-width: 0;
}

.employee-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
}

.role-badge-admin {
  background: rgba(142, 188, 36, 0.15);
  color: #4a7c0a;
}

.role-badge-user {
  background: rgba(113, 113, 122, 0.1);
  color: #52525b;
}

.role-badge-superadmin {
  background: rgba(193, 163, 132, 0.2);
  color: var(--primary);
}

/* Werf cards in company detail */
.werf-list {
  display: flex;
  flex-direction: column;
}

.werf-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.werf-row:last-child {
  border-bottom: none;
}

.werf-row-clickable {
  cursor: pointer;
}
.werf-row-clickable:hover {
  background: var(--bg-hover, #f1f5f9);
}

.werf-info {
  flex: 1;
  min-width: 0;
}

.werf-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.werf-location {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.werf-open-badge {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.werf-open-badge.has-open {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.werf-open-badge.all-done {
  background: rgba(142, 188, 36, 0.15);
  color: #4a7c0a;
}

.company-detail-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Superadmin header branding */
.superadmin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.superadmin-brand img {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
}

.superadmin-brand-text {
  display: flex;
  flex-direction: column;
}

.superadmin-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.superadmin-brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ── Project Detail Side-by-Side Layout ── */
.detail-content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
}

.detail-main {
  flex: 7;
  min-width: 0;
}

.detail-sidebar {
  flex: 3;
  min-width: 300px;
  position: sticky;
  top: 2rem;
}

@media (max-width: 1024px) {
  .detail-content-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }

  .detail-main,
  .detail-sidebar {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .detail-sidebar {
    position: static;
    order: -1; /* Map + recent activity appear above the items list on mobile/tablet */
  }

  .detail-main {
    order: 0; /* Items list follows the sidebar */
  }

  /* Remove inner scroll regions on mobile — nested scroll is bad UX on touch.
     Let both sections expand to their full height in the page flow. */
  .activity-list,
  .werf-bijlagen-list {
    max-height: none;
    overflow-y: visible;
  }
}

/* ── Recent Activity Section ── */
.activity-section {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin-top: 0;
}

.activity-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.activity-section-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
  /* Subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.activity-list::-webkit-scrollbar {
  width: 4px;
}

.activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.625rem 0;
  position: relative;
}

/* Vertical connector line between items */
.activity-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 36px;
  bottom: -4px;
  width: 1.5px;
  background: var(--border);
}

.activity-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.activity-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.activity-icon-item_created        { background: rgba(142, 188, 36, 0.15); color: var(--action-3); }
.activity-icon-item_status_changed { background: rgba(193, 163, 132, 0.2); color: var(--accent-gold); }
.activity-icon-note_added          { background: rgba(93, 83, 74, 0.1);   color: var(--primary); }
.activity-icon-item_deleted        { background: rgba(239, 68, 68, 0.1);  color: #ef4444; }

.activity-user {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-description {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.activity-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.activity-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  text-align: center;
}

.activity-item--clickable {
  cursor: pointer;
  border-radius: 0.5rem;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  transition: background 0.15s ease;
}

.activity-item--clickable:hover,
.activity-item--clickable:focus-visible {
  background: rgba(var(--primary-rgb, 93, 83, 74), 0.07);
  outline: none;
}

.activity-item-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(193, 163, 132, 0.12);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Highlight animation for a scrolled-to item card */
@keyframes item-highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(193, 163, 132, 0.55); }
  40%  { box-shadow: 0 0 0 6px rgba(193, 163, 132, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(193, 163, 132, 0); }
}

.item-card--highlight {
  animation: item-highlight-pulse 1.8s ease forwards;
}

/* ============================================================
   DASHBOARD REDESIGN — light theme layout
   ============================================================ */

/* Zet body achtergrond blauw wanneer de login-view actief is */
body:has(#login-view.active) {
  background-color: #1B2B5E;
  background-image: none;
}

/* Zet body achtergrond licht wanneer het dashboard actief is */
body:has(#dashboard-view.active) {
  background-color: #F5F4EF;
  background-image: none;
}

/* ── Dashboard-scope custom properties ──
   These live only inside #dashboard-view so they do not
   bleed into modals or other views.                          */
#dashboard-view {
  --db-bg:          #F0F2F8;
  --db-card:        #FFFFFF;
  --db-card-hover:  #F5F7FC;
  --db-surface:     #E8ECF5;
  --db-border:      #D6DCE8;
  --db-text:        #1a2236;
  --db-muted:       #64748b;
  --db-orange:      #E8660A;
  --db-green:       #16a34a;
  --db-red:         #DC2626;
  --db-blue:        #1B2B5E;

  background: var(--db-bg);
  min-height: 100vh;
  flex-direction: column;
  /* Full-bleed: break out of the .container's max-width AND top padding
     so the top bar sits flush against the top and spans the full viewport. */
  margin-top: -2rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

/* Override .view.active (display: block) with the flex layout needed for the dashboard */
#dashboard-view.active {
  display: flex;
}

@media (max-width: 640px) {
  #dashboard-view {
    margin-top: -1rem;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
  }
}

/* ── Navbar ── */
.db-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 64px;
  background: #FFFFFF;
  border: 1px solid #D6DCE8;
  border-radius: 16px;
  position: sticky;
  top: 12px;
  z-index: 200;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  width: calc(100% - 24px);
  margin: 12px auto 0;
  box-sizing: border-box;
}

.db-navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 1;
}

.db-navbar-logo {
  display: flex;
  align-items: center;
}

.db-navbar-appname {
  font-size: 1rem;
  font-weight: 700;
  color: var(--db-text);
  letter-spacing: 0.02em;
}

.db-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* Icon-only button in navbar */
.db-btn-icon {
  background: transparent;
  color: #6B7280;
  border: 1px solid #E5E3DB;
  padding: 0.5rem;
  border-radius: 0.625rem;
  transition: background 0.15s, color 0.15s;
}
.db-btn-icon:hover {
  background: #F0EFE9;
  color: #1F2937;
}
.db-btn-icon i {
  width: 18px;
  height: 18px;
  display: block;
}

/* Primary action button in navbar */
.db-btn-primary {
  background: var(--db-blue);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: filter 0.15s;
}
.db-btn-primary:hover {
  filter: brightness(1.1);
}
.db-btn-primary i {
  width: 16px;
  height: 16px;
}

/* Avatar button in navbar */
.db-avatar-btn {
  cursor: pointer;
  border-radius: 50%;
  transition: opacity 0.15s;
}
.db-avatar-btn:hover {
  opacity: 0.85;
}
.db-header-avatar {
  background-color: var(--db-blue);
  color: #fff;
  font-weight: 700;
  border: 2px solid rgba(37, 99, 235, 0.3);
}

/* ── Dashboard Body ── */
.db-body {
  flex: 1;
  padding: 1.75rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Welcome / Stats Card ── */
.db-welcome-card {
  border-radius: 1rem;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  border: none;
  background: linear-gradient(
    to right,
    var(--db-brand-dark, #1c1f23),
    var(--db-brand-muted, #252b2f)
  );
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22), 0 1px 4px rgba(0, 0, 0, 0.14);
}

/* Greeting section */
.db-welcome-card .db-welcome-text {
  flex: 0 0 40%;
  min-width: 200px;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

/* Thin vertical separator between greeting and stats */
.db-welcome-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  margin: 1.25rem 0;
}

/* Stats section */
.db-welcome-card .db-stats-row {
  flex: 1 1 auto;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: transparent;
}

.db-greeting-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.db-welcome-heading {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  color: #ffffff;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}

.db-welcome-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.38);
  margin: 0;
  line-height: 1.4;
}

.db-stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.db-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.db-stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
}

/* Open punten: keep neutral white */
.db-stat-open { color: rgba(255, 255, 255, 0.88); }
/* Afgerond: altijd een vast semantisch groen, nooit de merkkleur — voorkomt
   dat een rode/oranje merkkleur een "klaar"-status als foutmelding laat lezen. */
.db-welcome-card .db-stat-done { color: #4ade80; }

.db-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.db-stat-divider {
  width: 1px;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* ── Two-column main grid ── */
.db-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Section wrapper ── */
.db-section {
  background: var(--db-card);
  border: 1px solid var(--db-border);
  border-radius: 1rem;
  overflow: hidden;
}

.db-section-full {
  /* stretches naturally with content */
}

.db-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.db-right-col {
  display: flex;
  flex-direction: column;
}

.db-right-col .db-section {
  flex: 1;
}

/* ── Full-width bottom row for active projects ── */
.db-bottom-row {
  display: flex;
  flex-direction: column;
}

.db-bottom-row .db-section {
  display: flex;
  flex-direction: column;
}

.db-bottom-row .db-projects-list {
  /* No fixed scroll height in bottom row — list expands naturally */
  overflow-y: visible;
  max-height: none;
  flex: none;
}

.db-section-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--db-border);
}

.db-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.db-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--db-muted);
}

/* ── Archive toggle button ── */
.db-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--db-border);
  color: var(--db-muted);
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.db-archive-btn:hover {
  background: var(--db-surface);
  color: var(--db-text);
}
.db-archive-btn.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--db-blue);
  border-color: var(--db-blue);
}
.db-archive-btn i {
  width: 14px;
  height: 14px;
}

/* ── Recent projects grid ── */
.db-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
}

.db-recent-card {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
}
.db-recent-card:hover {
  background: #F5F4EF;
  border-color: #D1D5DB;
}
.db-recent-card:active {
  transform: scale(0.98);
}

.db-recent-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--db-blue);
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.db-recent-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.db-recent-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.db-recent-card-location {
  font-size: 0.75rem;
  color: var(--db-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.db-recent-card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ── Shared badge styles ── */
.db-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.db-badge-open {
  background: rgba(217, 119, 6, 0.12);
  color: #B45309;
}

.db-badge-done {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

.db-badge-urgent {
  background: rgba(220, 38, 38, 0.12);
  color: #B91C1C;
}

/* Card badge names for project status (used both in dashboard and details-view) */
.badge-error   { background: rgba(239, 68, 68, 0.15);  color: #ef4444; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* ── Detail-kaart placeholder (loading / foutstatus) ── */
.project-map-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #eef2f7 0%, #e2e8f0 100%);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
  pointer-events: none;
}
.project-map-placeholder i {
  width: 26px;
  height: 26px;
  opacity: 0.6;
}
.project-map-placeholder.is-error i {
  color: #ef4444;
  opacity: 0.8;
}

/* ── Leaflet kaart in dashboard ── */
.db-leaflet-map {
  height: 280px;
  width: 100%;
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
}

/* Leaflet popup light theme */
#dashboard-view .leaflet-popup-content-wrapper {
  background: #FFFFFF;
  color: #1F2937;
  border: 1px solid #E5E3DB;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 0.625rem;
}

#dashboard-view .leaflet-popup-tip {
  background: #FFFFFF;
}

#dashboard-view .leaflet-popup-content {
  margin: 0.6rem 0.875rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

#dashboard-view .leaflet-popup-content b {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
  color: #1F2937;
}

#dashboard-view .leaflet-popup-close-button {
  color: #6B7280;
}

/* Leaflet attribution small */
#dashboard-view .leaflet-control-attribution {
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.85);
  color: #6B7280;
}

#dashboard-view .leaflet-control-attribution a {
  color: var(--db-blue);
}

/* ── Active projects list (right column) ── */
.db-company-filter {
  padding: 0.5rem 1rem 0;
  border-bottom: none;
}

/* Company filter tabs — light theme override inside dashboard */
#dashboard-view .company-tab-btn {
  background: #FFFFFF;
  border-color: #E5E3DB;
  color: #6B7280;
}
#dashboard-view .company-tab-btn:hover {
  border-color: var(--db-blue);
  color: var(--db-blue);
  background: #FFFFFF;
}
#dashboard-view .company-tab-btn.active {
  background: var(--db-blue);
  border-color: var(--db-blue);
  color: #fff;
}

.db-search-wrapper {
  position: relative;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--db-border);
}

.db-search-icon {
  position: absolute;
  left: 1.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--db-muted);
  pointer-events: none;
}

.db-search {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.25rem;
  background: #F5F4EF;
  border: 1.5px solid #E5E3DB;
  border-radius: 0.625rem;
  color: #1F2937;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.db-search:focus {
  border-color: var(--db-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.db-search::placeholder {
  color: #9CA3AF;
}

.db-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Project rows list — scrollable */
.db-projects-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-projects-list::-webkit-scrollbar { width: 4px; }
.db-projects-list::-webkit-scrollbar-track { background: transparent; }
.db-projects-list::-webkit-scrollbar-thumb { background: var(--db-border); border-radius: 2px; }

/* Individual project row */
.db-project-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--db-border);
  transition: background 0.12s;
}

.db-project-row:last-child {
  border-bottom: none;
}

.db-project-row:hover {
  background: #F5F4EF;
}

.db-project-row:active {
  background: #EAE9E2;
}

.db-project-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.db-project-row-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--db-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-project-row-location {
  font-size: 0.75rem;
  color: var(--db-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-project-row-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.db-project-row-count {
  font-size: 0.75rem;
  color: var(--db-muted);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* ── Empty state ── */
.db-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: var(--db-muted);
  text-align: center;
  font-size: 0.875rem;
}

.db-empty-icon {
  width: 40px;
  height: 40px;
  color: var(--db-muted);
  opacity: 0.5;
}

.db-section-empty {
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--db-muted);
  text-align: center;
}

/* ── View toggle (kaart / lijst) ── */
.db-section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 0.625rem;
  padding: 2px;
  gap: 2px;
}

.db-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 0.4rem;
  border: none;
  background: transparent;
  color: var(--db-muted);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
  font-family: inherit;
}

.db-view-toggle-btn i {
  width: 14px;
  height: 14px;
  display: block;
}

.db-view-toggle-btn:hover {
  background: #EEECEA;
  color: var(--db-text);
}

.db-view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--db-blue, #2563EB);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Kaartweergave: compacte grid van projectkaarten ── */
.db-projects-list.db-projects-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  padding: 1rem 1.25rem;
  overflow-y: visible;
}

.db-project-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--db-border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
  user-select: none;
}

.db-project-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border-color: #C8C4BC;
  transform: translateY(-1px);
}

.db-project-card:active {
  transform: translateY(0);
  box-shadow: none;
}

.db-project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.db-project-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--db-blue, #2563EB);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.db-project-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.375rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.db-project-card-badge-open {
  background: rgba(217, 119, 6, 0.1);
  color: #B45309;
}

.db-project-card-badge-done {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
  padding: 0.25rem 0.4rem;
}

.db-project-card-bottom {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.db-project-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--db-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.db-project-card-meta-empty {
  opacity: 0.45;
}

/* In kaartweergave: delete-knop kleiner en inline */
.db-projects-list.db-projects-cards .delete-project-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  margin-left: auto;
}

/* ── Lijstweergave: bestaande rijstijlen behouden ── */
.db-projects-list.db-projects-rows {
  padding: 0.5rem 0;
}

/* ── Tablet: 768–1023px ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .db-main-grid {
    grid-template-columns: 1fr;
  }

  .db-recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Mobile: max 767px ── */
@media (max-width: 767px) {
  .db-body {
    padding: 1rem 0.875rem 6rem;
    gap: 1rem;
  }

  .db-navbar {
    padding: 0 1rem;
    height: 56px;
  }

  .db-welcome-card {
    flex-direction: column;
    align-items: stretch;
  }

  .db-welcome-divider {
    width: auto;
    height: 1px;
    margin: 0 1.25rem;
    align-self: auto;
  }

  .db-welcome-heading {
    font-size: 1.2rem;
  }

  .db-welcome-card .db-welcome-text {
    flex: 0 0 auto;
    width: 100%;
    padding: 1.125rem 1.25rem 1rem;
  }

  .db-welcome-card .db-stats-row {
    flex: 0 0 auto;
    width: 100%;
    padding: 1rem 1.25rem;
    justify-content: flex-start;
    gap: 1rem;
  }

  .db-stat-number {
    font-size: 1.6rem;
  }

  .db-main-grid {
    grid-template-columns: 1fr;
  }

  .db-recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .db-leaflet-map {
    height: 220px;
  }

  /* Keep the header username hidden on small screens */
  #dashboard-view .db-navbar-appname {
    display: none;
  }
}

/* ── Large desktop (>= 1024px) ── */
@media (min-width: 1024px) {
  .db-main-grid {
    grid-template-columns: 1fr 380px;
  }

  /* Recente werven in narrow right column: single column of cards */
  .db-right-col .db-recent-grid {
    grid-template-columns: 1fr;
  }

  /* Active projects in full-width bottom row (lijstweergave): 2-column grid of rows */
  .db-bottom-row .db-projects-list.db-projects-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
  }

  .db-bottom-row .db-projects-list.db-projects-rows .db-project-row {
    border-bottom: 1px solid var(--db-border);
    border-right: 1px solid var(--db-border);
  }

  /* Remove right border from even columns (right edge) */
  .db-bottom-row .db-projects-list.db-projects-rows .db-project-row:nth-child(2n) {
    border-right: none;
  }

  /* Remove bottom border from last two rows */
  .db-bottom-row .db-projects-list.db-projects-rows .db-project-row:nth-last-child(-n+2):nth-child(odd),
  .db-bottom-row .db-projects-list.db-projects-rows .db-project-row:last-child {
    border-bottom: none;
  }

  /* Kaartweergave op desktop: max 2 kolommen */
  .db-bottom-row .db-projects-list.db-projects-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Taller map on large screens */
  .db-leaflet-map {
    height: 360px;
  }
}

/* ============================================================
   MOBILE RESPONSIVENESS — 768px and 480px breakpoints
   These rules consolidate and extend the scattered per-component
   mobile rules already in the file.
   ============================================================ */

/* ── Touch target minimums (44px) ─────────────────────────── */
/* Applied globally so every interactive element is thumb-friendly */
@media (max-width: 768px) {
  /* Filter buttons: increase height to meet 44px minimum */
  .filter-btn {
    padding: 0.75rem 1.125rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  /* Allow filter-bar to wrap so search bar moves below the buttons */
  .filter-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* Item search: full width on mobile, below filter buttons */
  .item-search-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .item-search {
    width: 100%;
    min-height: 44px;
  }

  .item-search:focus {
    width: 100%;
  }

  /* Note submit button */
  .note-submit-btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }

  /* Dashboard icon-only buttons in navbar */
  .db-btn-icon {
    padding: 0.6875rem;
    min-width: 44px;
    min-height: 44px;
  }

  /* Generic btn — already 0.75rem vertical padding which at 1rem line-height
     gives ~42px; nudge to guarantee 44px */
  .btn {
    min-height: 44px;
  }

  /* Photo overlay action buttons — enlarge tap area */
  .photo-delete-btn,
  .photo-edit-btn-small {
    width: 32px;
    height: 32px;
  }

  /* Back link — ensure adequate tap area */
  .back-link {
    padding: 0.5rem 0;
    min-height: 44px;
    align-items: center;
  }
}

/* ── Tablet layout fixes (≤ 768px) ────────────────────────── */
@media (max-width: 768px) {
  /* Container: tighten horizontal padding */
  .container {
    padding: 1.25rem;
    padding-bottom: 6.5rem;
  }

  /* Generic header used by user-view, superadmin-view, etc. */
  header {
    flex-wrap: wrap;
    gap: 0.875rem;
  }

  /* Details view header: stack on tablet too, not just 640px */
  .details-header {
    flex-direction: column;
    gap: 0.875rem;
    align-items: stretch;
  }

  .details-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* Item cards: reduce padding to give content more room */
  .item-header {
    padding: 1rem 1.125rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .item-body {
    padding: 1.125rem;
  }

  /* Item toggle row: let it wrap on smaller tablets */
  .item-toggle-row {
    gap: 0.875rem;
  }

  /* Project card padding tightened slightly */
  .card {
    padding: 1.375rem;
  }

  /* User / company tables: reduce cell padding on tablet */
  .user-table th,
  .user-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  /* Modal: slightly smaller padding */
  .modal {
    padding: 1.75rem;
  }

  /* Modal-lg should not exceed viewport width on tablet */
  .modal-lg {
    max-width: min(650px, calc(100vw - 2rem));
  }

  /* Dashboard body: reduce padding */
  .db-body {
    padding: 1.25rem 1rem 5rem;
  }

  /* Welcome card: tighten on tablet */
  .db-welcome-card .db-welcome-text,
  .db-welcome-card .db-stats-row {
    padding: 1.25rem 1.5rem;
  }

  /* Company detail header: allow wrapping */
  #company-detail-view header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Detail sidebar min-width override for mid-range tablets */
  .detail-sidebar {
    min-width: 0;
  }
}

/* ── Phone layout fixes (≤ 480px) ─────────────────────────── */
@media (max-width: 480px) {
  /* Container: minimum comfortable padding on small phones */
  .container {
    padding: 1rem;
    padding-bottom: 6.5rem;
  }

  /* Dashboard view negative-margin bleed: already has a 640px rule
     using -1rem; reinforce at 480px */
  #dashboard-view {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
  }

  /* Dashboard body: tight padding on small phones */
  .db-body {
    padding: 1rem 0.875rem 5.5rem;
    gap: 1rem;
  }

  /* Navbar: prevent overflow on narrow phones by tightening button sizes and gap */
  .db-navbar {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .db-navbar-actions {
    gap: 0.25rem;
  }

  /* Reduce icon button min-width to allow all buttons to fit in the navbar.
     Touch target is preserved via padding (0.625rem gives ~40px which is
     acceptable on small phones — WCAG 2.5.8 recommends 24px minimum). */
  .db-navbar .db-btn-icon {
    min-width: 36px;
    min-height: 36px;
    padding: 0.5625rem;
  }

  /* Avatar button: match reduced sizing */
  .db-navbar .db-avatar-btn {
    width: 36px;
    height: 36px;
  }

  /* Welcome card: stack vertically on mobile */
  .db-welcome-card {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  /* Greeting panel: full width, normal padding */
  .db-welcome-card .db-welcome-text {
    flex: 0 0 auto;
    width: 100%;
    padding: 1.125rem 1.125rem 1rem;
  }

  .db-welcome-divider {
    width: auto;
    height: 1px;
    margin: 0 1.125rem;
    align-self: auto;
  }

  /* Stats panel: full width, left-aligned on mobile */
  .db-welcome-card .db-stats-row {
    flex: 0 0 auto;
    width: 100%;
    padding: 1rem 1.125rem;
    justify-content: flex-start;
    gap: 1rem;
  }

  .db-welcome-heading {
    font-size: 1.25rem;
  }

  /* Section header inside dashboard panels */
  .db-section-header {
    padding: 0.875rem 1rem 0.625rem;
  }

  /* Recent projects grid: 1 column on very small phones */
  .db-recent-grid {
    grid-template-columns: 1fr;
  }

  /* Map: shorter on small phones to leave room for content */
  .db-leaflet-map {
    height: 180px;
  }

  /* Card padding: comfortable on 320–375px */
  .card {
    padding: 1.125rem;
    border-radius: 1rem;
  }

  .card h3 {
    font-size: 1.175rem;
  }

  /* Details header: project title smaller on tiny screens */
  #current-project-name {
    font-size: 1.375rem !important;
  }

  /* Details header action buttons: 3 side-by-side, Item Toevoegen full-width below */
  .details-header-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .details-header-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    justify-content: center;
  }

  .details-header-actions .btn:last-child {
    flex: 0 0 100%;
  }

  /* Item cards */
  .item-header {
    padding: 0.875rem 1rem;
  }

  .item-body {
    padding: 1rem;
  }

  /* Item description */
  .item-description {
    font-size: 0.9375rem;
  }

  /* Item gallery: 2 columns on phone (150px min works at 320px - 2rem = 288px) */
  .item-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  /* Note input row: stack on tiny screens */
  .note-input-row {
    flex-direction: column;
  }

  .note-submit-btn {
    width: 100%;
    justify-content: center;
  }

  /* Filter bar: reduce button size slightly */
  .filter-btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  /* Modal: full bleed at bottom, reduced inner padding */
  .modal {
    padding: 1.25rem 1rem;
    padding-bottom: calc(1.5rem + var(--safe-area-bottom));
  }

  /* Modal-lg: full width on phone, pinned to bottom like base modal */
  .modal-lg {
    max-width: 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    animation: slideUp 0.3s ease-out;
  }

  /* Modal overlay: pin to bottom on phone */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* Modal button rows (inline style flex + gap: 1rem) */
  /* Target the common pattern: two flex:1 buttons inside a modal */
  .modal [style*="display: flex"][style*="gap"] .btn {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  /* Action selector (2-col grid in item modal) — keep 2 cols but reduce padding */
  .action-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.8125rem;
  }

  /* User table: further reduce padding */
  .user-table th,
  .user-table td {
    padding: 0.75rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Company cards */
  .company-card {
    padding: 1.25rem;
  }

  .company-card-name {
    font-size: 1.05rem;
  }

  /* Company detail columns (already stacks at 860px, just reduce padding) */
  .company-detail-section-header {
    padding: 0.875rem 1rem;
  }

  .employee-row,
  .werf-row {
    padding: 0.75rem 1rem;
  }

  /* Back link */
  .back-link {
    margin-bottom: 1rem;
    font-size: 0.875rem;
  }

  /* Superadmin header */
  .superadmin-brand-name {
    font-size: 1.1rem;
  }

  /* Photo editor toolbar: smaller tools on phone */
  .editor-tool {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  /* Settings modal: reduce tab label padding */
  .settings-tab {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  /* FAB: keep accessible touch target, slightly closer to edges */
  .fab {
    bottom: calc(1.25rem + var(--safe-area-bottom));
    right: 1.25rem;
  }

  /* h1 in non-dashboard views */
  h1 {
    font-size: 1.375rem;
  }

  /* Header for non-dashboard views: stack title and action button */
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* User-view and superadmin-view header button: full width */
  header > .btn {
    width: 100%;
    justify-content: center;
  }

  /* Kaartweergave op kleine telefoons: 1 kolom */
  .db-projects-list.db-projects-cards {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  /* Section header actions: compacter op kleine schermen */
  .db-section-header-actions {
    gap: 0.375rem;
  }
}

/* ============================================================
   @MENTION AUTOCOMPLETE DROPDOWN
   ============================================================ */
.mention-dropdown {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.mention-dropdown.hidden { display: none; }
.mention-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary, #1a202c);
  display: flex;
  align-items: center;
  gap: 2px;
}
.mention-option:hover { background: #f0f4ff; }
.mention-option-at { color: var(--accent-blue, #3b82f6); font-weight: 600; }

/* ============================================================
   NOTIFICATION BELL & DROPDOWN
   ============================================================ */
.notification-bell-wrapper {
  position: relative;
  display: inline-flex;
}
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.notification-badge.hidden { display: none; }

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 1000;
  overflow: hidden;
}
.notification-dropdown.hidden { display: none; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
}
.notif-markall-btn {
  background: none;
  border: none;
  color: var(--accent-blue, #3b82f6);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-row {
  padding: 10px 16px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-row:hover { background: #f8fafc; }
.notif-unread { background: #eff6ff; }
.notif-unread:hover { background: #dbeafe; }
.notif-deleted { cursor: default; opacity: 0.6; }
.notif-author { font-size: 0.8rem; font-weight: 600; color: var(--text-primary, #1a202c); }
.notif-excerpt { font-size: 0.8rem; color: var(--text-muted, #64748b); margin: 2px 0; }
.notif-excerpt-deleted { font-style: italic; }
.notif-meta { font-size: 0.7rem; color: #94a3b8; }
.notif-loading, .notif-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
}

/* Item highlight flash on notification navigate */
@keyframes itemFlash {
  0%, 100% { background: transparent; }
  30% { background: #dbeafe; }
}
.item-highlight-flash {
  animation: itemFlash 2s ease;
  border-radius: 8px;
}

/* Responsive: full-width dropdown on small screens */
@media (max-width: 480px) {
  .notification-dropdown {
    position: fixed;
    top: 76px; /* navbar sticky top (12px) + navbar height (56px) + gap (8px) */
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }
  .notif-list {
    max-height: none;
  }
}

/* ============================================================
   @MENTION HIGHLIGHT IN NOTE TEXT
   ============================================================ */
.mention-highlight {
  color: var(--accent-blue, #3b82f6);
  font-weight: 600;
  background: #eff6ff;
  border-radius: 3px;
  padding: 0 2px;
}

/* ============================================================
   SUPERADMIN ACTIVITEITENLOG
   ============================================================ */
.activity-log-section {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
}

.activity-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.activity-log-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg);
}

.activity-log-filter-select {
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 160px;
}

.activity-log-filter-select:focus {
  outline: none;
  border-color: var(--accent, #5d534a);
}

.activity-log-filter-search {
  flex: 1;
  min-width: 200px;
  height: 36px;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
}

.activity-log-filter-search:focus {
  outline: none;
  border-color: var(--accent, #5d534a);
}

.activity-log-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.activity-log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.875rem;
}

.activity-log-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.activity-log-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.activity-log-td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.activity-log-table tr:last-child .activity-log-td {
  border-bottom: none;
}

.activity-log-td-time {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.activity-log-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--text);
  font-weight: 500;
}

.activity-log-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.activity-log-details {
  color: var(--text-muted);
  font-size: 0.8125rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Action type badges */
.action-badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.action-badge--login   { background: #dbeafe; color: #1d4ed8; }
.action-badge--logout  { background: #e0e7ef; color: #334155; }
.action-badge--create  { background: #dcfce7; color: #15803d; }
.action-badge--update  { background: #ffedd5; color: #c2410c; }
.action-badge--delete  { background: #fee2e2; color: #b91c1c; }
.action-badge--archive { background: #f1f5f9; color: #475569; }
.action-badge--upload  { background: #f3e8ff; color: #7e22ce; }
.action-badge--export  { background: #ccfbf1; color: #0f766e; }
.action-badge--error   { background: #fef2f2; color: #dc2626; font-weight: 600; }
.action-badge--default { background: #f1f5f9; color: #64748b; }

@media (max-width: 640px) {
  .activity-log-filters {
    padding: 0.75rem 1rem;
  }
  .activity-log-filter-select,
  .activity-log-filter-search {
    min-width: 0;
    width: 100%;
  }
  .activity-log-details {
    max-width: 140px;
  }
}

/* ============================================================
   ADDRESS AUTOCOMPLETE DROPDOWN
   ============================================================ */
#address-autocomplete-dropdown {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-size: 0.875rem;
}

.address-option {
  padding: 0.65rem 1rem;
  cursor: pointer;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.address-option:last-child {
  border-bottom: none;
}

.address-option:hover {
  background: var(--bg-dark);
  color: var(--primary);
}

.address-option-main {
  font-weight: 500;
}

.address-option-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.address-input-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%235d534a' stroke-width='2' stroke-dasharray='31.4' stroke-dashoffset='10'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.25rem !important;
}

/* ============================================================
   LOGIN SPINNER
   ============================================================ */
.btn-loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes btn-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ============================================================
   DASHBOARD SKELETON
   ============================================================ */
.skeleton-card {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 12px;
  height: 120px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================================
   SUPERADMIN USAGE STATS
   ============================================================ */
.usage-stats-section {
  margin-top: 2rem;
  margin-bottom: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
}

.usage-stats-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.usage-stats-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .usage-grid {
    grid-template-columns: 1fr;
  }
}

.usage-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.usage-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.usage-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.usage-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.usage-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.usage-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.usage-bar-container {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.usage-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.usage-bar.green {
  background: var(--success);
}

.usage-bar.orange {
  background: #f59e0b;
}

.usage-bar.red {
  background: #ef4444;
}

.usage-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.usage-loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: usage-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes usage-spin {
  to { transform: rotate(360deg); }
}

.usage-error {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  padding: 0.25rem 0;
}

/* ============================================================
   SUPERADMIN — ALLE GEBRUIKERS
   ============================================================ */

.all-users-section {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
}

.all-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.all-users-table-wrapper {
  overflow-x: auto;
}

.all-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.all-users-table thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.all-users-table th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.all-users-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.all-users-table tbody tr:last-child td {
  border-bottom: none;
}

.all-users-table tbody tr:hover {
  background: var(--bg-hover, rgba(0,0,0,0.02));
}

.all-users-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.all-users-loading,
.all-users-error {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.all-users-error {
  color: #ef4444;
}

/* Danger button (used for destructive actions) */
.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
}

.btn-danger:hover {
  background: #fecaca;
  border-color: #f87171;
}

@media (max-width: 640px) {
  .all-users-table th:nth-child(3),
  .all-users-table td:nth-child(3) {
    display: none;
  }
}

.usage-unavailable {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: color 0.2s;
  width: 2rem;
  height: 2rem;
}

.password-toggle:hover {
  color: var(--primary);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ─── Client activity strip (details-view) ─── */
.client-activity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: color-mix(in srgb, var(--primary) 5%, white);
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 0.6rem;
}

.client-activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  border: 1.5px solid transparent;
}

.client-activity-badge.badge-tokens {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  cursor: pointer;
}

.client-activity-badge.badge-tokens:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

.client-activity-badge.badge-approvals {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.client-activity-badge.badge-comments {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.client-activity-strip-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Client portal badge on item cards */
.badge-client-approved {
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
}

.badge-client-comment {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.72rem;
}

/* Client portal active-link indicator on dashboard project cards */
.db-project-card-client-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.75;
}

/* ── Item Files ────────────────────────────────────────── */
.item-file-block {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.item-file-pdf-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.item-file-pdf-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-file-pdf-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.item-file-pdf-embed {
  width: 100%;
  height: 500px;
  display: block;
  border: none;
  background: #f1f5f9;
}

.item-file-other {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.item-file-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-file-pending-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  margin-bottom: 0.4rem;
  background: var(--bg-secondary, #f8fafc);
}

.item-files-pending {
  margin-top: 0.5rem;
}

.item-files-existing {
  margin-bottom: 0.5rem;
}

/* De gegroepeerde Foto's/Documenten-weergave is enkel voor de mobiele
   bijlagen-tab. Op desktop verbergen we ze zodat de losse "Nog geen bijlagen
   toegevoegd"-tekst niet naast de Werf Bijlagen-kaart verschijnt. */
.mobile-bijlagen-groups {
  display: none;
}

/* ── Werf Bijlagen Sidebar ─────────────────────────────── */
/* Mirrors .activity-section for consistent card look */
.werf-bijlagen-section {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.werf-bijlagen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.werf-bijlagen-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.werf-bijlagen-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.werf-bijlagen-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1rem 0;
  text-align: center;
}

.werf-bijlagen-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.werf-bijlagen-list::-webkit-scrollbar { width: 4px; }
.werf-bijlagen-list::-webkit-scrollbar-track { background: transparent; }
.werf-bijlagen-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.werf-bijlagen-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0.375rem;
  margin: 0 -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.werf-bijlagen-item:last-child {
  border-bottom: none;
}

.werf-bijlagen-item:hover {
  background: var(--bg-secondary, #f8fafc);
}

.werf-bijlagen-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.werf-bijlagen-item-icon.file-pdf {
  background: #fef2f2;
  color: #dc2626;
}

.werf-bijlagen-item-icon.file-image {
  background: #f0fdf4;
  color: #16a34a;
}

.werf-bijlagen-item-icon.file-doc {
  background: #eff6ff;
  color: #2563eb;
}

.werf-bijlagen-item-icon.file-other {
  background: #f8fafc;
  color: var(--text-muted);
}

.werf-bijlagen-item-icon.file-text {
  background: #fefce8;
  color: #ca8a04;
}

.werf-bijlagen-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

.werf-bijlagen-item-info {
  flex: 1;
  min-width: 0;
}

.werf-bijlagen-item-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.375rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.werf-bijlagen-item:hover .werf-bijlagen-item-delete {
  opacity: 1;
}

.werf-bijlagen-item-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Op touch-toestellen is er geen hover — toon de knop altijd subtiel */
@media (hover: none) {
  .werf-bijlagen-item-delete {
    opacity: 0.55;
  }
}

.werf-bijlagen-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.werf-bijlagen-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.werf-bijlagen-item-desc {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.werf-bijlagen-item.is-note .werf-bijlagen-item-desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Attachments Viewer Modal ──────────────────────────── */
.attachments-modal.attachments-modal {
  max-width: 1400px;
  width: 96vw;
  display: flex;
  flex-direction: column;
  height: 88vh;
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  border-radius: 1rem;
}

.attachments-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card, #fff);
}

.attachments-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.attachments-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.attachments-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar with file list ── */
.attachments-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #fff);
}

.attachments-sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.attachments-sidebar-header span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.attachments-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.attachments-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.attachments-sidebar-list::-webkit-scrollbar { width: 4px; }
.attachments-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.attachments-sidebar-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.attachments-list-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 2px;
}

.attachments-list-item:hover {
  background: var(--bg-secondary, #f8fafc);
}

.attachments-list-item.active {
  background: var(--accent-blue, #1B2B5E);
  color: #fff;
  box-shadow: 0 1px 3px rgba(27, 43, 94, 0.2);
}

.attachments-list-item.active i {
  color: #fff;
}

.attachments-list-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attachments-list-item.active .attachments-list-item-icon {
  background: rgba(255,255,255,0.15) !important;
}

.attachments-list-item-info {
  flex: 1;
  min-width: 0;
}

.attachments-list-item-name {
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-list-item-meta {
  font-size: 0.675rem;
  opacity: 0.7;
  margin-top: 0.125rem;
}

.attachments-list-item-delete {
  opacity: 0;
  transition: opacity 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: inherit;
  flex-shrink: 0;
}

.attachments-list-item:hover .attachments-list-item-delete,
.attachments-list-item.active .attachments-list-item-delete {
  opacity: 0.7;
}

.attachments-list-item-delete:hover {
  opacity: 1 !important;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.attachments-list-item.active .attachments-list-item-delete:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── Preview panel ── */
.attachments-preview-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  min-height: 0;
}

.attachments-preview-content {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: auto;
  min-height: 0;
  padding: 0;
}

.attachments-pdf-canvas-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
}

.attachments-pdf-canvas-container canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  border-radius: 6px;
  background: #fff;
}

.attachments-pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.attachments-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: auto;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.attachments-preview-text-note,
.attachments-preview-empty,
.attachments-preview-other {
  margin: auto;
}

.attachments-preview-empty,
.attachments-preview-other {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem;
  gap: 0.75rem;
}

/* Clickable upload zone */
label.attachments-preview-empty {
  height: 100%;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

label.attachments-preview-empty:hover,
label.attachments-preview-empty:focus-within {
  border-color: var(--accent-blue, #1B2B5E);
  background: var(--bg-secondary, #f8fafc);
}

.attachments-preview-text-note {
  width: 100%;
  max-width: 640px;
  margin: auto;
  background: var(--bg-card, #fff);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.attachments-preview-text-note h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.attachments-preview-text-note p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-primary, #1e293b);
  white-space: pre-wrap;
  margin: 0;
}

/* ── Detail bar at bottom of preview ── */
.attachments-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card, #fff);
  flex-shrink: 0;
  gap: 1rem;
}

.attachments-detail-bar-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.attachments-detail-bar-info .att-filename {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachments-detail-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Responsive: stack sidebar below on mobile ── */
@media (max-width: 768px) {
  .attachments-modal.attachments-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    max-width: 100vw;
  }

  .attachments-modal-body {
    flex-direction: column;
  }

  .attachments-sidebar {
    width: 100%;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .attachments-modal.attachments-modal {
    border-radius: 1rem 1rem 0 0;
    max-width: 100%;
    padding: 0;
  }
}


@media (max-width: 768px) {
  .attachments-modal {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .attachments-modal-body {
    flex-direction: column;
  }
  .attachments-sidebar {
    width: 100%;
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================
   PROJECT NOTIES — klikbare preview-kaart (sidebar)
   Bewerken gebeurt in .project-notes-modal-overlay.
   ============================================================ */
.project-noties-section {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.project-noties-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.project-noties-clickable:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.project-noties-clickable:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}
.project-noties-clickable:active {
  transform: translateY(1px);
}
.project-noties-clickable:hover .project-noties-edit-hint {
  color: var(--primary, #2563eb) !important;
}

.project-noties-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.project-noties-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-noties-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.project-noties-edit-hint {
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.project-noties-preview {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary, #1a202c);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.project-noties-preview p { margin: 0 0 0.35rem 0; }
.project-noties-preview p:last-child { margin-bottom: 0; }
.project-noties-preview ul,
.project-noties-preview ol { margin: 0.35rem 0 0.35rem 1.25rem; padding: 0; }
.project-noties-preview li { margin: 0.1rem 0; }
.project-noties-preview strong { font-weight: 700; }
.project-noties-preview em { font-style: italic; }
.project-noties-preview u { text-decoration: underline; }
.project-noties-preview s { text-decoration: line-through; }
.project-noties-preview h1 { font-size: 1.35rem; font-weight: 700; margin: 0.6rem 0 0.35rem; }
.project-noties-preview h2 { font-size: 1.15rem; font-weight: 700; margin: 0.5rem 0 0.3rem; }
.project-noties-preview h3 { font-size: 1rem;    font-weight: 700; margin: 0.45rem 0 0.25rem; }
.project-noties-preview blockquote {
  margin: 0.4rem 0;
  padding: 0.25rem 0.75rem;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}
.project-noties-preview a {
  color: var(--primary, #2563eb);
  text-decoration: underline;
  word-break: break-all;
}
.project-noties-preview pre,
.project-noties-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.8rem;
  background: #f3f4f6;
  border-radius: 0.25rem;
  padding: 0.1rem 0.3rem;
}
/* Quill Snow class-based opmaak replicatie in de preview */
.project-noties-preview .ql-align-center  { text-align: center; }
.project-noties-preview .ql-align-right   { text-align: right; }
.project-noties-preview .ql-align-justify { text-align: justify; }
.project-noties-preview .ql-size-small    { font-size: 0.75em; }
.project-noties-preview .ql-size-large    { font-size: 1.4em; }
.project-noties-preview .ql-size-huge     { font-size: 2em; }
.project-noties-preview .ql-indent-1 { padding-left: 2em; }
.project-noties-preview .ql-indent-2 { padding-left: 4em; }
.project-noties-preview .ql-indent-3 { padding-left: 6em; }
.project-noties-preview .ql-indent-4 { padding-left: 8em; }
.project-noties-preview .ql-indent-5 { padding-left: 10em; }
.project-noties-preview .ql-indent-6 { padding-left: 12em; }
.project-noties-preview .ql-indent-7 { padding-left: 14em; }
.project-noties-preview .ql-indent-8 { padding-left: 16em; }
.project-noties-preview .ql-indent-9 { padding-left: 18em; }

.project-noties-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

/* ============================================================
   PROJECT NOTITIES — groot bewerkscherm (modal)
   ============================================================ */
.project-notes-modal-overlay {
  /* Erft van .modal-overlay (display:none/flex + achtergrond) */
  padding: 1.5rem;
}

.project-notes-modal-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  width: 100%;
  max-width: 900px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.project-notes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.project-notes-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.project-notes-modal-header-left h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary, #1a202c);
  margin: 0;
}
.project-notes-modal-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-notes-modal-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 8ch;
  text-align: right;
}
.project-notes-modal-save.btn {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  box-shadow: none;
}

.project-notes-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.project-notes-modal-close:hover,
.project-notes-modal-close:focus-visible {
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-primary, #1a202c);
  outline: none;
}

/* Body: grijze "bureau" achtergrond waar het A4-vel op ligt */
.project-notes-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-muted, #f3f4f6);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}

.project-notes-modal-page {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

/* Quill Snow overrides binnen de modal. */
.project-notes-modal-page .ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: 1rem;
}
.project-notes-modal-page .ql-editor {
  min-height: 100%;
  padding: 48px 64px;
  font-family: "Aptos", "Aptos (Body)", Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #242424;
}
.project-notes-modal-page .ql-editor.ql-blank::before {
  color: var(--text-muted);
  font-style: normal;
  font-size: 1rem;
  left: 3rem;
  right: 3rem;
}

/* ==========================================================================
   Word-ribbon — custom toolbar voor #projectNotesModal
   ========================================================================== */
.word-ribbon {
  display: flex;
  align-items: stretch;
  background: #F3F3F3;
  border-bottom: 1px solid #E1E1E1;
  padding: 4px 8px;
  min-height: 90px;
  overflow-x: auto;
  flex-shrink: 0;
  font-family: "Segoe UI", -apple-system, sans-serif;
}

.word-ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 6px;
  flex-shrink: 0;
}

.word-ribbon-group-body {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.word-ribbon-group-body-font,
.word-ribbon-group-body-para {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.word-ribbon-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.word-ribbon-subgroup {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.word-ribbon-label {
  font-size: 9px;
  color: #757575;
  text-align: center;
  margin-top: 2px;
  user-select: none;
}

.word-ribbon-separator {
  width: 1px;
  background: #D1D1D1;
  margin: 4px 4px;
  flex-shrink: 0;
}

.word-ribbon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #424242;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: background 80ms ease, border-color 80ms ease;
}

.word-ribbon-button-large {
  flex-direction: column;
  min-width: 54px;
  height: 72px;
  padding: 4px;
}

.word-ribbon-button-label {
  font-size: 11px;
  line-height: 1;
  color: #424242;
  margin-top: 2px;
}

.word-ribbon-button:hover:not(.is-disabled) {
  background: #E5E5E5;
  border-color: #D1D1D1;
}

.word-ribbon-button:focus-visible {
  outline: 2px solid #0078D4;
  outline-offset: -2px;
}

.word-ribbon-button.is-active,
.word-ribbon-button[aria-pressed="true"] {
  background: #C7E0F4;
  border-color: #99C9E8;
}

.word-ribbon-button.is-active svg,
.word-ribbon-button.is-active svg text,
.word-ribbon-button[aria-pressed="true"] svg,
.word-ribbon-button[aria-pressed="true"] svg text {
  fill: #0078D4;
  stroke: #0078D4;
}

.word-ribbon-button.is-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.word-ribbon-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px;
  background: #FFFFFF;
  border: 1px solid #D1D1D1;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  color: #424242;
  cursor: pointer;
  user-select: none;
  min-width: 120px;
  justify-content: space-between;
}

.word-ribbon-dropdown-sm {
  min-width: 64px;
}

.word-ribbon-dropdown:hover {
  border-color: #0078D4;
}

.word-ribbon-dropdown:focus-visible {
  outline: 2px solid #0078D4;
  outline-offset: -2px;
}

.word-ribbon-dropdown-arrow {
  font-size: 8px;
  color: #424242;
}

.word-ribbon-split {
  display: inline-flex;
  height: 28px;
}

.word-ribbon-split-main {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 2px;
}

.word-ribbon-split-arrow {
  min-width: 14px;
  padding: 0 2px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.word-ribbon-color-indicator {
  pointer-events: none;
}

.word-ribbon-popover {
  position: absolute;
  z-index: 1100;
  background: #FFFFFF;
  border: 1px solid #D1D1D1;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 140px;
  padding: 4px 0;
  font-family: "Segoe UI", -apple-system, sans-serif;
  font-size: 13px;
}

.word-ribbon-popover-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: none;
  text-align: left;
  color: #242424;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.word-ribbon-popover-item:hover,
.word-ribbon-popover-item.is-active {
  background: #F3F3F3;
}

.word-ribbon-color-popover {
  position: absolute;
  z-index: 1100;
  background: #FFFFFF;
  border: 1px solid #D1D1D1;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 8px;
  font-family: "Segoe UI", -apple-system, sans-serif;
  font-size: 12px;
}

.word-ribbon-color-grid {
  display: grid;
  grid-template-columns: repeat(10, 16px);
  gap: 2px;
  margin-bottom: 8px;
}

.word-ribbon-color-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
}

.word-ribbon-color-swatch:hover {
  outline: 1px solid #0078D4;
}

.word-ribbon-color-auto,
.word-ribbon-color-more {
  display: block;
  width: 100%;
  padding: 4px 6px;
  background: transparent;
  border: none;
  text-align: left;
  color: #242424;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border-radius: 2px;
}

.word-ribbon-color-auto:hover,
.word-ribbon-color-more:hover {
  background: #F3F3F3;
}

.word-ribbon-color-more-input {
  display: none;
}

/* Mobiel: minder padding, full-bleed */
@media (max-width: 640px) {
  .project-notes-modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .project-notes-modal-panel {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .project-notes-modal-body {
    padding: 0.75rem;
  }
  .project-notes-modal-page {
    max-width: 100%;
  }
  .project-notes-modal-page .ql-editor {
    padding: 1.25rem 1.25rem;
  }
  .project-notes-modal-page .ql-editor.ql-blank::before {
    left: 1.25rem;
    right: 1.25rem;
  }
}

/* ============================================================
   ITEM MODAL — MIC BUTTON
   ============================================================ */
.item-description-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.item-mic-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary, #3b82f6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
  z-index: 1;
}

.item-mic-btn:hover {
  background: var(--primary-hover, #2563eb);
}

.item-mic-btn--active {
  background: #ef4444 !important;
  animation: mic-pulse 1s infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ── Dashboard Gantt-chart ────────────────────────────────────────── */
.db-gantt-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg, #fff);
  border-radius: 0.5rem;
  min-height: 200px;
  padding: 0.5rem 0;
}

.db-gantt-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted, #8888a0);
  background: var(--bg-soft, #f7f7fb);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.db-gantt-empty small {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.db-gantt-controls {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.db-gantt-controls .btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}
.db-gantt-controls .btn-sm.active {
  background: var(--db-blue, #3b82f6);
  color: #fff;
}

.db-gantt-container .gantt .bar-wrapper.gantt-bar-active .bar { fill: #f59e0b; }
.db-gantt-container .gantt .bar-wrapper.gantt-bar-active .bar-progress { fill: #d97706; }
.db-gantt-container .gantt .bar-wrapper.gantt-bar-done .bar { fill: #10b981; }
.db-gantt-container .gantt .bar-wrapper.gantt-bar-done .bar-progress { fill: #059669; }

@media (max-width: 768px) {
  .db-gantt-container { min-height: 150px; }
  .db-gantt-controls .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.75rem; }
}

/* ============================================================
   Mobile Detail Tabs (Items / Bijlagen)
   Only visible on phones (≤767px). Splits the project-detail
   surface into two switchable panes.
   ============================================================ */
.mobile-detail-tabs {
  display: none;
}

.mobile-bijlagen-subfilters {
  display: none;
}

.mobile-bijlagen-add {
  display: none;
}

@media (max-width: 767px) {
  .mobile-detail-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0.75rem 0 0.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card, #fff);
    border-radius: 0.875rem 0.875rem 0 0;
    padding: 0 0.25rem;
    overflow: hidden;
  }

  .mobile-detail-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 0.5rem;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
    min-height: 48px;
  }

  .mobile-detail-tab i {
    width: 18px;
    height: 18px;
  }

  .mobile-detail-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent, #f59e0b);
  }

  .mobile-detail-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.45rem;
    background: var(--bg-muted, #f1f5f9);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .mobile-detail-tab.is-active .mobile-detail-tab-count {
    background: var(--accent, #f59e0b);
    color: #fff;
  }

  /* Items tab active (default on mobile) — hide ALL sidebar content
     so notities, bijlagen, recent-activity en map alleen op de Bijlagen-tab
     verschijnen. Use mobile-tab-items class to scope so the bijlagen-tab
     rules later don't need !important to win. */
  #details-view.mobile-tab-items .detail-sidebar,
  #details-view:not(.mobile-tab-bijlagen) .detail-sidebar {
    display: none !important;
  }

  /* Bijlagen tab — hide items pane */
  #details-view.mobile-tab-bijlagen .filter-bar,
  #details-view.mobile-tab-bijlagen .detail-main,
  #details-view.mobile-tab-bijlagen .fab {
    display: none !important;
  }

  /* Bijlagen tab — show sidebar + sub-filters + add button */
  #details-view.mobile-tab-bijlagen .detail-sidebar {
    display: block !important;
    order: 0;
    margin-top: 0;
  }

  #details-view.mobile-tab-bijlagen .mobile-bijlagen-subfilters {
    display: flex !important;
  }

  #details-view.mobile-tab-bijlagen .mobile-bijlagen-add {
    display: inline-flex !important;
  }

  /* Hide map + recent activity on mobile bijlagen tab — mockup only shows
     attachments + notities */
  #details-view.mobile-tab-bijlagen #project-map-container,
  #details-view.mobile-tab-bijlagen #recent-activity-section {
    display: none !important;
  }

  /* Bijlagen sub-filter pills */
  .mobile-bijlagen-subfilters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    margin: 0.25rem 0 1rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-bijlagen-subfilters::-webkit-scrollbar {
    display: none;
  }

  .mobile-bijlagen-subfilter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    background: var(--bg-muted, #f1f5f9);
    color: var(--text);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    min-height: 40px;
  }

  .mobile-bijlagen-subfilter.is-active {
    background: var(--text, #0f172a);
    color: #fff;
    border-color: var(--text, #0f172a);
  }

  .mobile-bijlagen-subfilter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.4rem;
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
  }

  .mobile-bijlagen-subfilter:not(.is-active) .mobile-bijlagen-subfilter-count {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-muted);
  }

  /* Full-width "Bijlage toevoegen" button at the top of mobile bijlagen tab */
  .mobile-bijlagen-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 48px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .mobile-bijlagen-add:hover {
    background: var(--bg-muted, #f8fafc);
  }

  .mobile-bijlagen-add i {
    width: 18px;
    height: 18px;
  }

  /* Hide the desktop list on the mobile bijlagen tab — replaced by the
     grouped Foto's / Documenten layout */
  #details-view.mobile-tab-bijlagen #werf-bijlagen-section {
    display: none;
  }

  /* Mobile bijlagen groups (Foto's + Documenten) */
  .mobile-bijlagen-groups {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
  }

  #details-view.mobile-tab-bijlagen .mobile-bijlagen-groups {
    display: flex;
  }

  .mobile-bijlagen-group-title {
    margin: 0 0 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .mobile-bijlagen-group-count {
    color: var(--text-muted);
    font-weight: 600;
  }
  .mobile-bijlagen-group-count::before {
    content: "·";
    margin-right: 0.25rem;
  }

  .mobile-bijlagen-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .mobile-bijlagen-photo-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-muted, #e2e8f0);
    cursor: pointer;
  }

  .mobile-bijlagen-photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .mobile-bijlagen-photo-date {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 0.4rem;
  }

  .mobile-bijlagen-doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-bijlagen-doc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: left;
    min-height: 56px;
  }

  .mobile-bijlagen-doc-row:hover {
    background: var(--bg-muted, #f8fafc);
  }

  .mobile-bijlagen-doc-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--text-muted, #64748b);
    border-radius: 0.4rem;
  }
  .mobile-bijlagen-doc-badge-pdf { background: #dc2626; }
  .mobile-bijlagen-doc-badge-doc { background: #2563eb; }
  .mobile-bijlagen-doc-badge-image { background: #0891b2; }
  .mobile-bijlagen-doc-badge-other { background: #475569; }
  .mobile-bijlagen-doc-badge-text { background: #f59e0b; }

  .mobile-bijlagen-doc-info {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mobile-bijlagen-doc-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bijlagen-doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
  }

  .mobile-bijlagen-doc-download {
    flex: 0 0 auto;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-bijlagen-doc-download i {
    width: 18px;
    height: 18px;
  }

  .mobile-bijlagen-empty {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
  }

  /* Sub-filter pane visibility */
  #details-view.mobile-tab-bijlagen.mobile-bj-photos .mobile-bijlagen-group-docs,
  #details-view.mobile-tab-bijlagen.mobile-bj-photos #project-noties-section,
  #details-view.mobile-tab-bijlagen.mobile-bj-documents .mobile-bijlagen-group-photos,
  #details-view.mobile-tab-bijlagen.mobile-bj-documents #project-noties-section,
  #details-view.mobile-tab-bijlagen.mobile-bj-notes .mobile-bijlagen-groups,
  #details-view.mobile-tab-bijlagen.mobile-bj-notes .mobile-bijlagen-add {
    display: none !important;
  }
}

/* ============================================================
   Werkposten Planning
   ============================================================ */

#planning-view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.form-error { color: #dc2626; font-size: 0.875rem; margin: 0.25rem 0 0; }
.form-hint { font-size: 0.8125rem; color: var(--text-muted, #64748b); margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.planning-gantt { margin-bottom: 1rem; }

.planning-strip {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.planning-strip-days {
  display: grid;
  gap: 4px;
  margin-bottom: 0.625rem;
}
.planning-strip-day {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  background: #f1f5f9;
  border-radius: 0.375rem;
  padding: 0.375rem 0;
  font-weight: 500;
}
.planning-strip-day.is-in-project {
  background: rgba(59, 130, 246, 0.10);
  color: var(--text-main, #0f172a);
}

.planning-strip-bars {
  position: relative;
  width: 100%;
}
.planning-strip-bar {
  position: absolute;
  height: 40px;
  border-radius: 10px;
  color: #fff;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.planning-strip-bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
  line-height: 1;
}
.planning-strip-bar-werknemers {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.planning-strip-bar-pill {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* ---- Werkpost dagvakjes in de grote Gantt ---- */
.gantt-bar-project.has-werkposten {
  background: transparent !important;
  border: none !important;
  overflow: hidden;
  top: 0 !important;
  height: 100% !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
/* Werf naam boven de gekleurde blokken */
.gantt-werkpost-werf-label {
  position: absolute;
  top: 3px;
  left: 4px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--bar-company-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  z-index: 2;
  pointer-events: none;
}
.gantt-bar-project .gantt-werkpost-day {
  position: absolute;
  top: 18px;
  bottom: 2px;
  pointer-events: auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: 4px;
}
.gantt-werkpost-pills {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 100%;
}
.gantt-werkpost-pill {
  background: rgba(255, 255, 255, 0.90);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 9px;
  font-weight: 700;
  color: var(--seg-color);
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}
.gantt-bar-project .gantt-bar-project-label {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.gantt-bar-project.has-werkposten .gantt-bar-project-label {
  display: none;
}

.planning-section-portal {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.planning-section-portal h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.planning-section-portal ul { list-style: none; padding: 0; margin: 0.75rem 0 0; font-size: 0.9rem; }
.planning-section-portal li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}
.planning-section-portal .dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ── Dev Quick Login (localhost only) ── */
#dev-quick-login {
  margin-top: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fc 100%);
  border-radius: 12px;
  border: 1px solid #dde5f7;
  position: relative;
}
#dev-quick-login::before {
  content: "DEV";
  position: absolute;
  top: -9px;
  right: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 5px;
}
.dev-panel-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.dev-panel-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dev-account-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #dde5f7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}
.dev-account-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}
.dev-account-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(27,43,94,0.14);
  transform: translateY(-2px);
}
.dev-account-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dev-account-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}
.dev-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dev-account-btn:hover .dev-account-avatar {
  transform: scale(1.1);
}
.dev-account-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dev-account-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}
.dev-account-role {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: #edf0fb;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
  width: fit-content;
}

.visibility-radio { display:flex; align-items:center; gap:0.4rem; cursor:pointer; font-size:0.9rem; }
.visibility-radio input { accent-color: var(--primary, #1B2B5E); }

/* Personen-checklist ("Zichtbaar voor" → Specifieke personen).
   Eigen "pcl-" namespace + ID-scope (#item-visibility-persons): bewust NIET de
   "cl-" classes van de item-checklist widget (app.js ~9538, injecteert runtime-styles),
   en de ID-scope wint van ".form-group label { display:block }" (regel 818), dat
   anders de flex-layout van elke rij plat drukt. */
#item-visibility-persons .pcl-wrapper { margin-top: 0.5rem; }
#item-visibility-persons .pcl-items-scroll {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}
#item-visibility-persons .pcl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  user-select: none;
}
#item-visibility-persons .pcl-row:hover { border-color: #c7cfe0; background: #fafbff; }
#item-visibility-persons .pcl-row.pcl-selected {
  border-color: var(--primary, #1B2B5E);
  background: rgba(27,43,94,.05);
  box-shadow: 0 0 0 1px var(--primary, #1B2B5E) inset;
}
/* Rond selectie-bolletje */
#item-visibility-persons .pcl-cb-visual {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #c7cfe0;
  background: #fff;
  position: relative;
  box-sizing: border-box;
  transition: border-color .15s ease, background-color .15s ease;
}
#item-visibility-persons .pcl-cb-visual.checked {
  border-color: var(--primary, #1B2B5E);
  background: var(--primary, #1B2B5E);
}
#item-visibility-persons .pcl-cb-visual.checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
#item-visibility-persons .pcl-item-title {
  font-size: 0.9rem;
  color: var(--primary, #1B2B5E);
  font-weight: 500;
}
#item-visibility-persons .pcl-row.pcl-selected .pcl-item-title { font-weight: 600; }
/* "Iedereen"-knop bovenaan de lijst, met wat extra ruimte t.o.v. de personen eronder. */
#item-visibility-persons .pcl-everyone-row { margin-bottom: 10px; }

.item-vis-badge { display:inline-flex; align-items:center; gap:4px; font-size:0.72rem; font-weight:600; padding:2px 8px; border-radius:20px; line-height:1.4; }
.item-vis-everyone { background:rgba(27,43,94,.08); color:var(--primary,#1B2B5E); }
.item-vis-specific { background:rgba(245,166,35,.14); color:#b45309; }
.item-vis-none     { background:rgba(220,38,38,.10); color:#dc2626; }

/* ============================================================
   FOTO-OVERZICHT ("Alle foto's" van een werf)
   ============================================================ */

/* Knop in de details-header */
.btn-photos {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 102, 10, 0.3);
}
.btn-photos:hover { filter: brightness(1.05); }
.btn-photos:active { transform: scale(0.96); }
.photo-overview-count-pill {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Modal-shell — erft van .modal (incl. mobiel bottom-sheet gedrag) */
.photo-overview-modal {
  max-width: 920px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}
@media (max-width: 640px) {
  /* Mobiel: hele modal scrollt, zodat de filters mee weg scrollen i.p.v.
     bovenaan vast te blijven staan. Enkel de kop (met sluitknop) blijft plakken. */
  .photo-overview-modal {
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .photo-overview-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-card);
  }
  .photo-overview-body {
    overflow: visible;
    flex: none;
  }
}

/* Kop */
.photo-overview-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.photo-overview-head-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 12px rgba(232, 102, 10, 0.28);
}
.photo-overview-head-icon i { width: 22px; height: 22px; }
.photo-overview-head-txt { flex: 1; min-width: 0; }
.photo-overview-head-txt h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.photo-overview-head-txt p { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.photo-overview-close {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; display: grid; place-items: center;
  color: var(--text-muted); transition: all 0.18s; flex-shrink: 0;
}
.photo-overview-close:hover { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.photo-overview-close i { width: 18px; height: 18px; }

/* Toolbar: sorteren + filters */
.photo-overview-toolbar {
  padding: 0.75rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center;
  background: #fbfcfe; flex-shrink: 0;
}
.photo-overview-seg {
  display: inline-flex; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.photo-overview-seg button {
  border: none; background: transparent; font-family: inherit; font-weight: 600;
  font-size: 0.78rem; color: var(--text-muted); padding: 6px 12px; border-radius: 7px;
  cursor: pointer; transition: 0.15s;
}
.photo-overview-seg button.active { background: var(--primary); color: #fff; }
.photo-overview-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.po-chip {
  border: 1px solid var(--border); background: #fff; border-radius: 20px;
  padding: 6px 12px; font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: 0.15s; font-family: inherit;
}
.po-chip .po-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.po-chip.active { border-color: currentColor; color: var(--text-main); background: rgba(27, 43, 94, 0.05); }
.po-chip[data-a="1"].active { color: var(--action-1); }
.po-chip[data-a="2"].active { color: var(--action-2); background: rgba(245, 166, 35, 0.1); }
.po-chip[data-a="3"].active { color: var(--action-3); background: rgba(34, 197, 94, 0.1); }
.po-chip[data-a="4"].active { color: var(--action-4); background: rgba(239, 68, 68, 0.1); }
.photo-overview-toolbar-spacer { flex: 1; }
.photo-overview-count-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* Mobiel: sorteer-segment + teller op één rij, filters als horizontale swipe-rij */
@media (max-width: 640px) {
  .photo-overview-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "seg count"
      "chips chips";
    gap: 0.6rem 0.5rem;
    align-items: center;
  }
  .photo-overview-seg { grid-area: seg; }
  .photo-overview-seg button { flex: 1; text-align: center; padding: 6px 12px; }
  .photo-overview-count-label { grid-area: count; }
  .photo-overview-toolbar-spacer { display: none; }
  .photo-overview-chips {
    grid-area: chips;
    min-width: 0;             /* laat overflow-x werken i.p.v. de kolom te verbreden */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -1rem;          /* bleed tot de modal-rand */
    padding: 0 1rem 2px;
  }
  .photo-overview-chips::-webkit-scrollbar { display: none; }
  .po-chip { flex-shrink: 0; white-space: nowrap; }
}

/* Scroll-body met datumgroepen */
.photo-overview-body {
  overflow-y: auto; overflow-x: hidden; flex: 1; min-width: 0;
  padding: 0.4rem 1.4rem 1.4rem;
  padding-bottom: calc(1.4rem + var(--safe-area-bottom));
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  .photo-overview-body { padding-left: 1rem; padding-right: 1rem; }
  .photo-overview-head, .photo-overview-toolbar { padding-left: 1rem; padding-right: 1rem; }
}
.po-group { margin-top: 1.1rem; }
.po-group:first-child { margin-top: 0.4rem; }
.po-date-head {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(#fff 72%, rgba(255, 255, 255, 0));
  padding: 0.6rem 0 0.5rem; display: flex; align-items: center; gap: 0.7rem;
}
.po-cal {
  width: 30px; height: 30px; border-radius: 9px; background: var(--primary);
  color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.po-cal i { width: 15px; height: 15px; }
.po-date-head h3 { font-size: 0.92rem; font-weight: 800; white-space: nowrap; }
.po-rel {
  font-size: 0.72rem; font-weight: 700; color: var(--accent-orange);
  background: rgba(232, 102, 10, 0.1); padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.po-line { flex: 1; height: 1px; background: var(--border); min-width: 12px; }
.po-num { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

.po-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
/* Telefoons: exact 2 kolommen — voorkomt dat auto-fill buiten beeld rekent */
@media (max-width: 640px) {
  .po-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
}
.po-thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  cursor: pointer; background: var(--border); border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.po-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s; }
.po-thumb:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(27, 43, 94, 0.35); z-index: 1; }
.po-thumb:hover img { transform: scale(1.06); }
.po-act-dot {
  position: absolute; top: 9px; left: 9px; width: 11px; height: 11px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.po-time {
  position: absolute; top: 8px; right: 8px; background: rgba(15, 20, 40, 0.6);
  backdrop-filter: blur(4px); color: #fff; font-size: 0.66rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.po-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.1rem 0.6rem 0.55rem;
  background: linear-gradient(transparent, rgba(15, 20, 40, 0.82)); color: #fff;
  font-size: 0.72rem; font-weight: 600; line-height: 1.25;
  opacity: 0; transform: translateY(6px); transition: 0.2s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-thumb:hover .po-caption { opacity: 1; transform: none; }
/* Touch-toestellen kennen geen hover → toon het item-label meteen */
@media (hover: none) {
  .po-caption { opacity: 1; transform: none; }
}

.photo-overview-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.8rem; padding: 3.5rem 1rem; text-align: center; color: var(--text-muted);
}
.photo-overview-empty i { width: 42px; height: 42px; opacity: 0.5; }
.photo-overview-empty p { font-size: 0.9rem; max-width: 320px; line-height: 1.5; }
