/* ====== BASIS LAYOUT ====== */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* voorkom scroll globaal */
}


*, *::before, *::after {
  box-sizing: border-box;
}

main {
  height: calc(100vh - 140px); /* header + footer = 140px */
  overflow-y: auto;
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem;
  box-sizing: border-box;
}


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

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  margin-top: 10px; /* Meer ruimte boven header */
}

.company-logo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.company-info h1,
.employees-header,
.employees-title {
  margin-top: 10px;  /* Zelfde marge boven alle titels */
  margin-bottom: 10px; /* Optionele ruimte onder */
  padding-top: 0;
  font-size: 1.5em;
}

/* ====== BUTTONS & LINKS ====== */

.top-actions {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

/* Algemeen voor knoppen en links met grijstinten en zwart */
.btn-link,
button {
  border: 1px solid #333;
  border-radius: 6px;
  background: none;
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  color: #222;
  font-size: 1em;
  font-weight: 400;
  transition: background-color 0.3s, color 0.3s;
}

.btn-link:hover,
button:hover,
.btn-link:focus,
button:focus {
  background: #222; /* donkergrijs / zwart */
  color: #fff;
  outline: none;
}

/* Specifieke knop voor "+ toevoegen" */
.add-item-btn {
  display: block;
  margin-bottom: 12px;
  text-align: left;
  width: fit-content;
  font-weight: 300;
  font-size: 1em;
}

/* ====== DASHBOARD LAYOUT ====== */

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  flex-grow: 1;
  min-height: 0; /* Belangrijk voor child scroll */
}

/* ====== BEDRIJVEN ========== */

.companies-row {
  max-height: 30vh;
  min-height: 200px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  padding: 12px 20px 20px 20px; /* Gelijke padding-top als list-panel */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.bedrijf-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 12px !important;
  box-sizing: border-box;
  cursor: pointer;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.bedrijf-card:hover,
.bedrijf-card:focus {
  background-color: #f0f4ff;
  outline: none;
}

.bedrijf-card img {
  width: 32px !important;
  height: 32px !important;
  object-fit: cover !important;
  border-radius: 5px !important;
  flex-shrink: 0 !important;
}

.bedrijf-card strong,
.bedrijf-card small {
  white-space: nowrap;
  flex-shrink: 0;
}

.bedrijven-grid {
  flex-grow: 1; /* Neemt de resterende ruimte */
  display: flex;
  gap: 16px;
  overflow-y: auto; /* Scroll als content groter is dan kader */
  margin-top: 12px;
  box-sizing: border-box;
}

.bedrijven-grid > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.bewerk-btn {
  margin-left: auto !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#bedrijven-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}

.companies-row ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.companies-row li {
  background: #fafafa;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.18s;
}

.companies-row li:hover {
  background-color: #eee;
}

/* ====== DATA PANELEN ====== */

/* Uniform spacing boven alle sectie-titels */
.dashboard-container h3,
.list-panel h3,
.companies-row > div > h3 {
  margin-top: 0;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 1.2rem;
  color: #222;
  padding-top: 0;
  line-height: 1.3;
}

.data-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  height: 100%; /* Vul hele beschikbare hoogte binnen main */
  min-height: 0; /* Belangrijk voor scroll in flex container */
  overflow: hidden; /* Zorg dat inhoud niet buiten naar beneden groeit */
  flex-grow: 1;
  box-sizing: border-box;
}

.list-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px 20px 20px 20px; /* Zelfde padding-top als bedrijven-row */
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%; /* Vul hele grid cel */
  min-height: 0;
  overflow: hidden; /* Voorkomt overflow van content */
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.list-panel ul {
  flex-grow: 1;
  overflow-y: auto; /* Scroll in lijst zelf */
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
}

.list-panel > button.btn-link {
  display: block;
  margin-bottom: 12px;
  text-align: left;
  width: fit-content;
  font-weight: 600;
  font-size: 1em;
}

/* ====== LIJSTITEMS ====== */

.list-item {
  background: #fafafa;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background-color 0.18s;
  min-width: 0;
  word-break: break-word;
  width: 100%;
}

.list-item:hover,
.list-item.active {
  background-color: #eee;
}

/* ====== INHOUD LIJSTITEM ====== */

.list-item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-item-content img,
.list-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #ececec;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  margin-right: 6px;
}

/* ====== POPUP OVERLAY ====== */

#detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 0;
  overflow: auto;
}

#detail-content {
  background: #fff;
  padding: 25px 32px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.33);
  max-width: 80vw;
  max-height: 80vh;
  min-width: 320px;
  width: 80vw;
  height: 80vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

