:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --brand: #2563eb;
  --accent: #111827;
  --warn: #f59e0b;
  --warn-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* GLOBAL RESET */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================== SIDEBAR ================== */

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-top {
  flex: 1;
}

/* Brand/logo */
.boek {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-logo {
  max-width: 160px;
  height: auto;
  display: block;
}

/* Sidebar menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.menu-item:hover {
  background: #f3f4f6;
  color: var(--text);
}

.menu-item.active {
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
}

/* Menu items gebruiken nu allemaal .menu-item-icon, dus ::before is niet meer nodig */
.menu-item::before {
  display: none;
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0;
}

.menu-item-icon i {
  font-size: 16px;
  line-height: 1;
}

.menu-item-icon svg {
  width: 16px;
  height: 16px;
}

/* Sidebar bottom / user */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.user-role {
  color: var(--muted);
  font-size: 12px;
}

.user-card .mt-2 {
  margin-top: 8px;
}

.user-card a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.user-card a:hover {
  color: var(--text);
}

/* ================== MAIN LAYOUT ================== */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 260px;
  width: calc(100% - 260px);
  transition: margin-left .25s ease, width .25s ease;
}

/* Collapsed sidebar → main past mee */
.sidebar.collapsed ~ .main {
  margin-left: 64px;
  width: calc(100% - 64px);
}

/* Mobiele onderbalk navigatie */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 110;
}

.mobile-nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.mobile-nav-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-icon svg {
  width: 18px;
  height: 18px;
}

.mobile-nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: scale(1.1);
}

.topbar {
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
}

.app-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* Topbar rechts — altijd zichtbaar */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
  transition: background .15s, color .15s;
}
.topbar-btn:hover { background: var(--bg); color: var(--text); }
[data-theme="dark"] .topbar-btn { border-color: #334155; }
[data-theme="dark"] .topbar-btn:hover { background: #334155; }

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
  text-decoration: none;
}
.topbar-avatar:hover { border-color: var(--brand); }

.topbar-sa-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.topbar-sa-btn:hover { opacity: .9; color: #fff; }

/* Logo rechtsboven op mobiel */
.topbar-logo-mobile {
  height: 32px;
  width: auto;
}

/* Mobiele account/login knop */
.topbar-account-btn {
  padding: 8px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.topbar-account-btn:hover {
  background: #f3f4f6;
  color: var(--text);
}

.topbar-account-btn:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  outline: none;
}

.topbar-account-btn i {
  font-size: 20px;
}

.page {
  padding: 32px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ================== DASHBOARD HEADER ================== */

.dashboard-top-section {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px; /* extra ruimte tussen KPI-blokken en foto */
  align-items: start;
  margin-bottom: 24px;
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-header {
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.h-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 8px; /* mb-2 equivalent */
}

.h-sub {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 24px; /* mb-6 equivalent */
  font-size: 15px;
}

/* Hero/banner image on the right */
.hero-image {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-self: stretch;
  height: 100%;
  min-height: 140px;
}

.materiaal-grid .hero-image {
  margin-left: 0;
  z-index: 0;
  height: 100% !important;
  min-height: 110px !important;
  overflow: hidden;
}

.hero-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ================== CARDS ================== */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px; /* rounded-xl equivalent */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  padding: 24px; /* p-6 */
  position: relative; /* Standaard relative voor absolute children */
  overflow: hidden; /* Voorkomt dat absolute children buiten de kaart komen */
}

/* KPI cards (top row) */

.grid-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px; /* gap-6 equivalent - werkt voor zowel horizontaal als verticaal */
  margin-bottom: 0;
  align-items: stretch;
}

/* Voor dashboard, documenten en materiaal gebruiken we flexibele kolommen.
   De exacte kolommen worden via media-queries fijngestemd. */
.dashboard-left .grid-top,
.documenten-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

/* Materiaal grid: always 2 columns side by side on desktop (legacy - now using grid-top) */
.materiaal-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  align-items: stretch;
}

/* ================== MATERIAAL ADD BUTTON ================== */
.materiaal-add-button {
  position: absolute;
  bottom: 16px; /* bottom-4 equivalent */
  right: 16px; /* right-4 equivalent */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #111827;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: background-color 0.2s ease;
  padding: 0;
  z-index: 1; /* Lagere z-index, binnen de kaart */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtiele shadow */
}

.materiaal-add-button:hover {
  background: #0F172A;
  color: #ffffff;
}

.materiaal-add-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.2);
}

/* Standaard KPI-styling (dashboard etc.) */
.kpi {
  position: relative; /* Essentieel voor absolute positioning van child elements */
  padding: 16px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px; /* hoge tegels op andere pagina's */
  overflow: hidden; /* Voorkomt dat absolute children buiten de kaart komen */
}

/* KPI-kaarten op de overzichts/dashboardpagina wat compacter en met icoon rechtsboven */
.dashboard-left .kpi {
  min-height: 120px;
}

.dashboard-left .kpi .kpi-title {
  justify-content: space-between;
}

.kpi-title {
  display: flex;
  align-items: center;
  gap: 8px; /* gap-2 equivalent */
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px; /* mb-2 equivalent */
  line-height: 1.2;
}

/* Uniform icon sizing - 24px × 24px */
.kpi-title i,
.kpi-title svg {
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-title svg {
  color: currentColor;
}

.materiaal-grid .kpi-title {
  font-size: 10px !important;
  margin-bottom: 2px !important;
  gap: 4px !important;
  line-height: 1.2 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}

.kpi-dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
}

.kpi-alert {
  font-size: 14px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 4px 0; /* mb-1 equivalent */
  letter-spacing: -1px;
}

.materiaal-grid .kpi-value {
  font-size: 26px !important;
  margin: 3px 0 !important;
  line-height: 1 !important;
}

.kpi-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 0;
  line-height: 1.3;
}

.materiaal-grid .kpi-sub {
  font-size: 10px !important;
  margin-top: 2px !important;
  line-height: 1.2 !important;
}

/* Keuring vereiste styling */
.kpi.warn .kpi-title {
  color: #dc2626;
}

.kpi.warn .kpi-value {
  color: #dc2626;
}

/* KPI link styling (when stat card is a link) */
.kpi-link {
  text-decoration: none;
  color: inherit;
}

.kpi-link:hover {
  text-decoration: none;
  color: inherit;
}

/* ================== SEARCH BAR ================== */

.search {
  padding: 0;
  margin-top: 24px; /* mt-6 equivalent */
  margin-bottom: 24px; /* mb-6 equivalent */
  border: 1px solid var(--line);
  border-radius: 12px; /* rounded-xl */
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.search-icon {
  font-size: 18px;
  opacity: 0.5;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
}

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

.search .btn {
  margin-left: auto;
}

/* ================== PANELS (bottom two cards) ================== */

.grid-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px; /* gap-6 equivalent */
  margin-top: 24px; /* mt-6 equivalent */
}

.panel {
  min-height: 280px;
  padding: 24px; /* p-6 */
}

.panel-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px; /* mb-2 equivalent */
}

.panel-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px; /* mb-6 equivalent */
}

.panel .list-group {
  margin-top: 24px; /* mt-6 */
}

.panel .list-group-item {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  background: transparent;
}

.panel .list-group-item:last-child {
  border-bottom: none;
}

.panel .text-muted {
  color: var(--muted);
  font-style: italic;
  padding: 20px 0;
}

/* ================== RESPONSIVE ================== */