#close-detail {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #d33; /* Rode sluitknop */
  color: white;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 1em;
  z-index: 10;
  transition: background-color 0.25s;
}

#close-detail:hover,
#close-detail:focus {
  background: #a22;
  outline: none;
}

#detail-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.popup-top-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 8px;
}

.popup-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: #ececec;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  flex-shrink: 0;
}

.popup-info-block {
  flex: 1;
}

.popup-info-block p {
  margin: 4px 0;
  word-break: break-word;
}

.popup-title {
  font-size: 1.25em;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.popup-actions-row {
  display: flex;
  gap: 10px;
  margin: 0 0 10px 0;
}

.popup-actions-row .btn-link,
.popup-actions-row button {
  flex: 0 0 auto;
  text-align: center;
  border: 1px solid #333;
  border-radius: 6px;
  background: none;
  padding: 7px 16px;
  cursor: pointer;
  color: #222;
  text-decoration: none;
  transition: background-color 0.18s;
}

.popup-actions-row .btn-link:hover,
.popup-actions-row button:hover {
  background: #222;
  color: white;
}

.popup-chart-title {
  font-size: 1.2em;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #222;
  line-height: 1.2;
}

#scan-total-placeholder {
  font-size: 0.7em;
  font-weight: 500;
  margin-bottom: 7px;
  color: #444;
  display: block;
}

.scan-filter-buttons {
  display: flex;
  gap: 8px;
  margin: 0 0 12px 0;
}

.scan-filter-buttons button {
  flex: 0 0 auto;
  padding: 7px 16px;
  border: 1px solid #555;
  border-radius: 5px;
  background-color: #f8f8f8;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.18s;
}

.scan-filter-buttons button.active {
  background-color: #222;
  color: #fff;
}

.popup-chart-container {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0;
  height: 100%;
}

canvas#scan-chart {
  flex: 1 1 0%;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: block;
  background: #fafaff;
  border-radius: 7px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

/* ====== FORMULIEREN MET GRIJSTINTEN & ZWART ====== */

.form-container {
  max-width: 480px;
  margin: 20px auto;
  padding: 20px 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  max-height: 90vh;    /* scroll trigger */
  overflow-y: auto;    /* scroll indien nodig */
}

.form-container h2 {
  font-weight: 700;
  font-size: 1.5rem;
  color: #222;
  text-align: center;
  margin-bottom: 20px;
}

.form-container form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-container label {
  font-weight: 600;
  font-size: 1rem;
  color: #222;
  margin-bottom: 0px;
}

.form-container input,
.form-container select,
.form-container textarea {
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #aaa;
  box-sizing: border-box;
  background: #fff;
  color: #222;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-container input:focus,
.form-container select:focus,
.form-container textarea:focus {
  border-color: #555;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
  outline: none;
}

.form-container button {
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background-color: #444; /* donkergrijs */
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.form-container button:hover,
.form-container button:focus {
  background-color: #222; /* bijna zwart */
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  outline: none;
}

.form-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: #555;
}

.form-footer a {
  color: #222;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s;
}

.form-footer a:hover,
.form-footer a:focus {
  color: #000;
  text-decoration: underline;
}

.login-container {
  width: 30vw;
  max-width: 400px;
  margin: 40px auto;
  padding: 30px 25px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-family: 'Inter', sans-serif;
}

.login-container h2 {
  text-align: center;
  font-weight: 700;
  color: #1890ff;
  margin-bottom: 30px;
  font-size: 1.6rem;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-container label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.login-container input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 22px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s;
  background: #fff;
  color: #222;
}

.login-container input:focus {
  border-color: #1890ff;
  outline: none;
}

.login-container button {
  width: 100%;
  padding: 14px 0;
  background-color: #1890ff;
  border: none;
  color: white;
  border-radius: 6px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24,144,255,0.5);
  transition: background-color 0.3s;
  margin-bottom: 0;
}

.login-container button:hover,
.login-container button:focus {
  background-color: #0f69d9;
  outline: none;
}


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

@media (max-width: 600px) {
  /* Alleen het bedrijfslogo en naam tonen in bedrijvenlijst mobiel */
  .bedrijven-grid .bedrijf-card small,
  .bedrijven-grid .bedrijf-card .extra-info {
    display: none !important;
  }
  .bedrijven-grid .bedrijf-card strong,
  .bedrijven-grid .bedrijf-card img {
    display: block !important;
  }

  /* Basis scrollbaarheid */
  html, body {
    height: auto !important;
    overflow: auto !important;
  }

  main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 10px !important;
    height: auto !important;
    overflow: visible !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box;
  }

  /* Login container breder maken en gepaste marges */
  .login-container {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 20px auto !important;
    padding: 20px 15px !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    background-color: #fff !important;
  }

  .login-container input,
  .login-container button {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .login-container h2 {
    font-size: 1.6rem !important;
    margin-bottom: 24px !important;
    text-align: center !important;
    font-weight: 700 !important;
    color: #1890ff !important;
  }

  .login-container input {
    font-size: 1.1rem !important;
    padding: 14px 16px !important;
    margin-bottom: 20px !important;
    border-radius: 6px !important;
    border: 1px solid #ccc !important;
  }

  .login-container button {
    font-size: 1.2rem !important;
    padding: 14px 0 !important;
    border-radius: 7px !important;
    background-color: #1890ff !important;
    color: white !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(24, 144, 255, 0.5) !important;
    transition: background-color 0.3s ease !important;
  }

  .login-container button:hover,
  .login-container button:focus {
    background-color: #0f69d9 !important;
    outline: none !important;
  }

  .dashboard-container {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    flex-direction: column !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  /* Data-rij & panelen */
  .data-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box;
  }

  /* Tab containers gelijke padding & scroll */
  .companies-row,
  .list-panel {
    padding-top: 12px;
    flex: 1 1 0 !important;
    min-height: 40vh !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box;
  }

  .list-panel ul,
  .bedrijven-grid {
    flex-grow: 1 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 10px !important;
  }

  .bedrijven-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .bedrijven-grid > div {
    width: 100% !important;
    box-sizing: border-box;
    flex-direction: row !important;
    gap: 12px !important;
  }

  #bedrijven-grid-container {
    display: flex !important;
    flex-direction: column !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
  }

  #bedrijven-grid-container > div {
    width: 100% !important;
    box-sizing: border-box;
  }

  .bedrijf-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px !important;
    font-size: 1em !important;
    cursor: pointer;
    width: 100% !important;
    box-sizing: border-box;
    gap: 12px !important;
  }

  .bedrijf-card img {
    width: 32px !important;
    height: 32px !important;
    margin-right: 10px !important;
    border-radius: 5px !important;
    flex-shrink: 0;
  }

  .bedrijf-card strong,
  .bedrijf-card small {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .bewerk-btn {
    margin-left: auto !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 600px) {
  #detail-content {
    width: 95vw !important;
    max-width: 95vw !important;
    height: 50vh !important;
    max-height: 50vh !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    border: 1px solid #e3e3e3 !important;
    background: #fff !important;
    box-shadow: 0 6px 24px rgba(30,40,90,0.085) !important;
    overflow-y: auto !important;
    box-sizing: border-box;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    display: flex;
    flex-direction: column;
  }

  #detail-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 4vw !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    flex-grow: 1;
    overflow: visible;
  }

  .popup-top-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
    flex-shrink: 0;
  }

  .popup-logo {
    width: 60px !important;
    height: 60px !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    margin: 0 0 4px 0 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    flex-shrink: 0;
  }

  /* TITEL & GRAFIEK TITEL: groot, vet */
  .popup-title,
  .popup-chart-title {
    font-size: 1em !important;
    font-weight: 600 !important;
    color: #444 !important;
    margin-bottom: 3px !important;
    text-align: left !important;
    width: 100% !important;
    line-height: 1.25 !important;
    word-break: break-word;
  }

  /* INFO EN TOTAAL SCANS: kleiner, niet vet */
  .popup-info-block,
  .popup-info-block p,
  .popup-info-block small,
  #scan-total-placeholder {
    font-size: 1em !important;
    font-weight: 400 !important;
    color: #555 !important;
    margin-bottom: 5px !important;
    text-align: left !important;
    width: 100% !important;
    line-height: 1.4 !important;
    word-break: break-word;
  }
  /* NIET .popup-info-block div! */

  .popup-info-block { margin-bottom: 8px !important; }
  #scan-total-placeholder { margin-bottom: 8px !important; }

  .popup-actions-row,
  .scan-filter-buttons {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  .popup-actions-row .btn-link,
  .popup-actions-row button,
  .scan-filter-buttons button {
    padding: 3px 7px !important;
    font-size: 0.95em !important;
    line-height: 1.2 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    text-align: center !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 0 !important;
    width: auto !important;
    height: 30px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #ddd !important;
    background: #f9fafd !important;
    color: #444 !important;
    font-weight: 400 !important;
    transition: background 0.15s, color 0.15s, border 0.15s;
  }
  .popup-actions-row .btn-link:hover,
  .popup-actions-row button:hover,
  .scan-filter-buttons button:hover,
  .popup-actions-row .btn-link:focus,
  .popup-actions-row button:focus,
  .scan-filter-buttons button:focus {
    background: #1e9aff !important;
    color: #fff !important;
    border-color: #1e9aff !important;
    outline: none !important;
  }

  .popup-chart-container {
    flex: 1 1 auto !important;
    min-height: calc(50vh - 40px) !important; /* meer ruimte voor grafiek! */
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  canvas#scan-chart {
    width: 100% !important;
    height: 100% !important;
    min-height: calc(50vh - 40px) !important;
    display: block;
    border-radius: 10px;
    margin: 0;
    background: #fcfdfe;
  }
}