@media (max-width: 1024px) {
  .grid-top,
  .dashboard-left .grid-top,
  .documenten-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  /* Keep 2 columns for materiaal-grid on tablets */
  .materiaal-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-top .hero-image {
    display: none;
  }

  .section-header {
    grid-template-columns: 1fr;
  }

  .section-header .hero-image {
    display: none;
  }

  /* Dashboard top section: stack on tablet */
  .dashboard-top-section {
    grid-template-columns: 1fr;
  }
}

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

  .main {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    padding: 0 16px;
  }

  .page {
    padding: 16px;
    padding-bottom: 80px; /* ruimte voor mobiele nav-balk */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Voorkom horizontaal scrollen */
  }

  /* Dashboard top section: stack op mobiel */
  .dashboard-top-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Alle statistiek-kaarten (KPI's) op volledige breedte op mobiel */
  .grid-top,
  .dashboard-left .grid-top,
  .documenten-grid {
    grid-template-columns: 1fr !important;
    gap: 16px; /* Iets kleinere gap op mobiel */
  }

  /* Materiaal grid en andere grids: onder elkaar op mobiel */
  .materiaal-grid,
  .grid-bottom {
    grid-template-columns: 1fr;
  }

  /* Zorg dat KPI cards geen vaste breedte hebben op mobiel */
  .kpi {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Extra verfijning voor kleine telefoons */
@media (max-width: 576px) {
  /* KPI-boxen blijven zichtbaar op mobiele apparaten */
  /* Alle statistiek-kaarten op volledige breedte (1 per rij) */
  .grid-top,
  .dashboard-left .grid-top,
  .documenten-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .h-title {
    font-size: 22px;
  }

  .h-sub {
    font-size: 13px;
  }

  .card {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Voorkom horizontaal scrollen */
  .page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  .kpi {
    min-height: 140px; /* Match material page KPI cards on mobile */
  }

  /* Ensure dashboard KPI cards match material page size on mobile */
  .dashboard-left .kpi {
    min-height: 140px; /* Same as material page */
  }

  .kpi-value {
    font-size: 24px;
  }

  .panel-title {
    font-size: 16px;
  }

  .panel-sub {
    font-size: 12px;
  }

  table.table {
    font-size: 12px;
  }

  table.table th,
  table.table td {
    padding: 6px 8px;
  }

  .hero-image {
    display: none;
  }

  /* Verberg minder belangrijke kolommen in documenten-tabel op kleine schermen */
  .documenten-table .doc-col-sm-hide {
    display: none;
  }
}

/* ================== MATERIAL TABLE ROW STYLING ================== */
.material-row-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.material-row-clickable:hover {
  background-color: #f8f9fa !important;
}

.material-row-clickable td {
  user-select: none;
}

/* ================== SPACING UTILITIES ================== */
.mt-8 {
  margin-top: 32px;
}

.mb-8 {
  margin-bottom: 32px;
}

/* ================== ORANGE WARNING CARD ================== */
.panel-warning-orange {
  margin-top: 32px;
  border: 2px solid #F97316;
  background-color: #ffffff;
}

.panel-warning-orange .panel-title i {
  color: #F97316;
  margin-right: 8px;
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ================== KEUERINGEN TABLE STYLING ================== */
.keuringen-table-empty-cell {
  color: #9CA3AF;
}

.keuringen-table-date-late {
  color: #DC2626;
  font-size: 12px;
}

.keuringen-table-date-today {
  color: #F59E0B;
  font-size: 12px;
}

.keuringen-table-date-upcoming {
  color: #6B7280;
  font-size: 12px;
}

.keuringen-table-empty-message {
  text-align: center;
  color: #6B7280;
  padding: 48px 20px;
}

.keuringen-table-empty-message a {
  color: var(--text);
  text-decoration: underline;
  margin-left: 8px;
}

/* ================== UTILITIES & BOOTSTRAP OVERRIDES ================== */

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

.max-w-300 {
  max-width: 300px;
}

.card-img-160 {
  height: 160px;
  overflow: hidden;
  background-color: #f8f9fa;
}

.card-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-icon {
  font-size: 48px;
  color: #dee2e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon svg {
  width: 48px;
  height: 48px;
  color: #dee2e6;
}

.flex-gap-8 {
  display: flex;
  gap: 8px;
}

.card-rounded {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.min-h-2-5 {
  min-height: 2.5em;
}

.img-cover-rounded {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.w-160 {
  width: 160px;
}

.justify-end {
  justify-content: flex-end;
}

/* Black primary button */
.btn-primary,
.btn.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
}

.btn-primary:hover,
.btn.btn-primary:hover {
  background: #0f172a !important;
  border-color: #0f172a !important;
  color: #fff !important;
}

.btn-primary:focus,
.btn.btn-primary:focus {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.25);
}

.form-control {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
}

.alert {
  border-radius: 8px;
  border: 1px solid;
}

/* ================== KEUERINGEN PAGE - MODERN STYLING ================== */

/* Header Section */
.keuringen-header {
  margin-bottom: 24px; /* mb-6 */
}

.keuringen-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.keuringen-main-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0; /* mb-2 */
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.keuringen-subtitle {
  color: #6B7280;
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 24px; /* mb-6 */
  font-weight: 400;
}

/* Keuringen stat cards now use unified .kpi styling - no separate styles needed */

/* Overview Section */
.keuringen-overview-section {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px; /* rounded-xl */
  padding: 24px; /* p-6 */
  margin-bottom: 24px; /* mb-6 */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.keuringen-overview-header {
  margin-bottom: 24px; /* mb-6 */
}

.keuringen-overview-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0; /* mb-2 */
}

.keuringen-overview-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 24px 0; /* mb-6 */
}

/* Filter Form */
.keuringen-filter-form {
  width: 100%;
}

.keuringen-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.keuringen-filter-item {
  display: flex;
  flex-direction: column;
}

.keuringen-filter-search {
  grid-column: span 2;
}

.keuringen-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.keuringen-search-icon {
  position: absolute;
  left: 16px;
  font-size: 18px;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

.keuringen-search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.keuringen-search-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.keuringen-filter-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  background: #ffffff;
  color: var(--text);
  transition: all 0.2s ease;
  cursor: pointer;
}

.keuringen-filter-select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.keuringen-filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  grid-column: span 2;
}

.keuringen-filter-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
}

/* Table Container */
.keuringen-table-container {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px; /* rounded-xl */
  overflow: hidden;
  margin-top: 24px; /* mt-6 */
  margin-bottom: 24px; /* mb-6 */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.keuringen-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.keuringen-table thead {
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}

.keuringen-table thead th {
  padding: 16px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #E5E7EB;
}

.keuringen-table thead th:last-child {
  text-align: right;
}

.keuringen-table-header-link {
  color: #6B7280;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.keuringen-table-header-link:hover {
  color: var(--text);
}

.keuringen-table tbody tr {
  border-bottom: 1px solid #F3F4F6;
  transition: background-color 0.15s ease;
}

.keuringen-table tbody tr:last-child {
  border-bottom: none;
}

.keuringen-table tbody tr:hover {
  background-color: #F9FAFB;
}

.keuringen-table tbody td {
  padding: 20px;
  vertical-align: middle;
  color: var(--text);
  line-height: 1.5;
  min-height: 72px;
  height: 72px;
}

.keuringen-table tbody td:last-child {
  text-align: right;
}

/* Badges */
.keuringen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.keuringen-badge-goedgekeurd {
  background-color: #065F46;
  color: #ffffff;
}

.keuringen-badge-afgekeurd {
  background-color: #991B1B;
  color: #ffffff;
}

.keuringen-badge-te-laat {
  background-color: #991B1B;
  color: #ffffff;
}

.keuringen-badge-vandaag {
  background-color: #92400E;
  color: #ffffff;
}

.keuringen-badge-binnenkort {
  background-color: #92400E;
  color: #ffffff;
}

.keuringen-badge-gepland {
  background-color: #374151;
  color: #ffffff;
}

/* Action Buttons */
.keuringen-action-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.keuringen-action-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.keuringen-action-btn:hover {
  background-color: #F3F4F6;
  color: var(--text);
}

.keuringen-action-btn-primary {
  background-color: var(--text);
  color: #ffffff;
}

.keuringen-action-btn-primary:hover {
  background-color: #0F172A;
  color: #ffffff;
}

.keuringen-action-btn-link {
  color: var(--text);
}

.keuringen-action-btn-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Material Link */
.keuringen-material-link {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.keuringen-material-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.keuringen-material-serial {
  font-size: 12px;
  color: #6B7280;
}

/* Certificate Badge */
.keuringen-cert-badge {
  font-size: 18px;
  opacity: 0.7;
}

/* Table Row Height Consistency */
.keuringen-table tbody tr {
  height: 72px;
}

.keuringen-table tbody tr td {
  padding-top: 20px;
  padding-bottom: 20px;
}

/* Inspection Status Badge - Zwarte badge, exact zelfde vorm als Bootstrap badges */
.badge.inspection-badge {
  background-color: #111827 !important;
  color: #ffffff !important;
  /* Bootstrap badge standaard styling - exact match */
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  /* Zorg dat het exact dezelfde grootte heeft als andere badges */
  box-sizing: border-box;
}

/* Ensure table cells with badges have proper alignment */
.table td {
  vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .keuringen-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .keuringen-filter-search {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .keuringen-header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .keuringen-main-title {
    font-size: 28px;
  }

  .keuringen-overview-section {
    padding: 20px;
  }

  .keuringen-filter-grid {
    grid-template-columns: 1fr;
  }

  .keuringen-filter-search {
    grid-column: span 1;
  }

  .keuringen-filter-actions {
    grid-column: span 1;
    flex-direction: column;
  }

  .keuringen-filter-btn {
    width: 100%;
  }

  .keuringen-table-container {
    overflow-x: auto;
  }

  .keuringen-table {
    min-width: 800px;
  }

  .keuringen-action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .keuringen-action-btn {
    width: 100%;
    text-align: center;
  }
}

/* Utility class for scrollable containers */
.scrollable-container {
  max-height: 280px;
  overflow-y: auto;
}
/* ============================================================
   DARK MODE — data-theme="dark" op <html>
   ============================================================ */
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #e2e8f0;
  --warn: #f59e0b;
  --warn-bg: rgba(245,158,11,.12);
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 6px -1px rgba(0,0,0,.4);
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }

[data-theme="dark"] .sidebar {
  background: #1e293b;
  border-right-color: #334155;
}
[data-theme="dark"] .menu-item { color: #cbd5e1; }
[data-theme="dark"] .menu-item:hover { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .menu-item.active { background: #6d28d9; color: #fff; }
[data-theme="dark"] .user-card { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .user-name { color: #f1f5f9; }

[data-theme="dark"] .card,
[data-theme="dark"] .panel {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text);
}
[data-theme="dark"] .panel-title { color: #f1f5f9; }
[data-theme="dark"] .panel-sub { color: #94a3b8; }

[data-theme="dark"] .topbar { background: #1e293b; border-bottom-color: #334155; }
[data-theme="dark"] .app-title { color: #f1f5f9; }
[data-theme="dark"] .main { background: var(--bg); }

[data-theme="dark"] .table { color: var(--text); }
[data-theme="dark"] .table th { color: #94a3b8; border-color: #334155; background: transparent; }
[data-theme="dark"] .table td { border-color: #334155; }
[data-theme="dark"] .table-hover tbody tr:hover td { background: #1e293b; }
[data-theme="dark"] .table-light { background: #1e293b !important; }
[data-theme="dark"] thead.table-light tr th { background: #1e293b !important; color: #94a3b8; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background: #0f172a;
  border-color: #6d28d9;
  color: #e2e8f0;
  box-shadow: 0 0 0 .2rem rgba(109,40,217,.25);
}
[data-theme="dark"] .input-group-text { background: #1e293b; border-color: #334155; color: #94a3b8; }

[data-theme="dark"] .btn-outline-secondary { border-color: #475569; color: #94a3b8; }
[data-theme="dark"] .btn-outline-secondary:hover { background: #334155; color: #e2e8f0; border-color: #475569; }
[data-theme="dark"] .dropdown-menu { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .dropdown-item { color: #cbd5e1; }
[data-theme="dark"] .dropdown-item:hover { background: #334155; color: #f1f5f9; }

[data-theme="dark"] .alert-info { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.3); color: #93c5fd; }
[data-theme="dark"] .alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #86efac; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: #fcd34d; }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }

[data-theme="dark"] .modal-content { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .modal-header { border-bottom-color: #334155; }
[data-theme="dark"] .modal-footer { border-top-color: #334155; }
[data-theme="dark"] .modal-title { color: #f1f5f9; }

[data-theme="dark"] .nav-tabs { border-bottom-color: #334155; }
[data-theme="dark"] .nav-link { color: #94a3b8; }
[data-theme="dark"] .nav-link.active { background: #1e293b; border-color: #334155 #334155 #1e293b; color: #f1f5f9; }
[data-theme="dark"] .nav-tabs .nav-link:hover { border-color: #334155; color: #e2e8f0; }

[data-theme="dark"] .section-header { border-bottom-color: #334155; }
[data-theme="dark"] .h-title { color: #f1f5f9; }
[data-theme="dark"] .h-sub { color: #94a3b8; }

[data-theme="dark"] .list-group-item { background: var(--card); border-color: #334155; color: var(--text); }

/* Dark mode toggle switch */
.dark-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 0;
  margin-top: 8px;
}
.dark-toggle-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.theme-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  cursor: pointer;
  transition: .3s;
}
.theme-slider:before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}
input:checked + .theme-slider { background: #6d28d9; }
input:checked + .theme-slider:before { transform: translateX(18px); }
[data-theme="dark"] .theme-slider { background: #334155; }

/* Environment badge */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Module tab in sidebar */
.menu-item-custom {
  border-left: 2px solid var(--brand);
  margin-left: 2px;
}
[data-theme="dark"] .menu-item-custom { border-left-color: #6d28d9; }

/* Tabs beheer panel */
.tabs-manager {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
}
[data-theme="dark"] .tabs-manager { background: #0f172a; }


/* ============================================================
   SIDEBAR COLLAPSE
   ============================================================ */
.sidebar { transition: width .25s ease, padding .25s ease; }

.sidebar.collapsed {
  width: 64px;
  padding: 16px 8px;
  overflow: visible; /* tooltip moet buiten sidebar zichtbaar zijn */
}

/* Logo swaps */
.sidebar.collapsed #sidebar-logo-full  { display: none !important; }
.sidebar.collapsed #sidebar-logo-text  { display: none !important; }
.sidebar.collapsed #sidebar-logo-icon  { display: block !important; margin: 0 auto; }
.sidebar:not(.collapsed) #sidebar-logo-icon { display: none !important; }

/* Verberg alle tekst — gebruik clip zodat layout niet breekt */
.sidebar.collapsed .brand-logo       { display: none; }
.sidebar.collapsed .env-badge        { display: none; }
.sidebar.collapsed .admin-divider    { display: none; }
.sidebar.collapsed #add-tab-btn      { display: none !important; }
.sidebar.collapsed #tabs-panel       { display: none !important; }
.sidebar.collapsed .user-name        { display: none; }
.sidebar.collapsed .user-role        { display: none; }
.sidebar.collapsed .mt-1             { display: none; }
.sidebar.collapsed .dark-toggle-label span { display: none; }
.sidebar.collapsed .dark-toggle-label i { font-size: 20px; }
.sidebar.collapsed .dark-toggle-wrap {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
/* Schakelaar ook gecentreerd */
.sidebar.collapsed .theme-switch { display: block; }
.sidebar.collapsed .env-switch-wrap  { display: none; }

/* Menu items: alleen icoon tonen via font-size:0 trick */
.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 10px 0;
  width: 100%;
  font-size: 0;          /* verbergt text nodes volledig */
  letter-spacing: 0;
}
/* Herstel icoon grootte */
.sidebar.collapsed .menu-item .menu-item-icon {
  margin: 0;
  font-size: 20px;
  width: 24px;
  height: 24px;
}
.sidebar.collapsed .menu-item .menu-item-icon i,
.sidebar.collapsed .menu-item .menu-item-icon svg {
  font-size: 20px;
  width: 20px;
  height: 20px;
}
/* Verberg alle andere element-children */
.sidebar.collapsed .menu-item > *:not(.menu-item-icon) { display: none; }
/* Toch het menu-item-icon tonen */
.sidebar.collapsed .menu-item > .menu-item-icon { display: inline-flex; }

/* User card: enkel avatar */
.sidebar.collapsed .user-card {
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.sidebar.collapsed .user-card .avatar { margin: 0 auto; }

/* Navigatie gaps */
.sidebar.collapsed nav.menu { gap: 2px; }
.sidebar.collapsed #user-tabs-section a {
  justify-content: center;
  padding: 10px 0;
  overflow: hidden;
}
.sidebar.collapsed #user-tabs-section a > *:not(.menu-item-icon) { display: none; }
/* Tooltip on hover when collapsed */
.sidebar.collapsed .menu-item { position: relative; }
.sidebar.collapsed .menu-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
[data-theme="dark"] .sidebar.collapsed .menu-item:hover::after {
  background: #e2e8f0;
  color: #0f172a;
}

/* Collapse toggle button */
.sidebar-collapse-btn {
  position: fixed;
  top: 22px;
  left: 248px; /* sidebar width (260) - half button (12) */
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  z-index: 300;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: left .25s ease;
  user-select: none;
}
.sidebar-collapse-btn.collapsed-state {
  left: 52px; /* collapsed width (64) - half button (12) */
}
@media (max-width: 767px) {
  .sidebar-collapse-btn { display: none; }
}

/* Main content shift when sidebar collapsed */
.sidebar.collapsed ~ .main { margin-left: 64px; }

/* Kalender grid */
.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.kalender-dag {
  min-height: 80px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  font-size: 12px;
}
.kalender-dag.vandaag { border-color: var(--brand); background: rgba(37,99,235,.06); }
.kalender-dag.andere-maand { opacity: .4; }
.kalender-event {
  background: var(--brand);
  color: #fff;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  margin-top: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kalender-event.reservatie { background: #059669; }
.kalender-event.keuring { background: #dc2626; }
[data-theme="dark"] .kalender-dag { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .kalender-dag.vandaag { background: rgba(109,40,217,.15); border-color: #7c3aed; }

/* Status badges */
.badge-aangevraagd { background: #f59e0b; color: #fff; }
.badge-goedgekeurd { background: #059669; color: #fff; }
.badge-geweigerd   { background: #dc2626; color: #fff; }
.badge-geannuleerd { background: #6b7280; color: #fff; }


/* ============================================================
   DARK MODE — UITGEBREIDE FIX (alle form-elementen & panels)
   ============================================================ */

/* ── Form controls ─────────────────────────────────────────── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input.form-control,
[data-theme="dark"] select.form-select {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: #0f172a !important;
  border-color: #6d28d9 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 0 0 .2rem rgba(109,40,217,.2) !important;
}
[data-theme="dark"] .form-control::placeholder { color: #475569 !important; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
  background-color: #1e293b !important;
  color: #64748b !important;
}

/* ── Input groups ──────────────────────────────────────────── */
[data-theme="dark"] .input-group-text {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* ── Checkboxes & radio's ──────────────────────────────────── */
[data-theme="dark"] .form-check-input {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .form-check-input:checked {
  background-color: #6d28d9 !important;
  border-color: #6d28d9 !important;
}

/* ── Switches ──────────────────────────────────────────────── */
[data-theme="dark"] .form-switch .form-check-input {
  background-color: #334155 !important;
}
[data-theme="dark"] .form-switch .form-check-input:checked {
  background-color: #6d28d9 !important;
}

/* ── Labels ────────────────────────────────────────────────── */
[data-theme="dark"] .form-label,
[data-theme="dark"] label { color: #cbd5e1; }
[data-theme="dark"] .form-text { color: #64748b !important; }

/* ── Cards ─────────────────────────────────────────────────── */
[data-theme="dark"] .card { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0; }
[data-theme="dark"] .card-header { background: #162032 !important; border-color: #334155 !important; color: #f1f5f9; }
[data-theme="dark"] .card-footer { background: #162032 !important; border-color: #334155 !important; }
[data-theme="dark"] .card-body { color: #e2e8f0; }

/* ── Panels (eigen klasse) ─────────────────────────────────── */
[data-theme="dark"] .panel { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .panel-title { color: #f1f5f9 !important; }
[data-theme="dark"] .panel-sub { color: #94a3b8 !important; }

/* ── Section header ────────────────────────────────────────── */
[data-theme="dark"] .section-header { border-bottom-color: #334155; }
[data-theme="dark"] .h-title { color: #f1f5f9 !important; }
[data-theme="dark"] .h-sub { color: #94a3b8 !important; }

/* ── Topbar ────────────────────────────────────────────────── */
[data-theme="dark"] .topbar { background: #1e293b !important; border-bottom-color: #334155 !important; }

/* ── Tables ────────────────────────────────────────────────── */
[data-theme="dark"] .table { color: #e2e8f0 !important; }
[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .table thead th {
  color: #94a3b8 !important;
  background: #162032 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: #334155 !important;
}
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light td,
[data-theme="dark"] .table-light th,
[data-theme="dark"] thead.table-light tr th {
  background-color: #162032 !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

/* ── Badges (light) ────────────────────────────────────────── */
[data-theme="dark"] .badge.bg-light { background-color: #334155 !important; color: #e2e8f0 !important; }
[data-theme="dark"] .text-dark { color: #e2e8f0 !important; }

/* ── Alerts ────────────────────────────────────────────────── */
[data-theme="dark"] .alert { border-color: transparent; }
[data-theme="dark"] .alert-light {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* ── Modals ────────────────────────────────────────────────── */
[data-theme="dark"] .modal-content { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0; }
[data-theme="dark"] .modal-header { border-color: #334155 !important; background: #162032; }
[data-theme="dark"] .modal-footer { border-color: #334155 !important; background: #162032; }
[data-theme="dark"] .modal-title { color: #f1f5f9 !important; }
[data-theme="dark"] .btn-close { filter: invert(1); }

/* ── Dropdowns ─────────────────────────────────────────────── */
[data-theme="dark"] .dropdown-menu {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.4) !important;
}
[data-theme="dark"] .dropdown-item { color: #cbd5e1 !important; }
[data-theme="dark"] .dropdown-item:hover { background: #334155 !important; color: #f1f5f9 !important; }
[data-theme="dark"] .dropdown-header { color: #64748b !important; }
[data-theme="dark"] .dropdown-divider { border-color: #334155 !important; }

/* ── Navs & tabs ───────────────────────────────────────────── */
[data-theme="dark"] .nav-tabs { border-color: #334155 !important; }
[data-theme="dark"] .nav-tabs .nav-link {
  color: #94a3b8 !important;
  border-color: transparent !important;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
  background: #1e293b !important;
  border-color: #334155 #334155 #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .nav-pills .nav-link { color: #94a3b8 !important; }
[data-theme="dark"] .nav-pills .nav-link.active { background: #6d28d9 !important; color: #fff !important; }

/* ── Buttons outline ───────────────────────────────────────── */
[data-theme="dark"] .btn-outline-secondary {
  border-color: #475569 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .btn-outline-secondary:hover {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
[data-theme="dark"] .btn-outline-dark {
  border-color: #e2e8f0 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .btn-outline-dark:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
[data-theme="dark"] .btn-light {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

/* ── List groups ───────────────────────────────────────────── */
[data-theme="dark"] .list-group-item {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .list-group-item:hover { background: #334155 !important; }
[data-theme="dark"] .list-group-item.active {
  background: #6d28d9 !important;
  border-color: #6d28d9 !important;
  color: #fff !important;
}

/* ── Pagination ────────────────────────────────────────────── */
[data-theme="dark"] .page-link {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .page-link:hover { background: #334155 !important; color: #e2e8f0 !important; }
[data-theme="dark"] .page-item.active .page-link { background: #6d28d9 !important; border-color: #6d28d9 !important; }

/* ── Progress bars ─────────────────────────────────────────── */
[data-theme="dark"] .progress { background: #334155 !important; }

/* ── KPI cards (eigen stijl) ───────────────────────────────── */
[data-theme="dark"] .kpi { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .kpi-title { color: #94a3b8 !important; }
[data-theme="dark"] .kpi-value { color: #f1f5f9 !important; }

/* ── Borders ───────────────────────────────────────────────── */
[data-theme="dark"] .border { border-color: #334155 !important; }
[data-theme="dark"] .border-light { border-color: #334155 !important; }
[data-theme="dark"] hr { border-color: #334155 !important; }

/* ── Backgrounds ───────────────────────────────────────────── */
[data-theme="dark"] .bg-light { background-color: #1e293b !important; }
[data-theme="dark"] .bg-white { background-color: #1e293b !important; }
[data-theme="dark"] .text-dark { color: #e2e8f0 !important; }
[data-theme="dark"] .text-muted { color: #64748b !important; }

/* ── Stat cards ────────────────────────────────────────────── */
[data-theme="dark"] .stat-card,
[data-theme="dark"] [class*="stat"] { background: #1e293b !important; border-color: #334155 !important; }

/* ── Vtrace kolommen panel ─────────────────────────────────── */
[data-theme="dark"] #vtrace-kolommen-panel {
  background: #1e293b !important;
  border-color: #334155 !important;
}


/* ══════════════════════════════════════════════════════════════════════════════
   ODOO-STIJL HOME SCHERM — volledig scherm zonder sidebar
   ══════════════════════════════════════════════════════════════════════════════ */

body.home-fullscreen .sidebar,
body.home-fullscreen .sidebar-collapse-btn,
body.home-fullscreen .mobile-nav { display: none !important; }

body.home-fullscreen .main {
  margin-left: 0 !important;
  width: 100% !important;
}

body.home-fullscreen .topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 200;
}
body.home-fullscreen .app-title { color: #fff; }
body.home-fullscreen .topbar-btn {
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
}
body.home-fullscreen .topbar-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
body.home-fullscreen .topbar-avatar {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}
body.home-fullscreen .topbar-sa-btn { display: none; }

body.home-fullscreen {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f0f1a 100%);
  min-height: 100vh;
}

body.home-fullscreen .page {
  padding: 0;
  padding-top: 52px; /* topbar hoogte */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* App tiles voor home */
.home-app-grid {
  max-width: 900px;
  width: 100%;
  padding: 3rem 2rem;
}

.home-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  text-decoration: none;
  padding: .75rem .5rem;
  border-radius: 16px;
  transition: background .15s, transform .15s;
}
.home-app-tile:hover {
  background: rgba(255,255,255,.08);
  transform: translateY(-2px);
}
.home-app-tile .tile-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .15s, box-shadow .15s;
}
.home-app-tile:hover .tile-icon {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.home-app-tile .tile-naam {
  font-size: .73rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  text-align: center;
  max-width: 80px;
  line-height: 1.2;
}

/* Gear icon op home tiles (admin hover) */
.home-tile-gear {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  color: rgba(255,255,255,.85);
  font-size: .65rem;
  text-decoration: none;
  transition: background .1s;
  z-index: 2;
}
.home-app-tile:hover .home-tile-gear { display: flex; }
.home-tile-gear:hover { background: var(--brand); color: #fff; }

.home-search {
  max-width: 400px;
  margin: 0 auto 2.5rem;
  position: relative;
}
.home-search input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 24px;
  padding: .7rem 1.2rem .7rem 2.8rem;
  font-size: .9rem;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color .15s, background .15s;
}
.home-search input::placeholder { color: rgba(255,255,255,.35); }
.home-search input:focus {
  background: rgba(255,255,255,.12);
  border-color: rgba(37,99,235,.6);
}
.home-search .search-icon {
  position: absolute;
  left: .9rem; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.35);
  font-size: .9rem;
}
.home-categorie-lijn {
  color: rgba(255,255,255,.25);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  text-align: center;
  margin: .5rem 0 .25rem;
}

/* ── Module sub-navigatie (Odoo-stijl horizontale menu) ─────────────────── */
.module-subnav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 2rem;
  position: sticky;
  top: 56px; /* hoogte topbar */
  z-index: 9;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.module-subnav::-webkit-scrollbar { display: none; }
.module-subnav-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.module-subnav-item:hover { color: var(--text); }
.module-subnav-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.module-subnav-divider {
  width: 1px;
  background: var(--line);
  margin: .4rem .25rem;
  align-self: stretch;
}
.module-subnav-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  border-radius: 6px;
  align-self: center;
  flex-shrink: 0;
}
[data-theme="dark"] .module-subnav { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .module-subnav-item { color: #64748b; }
[data-theme="dark"] .module-subnav-item:hover { color: #e2e8f0; }


/* Page inner — voor modules met sub-navigatie */
.page-inner {
  padding: 1.5rem 2rem;
}
@media (max-width: 576px) {
  .page-inner { padding: 1rem; }
  .module-subnav { padding: 0 .75rem; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DIGITAL GENICS BRANDING
   3 themes: light (standaard), dark, orange
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── DG Brand variabelen ──────────────────────────────────────────────────── */
:root {
  --dg-oranje:    #FF6B00;
  --dg-donker:    #1A1A1A;
  --dg-grijs:     #888888;
  --dg-licht:     #F5F5F3;
  --dg-rand:      #E8E8E8;
  --dg-wit:       #FFFFFF;
  /* Override brand color */
  --brand: #FF6B00;
}

/* ── THEME: ORANGE ────────────────────────────────────────────────────────── */
[data-theme="orange"] {
  --bg:    #FF6B00;
  --card:  #e85f00;
  --line:  rgba(255,255,255,.2);
  --text:  #ffffff;
  --muted: rgba(255,255,255,.65);
  --brand: #ffffff;
  --accent:#ffffff;
}
[data-theme="orange"] body { background: #FF6B00; color: #fff; }
[data-theme="orange"] .sidebar {
  background: #e55b00;
  border-right-color: rgba(255,255,255,.15);
}
[data-theme="orange"] .menu-item { color: rgba(255,255,255,.85); }
[data-theme="orange"] .menu-item:hover { background: rgba(255,255,255,.15); color: #fff; }
[data-theme="orange"] .menu-item.active { background: rgba(0,0,0,.2); color: #fff; }
[data-theme="orange"] .topbar {
  background: #e55b00;
  border-bottom-color: rgba(255,255,255,.15);
}
[data-theme="orange"] .app-title { color: #fff; }
[data-theme="orange"] .topbar-btn { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.8); }
[data-theme="orange"] .topbar-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
[data-theme="orange"] .topbar-avatar { background: rgba(0,0,0,.3); }
[data-theme="orange"] .card, [data-theme="orange"] .panel {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.2) !important;
  color: #fff;
}
[data-theme="orange"] .panel-title { color: #fff !important; }
[data-theme="orange"] .panel-sub { color: rgba(255,255,255,.7) !important; }
[data-theme="orange"] .h-title { color: #fff !important; }
[data-theme="orange"] .h-sub { color: rgba(255,255,255,.7) !important; }
[data-theme="orange"] .table { color: #fff !important; }
[data-theme="orange"] .table th, [data-theme="orange"] .table td { border-color: rgba(255,255,255,.15) !important; }
[data-theme="orange"] .table-light, [data-theme="orange"] thead.table-light tr th { background: rgba(0,0,0,.1) !important; color: rgba(255,255,255,.8) !important; }
[data-theme="orange"] .form-control, [data-theme="orange"] .form-select {
  background: rgba(255,255,255,.15) !important;
  border-color: rgba(255,255,255,.3) !important;
  color: #fff !important;
}
[data-theme="orange"] .form-control::placeholder { color: rgba(255,255,255,.4) !important; }
[data-theme="orange"] .btn-primary { background: rgba(0,0,0,.25); border-color: rgba(0,0,0,.3); }
[data-theme="orange"] .btn-outline-secondary { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.8); }
[data-theme="orange"] .text-muted { color: rgba(255,255,255,.6) !important; }
[data-theme="orange"] .dropdown-menu { background: #e55b00 !important; border-color: rgba(255,255,255,.15) !important; }
[data-theme="orange"] .dropdown-item { color: rgba(255,255,255,.9) !important; }
[data-theme="orange"] .dropdown-item:hover { background: rgba(0,0,0,.15) !important; }
[data-theme="orange"] .user-card { background: rgba(0,0,0,.15); border-color: rgba(255,255,255,.15); }
[data-theme="orange"] .user-name { color: #fff !important; }
[data-theme="orange"] hr { border-color: rgba(255,255,255,.2) !important; }
[data-theme="orange"] .badge.bg-secondary { background: rgba(0,0,0,.2) !important; }
[data-theme="orange"] .nav-tabs { border-color: rgba(255,255,255,.2) !important; }
[data-theme="orange"] .nav-link { color: rgba(255,255,255,.7) !important; }
[data-theme="orange"] .nav-link.active { background: rgba(0,0,0,.15) !important; color: #fff !important; border-color: rgba(255,255,255,.2) rgba(255,255,255,.2) transparent !important; }
[data-theme="orange"] .modal-content { background: #e55b00 !important; border-color: rgba(255,255,255,.15) !important; }
[data-theme="orange"] .modal-header, [data-theme="orange"] .modal-footer { border-color: rgba(255,255,255,.15) !important; }
[data-theme="orange"] .theme-slider { background: rgba(0,0,0,.25) !important; }
[data-theme="orange"] input:checked + .theme-slider { background: rgba(0,0,0,.4) !important; }
[data-theme="orange"] .section-header { border-bottom-color: rgba(255,255,255,.2); }
[data-theme="orange"] .dark-toggle-label { color: rgba(255,255,255,.7); }

/* Override brand accent in orange theme */
[data-theme="orange"] .menu-item.active { box-shadow: none; }
[data-theme="orange"] .btn-primary { background: rgba(0,0,0,.3) !important; border-color: rgba(0,0,0,.4) !important; color: #fff !important; }

/* ── DG Logo Animatie ─────────────────────────────────────────────────────── */
.dg-logo-animated {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  position: relative;
}
.dg-logo-animated img {
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.dg-logo-animated:hover img { transform: scale(1.05) rotate(-1deg); }

/* DG brand puls animatie op icon */
@keyframes dg-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}
@keyframes dg-glow {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(255,107,0,0)); }
  50%       { filter: drop-shadow(0 0 8px rgba(255,107,0,.5)); }
}
.dg-icon-animated {
  animation: dg-pulse 3s ease-in-out infinite, dg-glow 3s ease-in-out infinite;
  cursor: pointer;
}
.dg-icon-animated:hover {
  animation: none;
  transform: scale(1.08);
  filter: drop-shadow(0 4px 12px rgba(255,107,0,.4));
  transition: all .2s ease;
}

/* ── Theme 3-weg switcher ─────────────────────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border-radius: 99px;
  border: 1px solid var(--line);
}
.theme-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  position: relative;
}
.theme-btn:hover { transform: scale(1.15); }
.theme-btn.actief { border-color: var(--brand); transform: scale(1.1); }
.theme-btn.theme-light { background: #fff; box-shadow: 0 0 0 1px #ddd; }
.theme-btn.theme-dark  { background: #1A1A1A; }
.theme-btn.theme-orange{ background: #FF6B00; }
[data-theme="dark"] .theme-switcher { background: #1e293b; border-color: #334155; }
[data-theme="orange"] .theme-switcher { background: rgba(0,0,0,.15); border-color: rgba(255,255,255,.2); }


/* ══════════════════════════════════════════════════════════════════════════════
   LOGO GROOTTE FIX + APP SWITCHER + CONTEXT SIDEBAR
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Logo: altijd 34px, nooit groter ─────────────────────────────────────── */
.dg-app-icon,
#dg-sidebar-icon,
#dg-logo-img,
.sidebar .brand img,
.sidebar-brand img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  object-fit: cover;
  display: block;
}
.topbar .dg-app-icon,
.topbar #dg-logo-img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
}
.sidebar .brand,
#sidebar-brand {
  margin-bottom: 12px !important;
  display: flex;
  align-items: center;
}

/* ── App Switcher popup ───────────────────────────────────────────────────── */
/* ── App Switcher Popup ─────────────────────────────────────────────────── */
.app-switcher-wrap { position: relative; }

.app-switcher-popup {
  position: fixed;
  left: 260px; top: 0;
  width: 380px; max-height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--line);
  box-shadow: 6px 0 32px rgba(0,0,0,.18);
  z-index: 500;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 0;
  border-radius: 0 12px 12px 0;
}
.sidebar.collapsed .app-switcher-popup { left: 64px; }
[data-theme="dark"] .app-switcher-popup { background: #1e293b; box-shadow: 6px 0 32px rgba(0,0,0,.5); }
[data-theme="orange"] .app-switcher-popup { background: rgba(0,0,0,.25); backdrop-filter: blur(10px); }
.app-switcher-popup.open { display: flex; }

/* Header */
.app-switcher-popup .popup-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem .6rem;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--card); z-index: 2;
}
[data-theme="dark"] .app-switcher-popup .popup-header { background: #1e293b; }
[data-theme="orange"] .app-switcher-popup .popup-header { background: rgba(0,0,0,.2); }
.app-switcher-popup .popup-title { font-weight: 700; font-size: .88rem; flex:1; }
.app-switcher-popup .close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .9rem; padding: 4px;
  border-radius: 6px; transition: background .1s;
}
.app-switcher-popup .close-btn:hover { background: var(--bg); }

/* Zoekbalk */
.app-search-bar {
  display: flex; align-items: center; gap: .4rem;
  margin: .6rem 1rem;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .35rem .65rem;
  transition: border-color .15s;
}
.app-search-bar:focus-within { border-color: var(--brand); }
.app-search-bar input {
  border: none; background: transparent; outline: none;
  font-size: .8rem; color: var(--text); width: 100%;
}

/* Sectie label */
.app-section-label {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
  padding: .45rem 1rem .2rem;
}

/* Compact grid — 4 per rij */
.app-popup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: .25rem .6rem .5rem;
}

/* Tile */
.app-popup-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: .55rem .35rem .45rem;
  border-radius: 10px; cursor: pointer;
  text-decoration: none; color: var(--text);
  transition: background .1s; text-align: center;
  position: relative;
}
.app-popup-tile:hover { background: var(--bg); color: var(--text); text-decoration: none; }
[data-theme="dark"] .app-popup-tile:hover { background: #334155; }
[data-theme="orange"] .app-popup-tile:hover { background: rgba(255,255,255,.08); }

.app-popup-tile .tile-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  transition: transform .1s;
}
.app-popup-tile:hover .tile-icon { transform: scale(1.08); }
.app-popup-tile .tile-naam {
  font-size: .64rem; font-weight: 500;
  line-height: 1.25; max-width: 72px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; width: 100%;
}

/* Ster favoriet knop */
.tile-fav {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: 4px;
  background: none; border: none; cursor: pointer;
  font-size: .65rem; color: var(--muted);
  display: none; align-items: center; justify-content: center;
  padding: 0; transition: color .1s;
  z-index: 1;
}
.app-popup-tile:hover .tile-fav { display: flex; }
.tile-fav.is-fav { display: flex; color: #f59e0b; }
.tile-fav:hover { color: #f59e0b; }

/* Favoriet-tile iets lichter accentuatie */
.app-popup-tile.is-fav { background: rgba(245,158,11,.05); }

/* Lege zoekresultaten */
.app-no-results { text-align: center; padding: 1.5rem; color: var(--muted); font-size: .82rem; }

/* Overlay achter popup */
.popup-overlay { position: fixed; inset: 0; z-index: 499; display: none; }
.popup-overlay.open { display: block; }

/* ── Context sidebar — verberg alle items buiten actieve app ─────────────── */
.nav-ctx-item { transition: opacity .15s, max-height .2s; }

/* Sidebar items altijd 13px, nooit overflow */
.menu-item { font-size: 13px !important; white-space: nowrap; overflow: hidden; }


/* Context nav separator + label */
.nav-ctx-separator {
  padding: .6rem 14px .2rem;
  display: flex;
  align-items: center;
}
.menu-ctx-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.nav-ctx-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 8px;
}
.sidebar.collapsed .nav-ctx-separator { display: none; }