@media (max-width: 600px) {
  .popup-info-block,
  .popup-info-block p,
  .popup-info-block small,
  #scan-total-placeholder {
    font-size: 1em !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    color: #555 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
    word-break: break-word;
  }
}

@media (max-width: 600px) {
  .form-container {
    width: 100%;
    max-width: 480px;
    margin: 20px auto; /* 20px boven en onder, automatisch links en rechts voor centrering */
    padding: 14px 3vw;
    font-size: 1rem;
    box-sizing: border-box;
  }

  .form-container h2 { /* optioneel: zelfde breedte en centrering */
    font-size: 1.15rem;
    margin-bottom: 12px;
    font-weight: 700;
    width: 100%;
    box-sizing: border-box;
  }

  .form-container label {
    font-size: 0.99rem;
    margin-bottom: 0px;
    width: 100%;
    box-sizing: border-box;
  }

  .form-container input,
  .form-container select,
  .form-container textarea {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    padding: 13px 10px;
    margin-bottom: 4px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
  }

  .form-container button {
    font-size: 1rem;
    padding: 15px 0;
    border-radius: 12px;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
    font-weight: 700;
    background: #444;
    color: #fff;
    border: none;
  }
}

header {
  background-color: #222;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  user-select: none;
}

/* Links: logo en welkomstekst */
header .left-section a,
header .left-section div {
  margin-right: 1rem;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 70px;
  width: auto;
  margin-right: 12px;
}

.logo-text {
  display: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  cursor: default;
  user-select: none;
  margin-right: 12px;
  white-space: nowrap;
}

/* Terug knop rechts */
nav .back-button {
  color: white;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  margin-right: 10px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

nav .back-button:hover,
nav .back-button:focus {
  background: rgba(255, 255, 255, 0.3);
  outline: none;
}

/* Uitloggen knop */
nav .logout-btn {
  background: linear-gradient(90deg, #40a9ff 0%, #0077b6 100%);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 24px;
  font-weight: 600;
  text-decoration: none;
  margin-left: 1rem;
  box-shadow: 0 2px 8px rgba(64, 169, 255, 0.15);
  transition: background 0.3s, box-shadow 0.3s;
  display: inline-block;
}

nav .logout-btn:hover {
  background: linear-gradient(90deg, #0077b6 0%, #40a9ff 100%);
  box-shadow: 0 4px 16px rgba(64, 169, 255, 0.25);
  color: #fff;
}

/* Mobiel: logo tekst tonen i.p.v. logo afbeelding */
@media (max-width: 600px) {
  .logo-img {
    display: none;
  }

  .logo-text {
    display: block;
    color: white;
  }
}

/* Tooltip dynamische breedte en dynamisch scrollbalk verbergen */
.tooltip {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(25px);
  background: #2a9d8f;
  color: #eee;
  padding: 1rem 1.5rem;
  width: 90vw;              /* dynamisch: 90% viewportbreedte */
  max-width: 300px;         /* max breedte */
  min-width: 180px;         /* min breedte */
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 11;
  box-sizing: border-box;
  scrollbar-width: none; /* Firefox scrollbar verbergen */
  -ms-overflow-style: none; /* IE & Edge scrollbar verbergen */
}

/* Webkit browsers scrollbar verbergen */
.tooltip::-webkit-scrollbar {
  display: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent #2a9d8f transparent;
}

.stat-card:hover .tooltip,
.stat-card:focus .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Globale scrollbar verbergen (voor modals en andere scrollable) */
::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
@media (max-width: 600px) {
  header,
  nav {
    flex-wrap: wrap;           /* Elementen kunnen naar een nieuwe regel */
    gap: 8px;
  }

  nav .logout-btn {
    margin-left: 0;
    width: 100%;               /* Volledige breedte op kleine schermen */
    box-sizing: border-box;
    text-align: center;
  }
  
  /* Optioneel: center alignment van header links op kleine schermen */
  header .left-section,
  nav {
    justify-content: center;
    width: 100%;
  }
}
