/**
 * Daisy - Modern CSS
 *
 * Clean, modern design with hover effects and responsive layout
 * No green text for corrections (v2 has direct editing!)
 */

/* ========== FONTS ========== */

@font-face {
  font-family: 'Maax';
  src: url('../assets/Fonts/Maax.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Maax';
  src: url('../assets/Fonts/Maax-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Maax';
  src: url('../assets/Fonts/Maax-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Maax';
  src: url('../assets/Fonts/Maax-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'Maax';
  src: url('../assets/Fonts/Maax-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

/* ========== GLOBAL ========== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ET Elektrotechniek Theme - Rood/Zwart/Grijs/Wit (Light Mode) */
  /* --hoofdkleur* wordt ALLEEN door theme.js gezet (bedrijfsinstellingen);
     zonder ingestelde kleur vallen alle var()-fallbacks terug op exact de
     huidige ET-rood-waarden — bewust nergens in CSS gedefinieerd */
  --primary-color: var(--hoofdkleur, #DC1F26);
  --primary-hover: var(--hoofdkleur-hover, #B91A20);
  --primary-dark: var(--hoofdkleur-donker, #C82333);      /* Voor gradients en hover states */
  --secondary-color: #1A1A1A;
  --success-color: #2E7D32;
  --success-light: #C8E6C9;
  --danger-color: #DC1F26;
  --danger-red: #DC3545;        /* Bootstrap danger red */
  --danger-light: #f8d7da;
  --warning-color: #FFA726;
  --warning-orange: #FF9800;    /* Orange warning */
  --warning-light: #FFF9C4;
  --info-color: var(--info-color);        /* Info blue */
  --info-light: #64B5F6;        /* Light info blue */
  --info-bg: #E3F2FD;           /* Info background */
  --text-primary: #1A1A1A;
  --text-secondary: #757575;
  --text-dark: #333333;         /* Dark text for headings */
  --text-muted: #666666;        /* Muted text */
  --text-muted-light: #999999;  /* Lighter muted text */
  --bg-gray: #F5F5F5;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;           /* Voor card backgrounds */
  --bg-light: #F8F9FA;          /* Light background */
  --bg-light-gray: #E9ECEF;     /* Light gray background */
  --bg-hover: #FAFAFA;          /* Hover state background */
  --border-color: #E0E0E0;
  --border-light: #DDDDDD;      /* Lighter border */
  --border-dark: #CED4DA;       /* Darker border */
  --hover-bg: var(--hoofdkleur-tint, #FFEBEE);
  --gradient-1: #667eea;        /* For gradient backgrounds */
  --gradient-2: #764ba2;        /* For gradient backgrounds */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

/* Dark Mode Theme */
body.dark-mode {
  --primary-color: var(--hoofdkleur, #DC1F26);
  --primary-hover: var(--hoofdkleur-hover-dark, #FF3B42);
  --primary-dark: var(--hoofdkleur-hover, #B91A20);      /* Donkerder in dark mode */
  --secondary-color: #E0E0E0;
  --success-color: #4CAF50;
  --success-light: #1B5E20;
  --danger-color: #FF5252;
  --danger-red: #FF6B6B;        /* Bootstrap danger red - lighter in dark mode */
  --danger-light: #6f2626;
  --warning-color: #FFB74D;
  --warning-orange: #FFB74D;    /* Orange warning */
  --warning-light: #5d4a0a;
  --info-color: #64B5F6;        /* Info blue - lighter in dark mode */
  --info-light: #90CAF9;        /* Light info blue */
  --info-bg: #1A237E;           /* Info background - dark blue */
  --text-primary: #E0E0E0;
  --text-secondary: #B0B0B0;
  --text-dark: #E0E0E0;         /* In dark mode, "dark" text is light */
  --text-muted: #9E9E9E;        /* Muted text */
  --text-muted-light: #757575;  /* Lighter muted text */
  --bg-gray: #2a2a2a;
  --bg-white: #1E1E1E;
  --bg-card: #252525;           /* Iets lichter dan bg-white voor cards */
  --bg-light: var(--bg-gray);          /* Light background - same as bg-gray */
  --bg-light-gray: #333333;     /* Light gray background */
  --bg-hover: #333333;          /* Hover state background */
  --border-color: #333333;
  --border-light: #444444;      /* Lighter border */
  --border-dark: #555555;       /* Darker border (lighter in dark mode) */
  --hover-bg: var(--hoofdkleur-tint-dark, #2A0A0C);
  --gradient-1: #667eea;        /* For gradient backgrounds */
  --gradient-2: #764ba2;        /* For gradient backgrounds */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.5);
}

body {
  font-family: 'Maax', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-gray);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

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

.page-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--bg-white);
  padding: 23px 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  min-height: 85px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: start;
}

.page-icon {
  font-size: 36px;
  line-height: 1;
}

.header-left h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  position: relative;
  height: 1px;
  overflow: visible;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  pointer-events: none;
  z-index: 1;
}

.daisy-logo {
  width: 130px;
  height: 130px;
  object-fit: contain;
  transform: translateY(-35%);
  pointer-events: auto;
  transition: filter 0.2s, transform 0.2s;
}

.version-badge {
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: end;
}

.settings-icon {
  font-size: 24px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
}

.settings-icon:hover {
  color: var(--primary-color);
  background: var(--bg-gray);
}

.count-badge {
  background: var(--bg-gray);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== NAVIGATION MENU ========== */

.nav-menu {
  background: var(--bg-white);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  position: relative;
  z-index: 11;
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
}

.nav-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted-light);
  margin-right: 15px;
  flex-shrink: 0;
  transition: background 0.3s;
}

.nav-status-indicator.online {
  background: var(--success-color);
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.nav-status-indicator.offline {
  background: var(--primary-color);
  box-shadow: 0 0 8px rgba(var(--hoofdkleur-rgb, 220, 31, 38), 0.5);
}

.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-gray);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-link.active {
  background: var(--primary-color);
  color: white;
}

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

  .nav-link {
    justify-content: center;
  }
}

/* ========== BUTTONS ========== */

button, .btn-primary, .btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

/* ⚠️ Deze regel maakt ELKE <button> Daisy-rood. De :not()-ketting is de manier
   waarop een eigen knop zich eruit meldt — een gewone klasse volstaat niet: de
   ketting draagt specificiteit (0,14,1) en verslaat dus `.blok .mijn-knop`.
   Nieuwe knop met eigen uiterlijk = klasse hier toevoegen. (.afspraak-rij: P176,
   het portaal-blok "Mijn afspraken"; kwam anders rood-op-rood uit.) */
.btn-primary, button:not(.btn-secondary):not(.delete-btn):not(.modal-close):not(.btn-nav):not(.materialen-btn):not(.tool-btn):not(.symbolen-tab):not(.uitvoerder-toggle):not(.peppol-btn):not(.creditnota-btn):not(.reset-btn):not(.email-tool-btn):not(.archief-tab):not(.btn-tarief):not(.tab-btn):not(.afspraak-rij):not(.deel-tab):not(.deel-actie):not(.opdracht-dropdown-deel-btn):not(.btn-annuleer-deel):not(.deel-form-terug-btn):not(.cad-knop):not(.status-herstel) {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: var(--text-muted);
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  margin: 0 2px;
}

.btn-small.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-small.btn-danger:hover {
  background: var(--primary-dark);
}

.btn-small.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-small.btn-secondary:hover {
  background: var(--text-muted);
}

/* Export Historiek Section */
.export-historiek-section {
  margin-top: 20px;
}

.export-historiek-section .table-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-white);
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
}

.export-historiek-section .table-section-header h3 {
  margin: 0;
  font-size: 16px;
}

.btn-nav {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 18px;
}

.btn-nav:hover {
  background: var(--hover-bg);
}

.delete-btn {
  background: var(--danger-color);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 16px;
}

.delete-btn:hover {
  background: var(--danger-color);
}

/* ========== FILTERS ========== */

.filters-section {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.filter-group input,
.filter-group select {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ========== TABLE ========== */

.table-container {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  /* Allow dropdowns to overflow */
  position: relative;
}

/* Ensure table cells with dropdowns can overflow */
.data-table td {
  position: relative;
  overflow: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-gray);
}

.data-table th {
  padding: 15px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  background: var(--border-color);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table td {
  padding: 12px;
  font-size: 14px;
}

/* Order grouping styles */
.data-table tbody tr.order-header-row {
  background: var(--bg-light);
  border-top: 2px solid var(--border-light);
  font-weight: 600;
}

.data-table tbody tr.order-header-row:hover {
  background: var(--bg-light);
}

.order-header-row td.order-info {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
}

.product-row {
  background: var(--bg-card, white);
}

.product-row td {
  padding-left: 24px; /* Slight indent for products */
}

.product-row:hover {
  background: var(--bg-hover);
}

.order-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.row-checkbox {
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.datum-cell {
  font-weight: 500;
  white-space: nowrap;
}

.netto-uren {
  font-weight: bold;
  color: var(--success-color);
  background-color: var(--success-light);
}

/* ========== EDITABLE FIELDS V2 ========== */

.editable-field-v2 {
  display: inline-block;
  position: relative;
}

.editable-field-v2 .field-value {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.2s;
  display: inline-block;
  min-width: 40px;
}

.editable-field-v2 .field-value:hover {
  background-color: var(--hover-bg);
  text-decoration: underline;
}

.editable-field-v2 .field-input {
  padding: 4px 8px;
  border: 2px solid var(--primary-color);
  border-radius: 3px;
  font-size: 14px;
  min-width: 60px;
}

.editable-field-v2 .field-input:focus {
  outline: none;
  border-color: var(--primary-hover);
}

.editable-field-v2 .field-loader {
  font-size: 16px;
  animation: spin 1s linear infinite;
}

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

/* ========== LOADING & ERRORS ========== */

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  background: var(--bg-white);
  border-radius: 8px;
  margin: 20px 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-message {
  background: var(--hover-bg);
  color: var(--danger-color);
  padding: 15px 20px;
  border-radius: 8px;
  border-left: 4px solid var(--danger-color);
  margin: 20px 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 16px;
}

/* ========== MODAL ========== */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background: var(--bg-white);
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ========== MATERIALEN ========== */

/* Materialen modal - groter dan standaard modal */
#materialen-modal .modal-content {
  max-width: 900px;
  width: 95%;
}

.materialen-btn {
  background: var(--warning-color);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.materialen-btn:hover {
  background: var(--warning-orange);
}

.materialen-list {
  padding: 20px;
}

.materiaal-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.mat-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card, white);
  padding: 2px;
  flex-shrink: 0;
}

.mat-info {
  display: flex;
  gap: 15px;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
}

.mat-code {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 120px;
}

.mat-naam {
  flex: 1;
  min-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mat-eenheid {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.mat-qty {
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* Opmerking indicator voor tijdsregistraties */
.opmerking-indicator {
  cursor: help;
  color: var(--warning-orange);
  font-size: 1.1em;
  position: relative;
}

/* Custom tooltip voor opmerkingen */
.opmerking-tooltip {
  position: fixed;
  background: var(--text-dark);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 400px;
  white-space: pre-wrap;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
  line-height: 1.5;
}


/* ========== WEEK OVERZICHT ========== */

.week-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.week-inputs {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group input,
.input-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.week-info {
  text-align: center;
  margin-bottom: 30px;
}

.week-info h2 {
  font-size: 24px;
  margin-bottom: 5px;
}

.date-range {
  color: var(--text-secondary);
  font-size: 14px;
}

.week-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.uitvoerder-card {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
}

.card-header h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.card-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.stat {
  font-size: 14px;
  opacity: 0.9;
}

.card-content {
  padding: 20px;
}

.empty-msg {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.dag-section {
  margin-bottom: 20px;
}

.dag-header {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.opdracht-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-gray);
  border-radius: 4px;
  margin-bottom: 8px;
}

.opdracht-klant {
  font-weight: 600;
  flex: 1;
}

.opdracht-werf {
  color: var(--text-secondary);
  font-size: 13px;
}

.opdracht-uren {
  font-weight: 600;
  color: var(--success-color);
}

.opdracht-reis {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ========== TOTALS ========== */

.totals-section {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.totals-section h3 {
  margin-bottom: 15px;
  font-size: 20px;
}

.week-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.total-card {
  background: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.total-label {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 8px;
}

.total-value {
  font-size: 32px;
  font-weight: bold;
}

/* ========== TABS ========== */

.tab-navigation {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--bg-gray);
}



/* ========== DAISY TABS (standaard component) ========== */

.daisy-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #dee2e6);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.daisy-tabs .tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary, #6c757d);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.daisy-tabs .tab-btn:hover {
  color: var(--primary-color);
  background: rgba(220, 53, 69, 0.04);
}

.daisy-tabs .tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.daisy-tabs .tab-btn .badge {
  background: var(--bg-gray, #e9ecef);
  color: var(--text-secondary, #6c757d);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.daisy-tabs .tab-btn.active .badge {
  background: rgba(220, 53, 69, 0.1);
  color: var(--primary-color);
}
/* --- Pill variant --- */

.daisy-tabs.pill {
  border-bottom: none;
  background: var(--bg-gray, #f1f3f5);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.daisy-tabs.pill .tab-btn {
  border-bottom: none;
  margin-bottom: 0;
  border-radius: 6px;
  padding: 10px 20px;
  color: var(--text-primary, #495057);
  background: transparent;
}

.daisy-tabs.pill .tab-btn:hover {
  background: var(--bg-light-gray, #e9ecef);
  color: var(--text-primary, #495057);
}

.daisy-tabs.pill .tab-btn.active {
  background: var(--primary-color);
  color: white;
  border-bottom-color: transparent;
}

.daisy-tabs.pill .tab-btn.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* --- Pill dark mode --- */

body.dark-mode .daisy-tabs.pill {
  background: var(--bg-card, #2a2a2a);
}

body.dark-mode .daisy-tabs.pill .tab-btn {
  color: var(--text-secondary, #adb5bd);
  background: transparent;
}

body.dark-mode .daisy-tabs.pill .tab-btn:hover {
  background: var(--bg-gray, #333);
  color: var(--text-primary, #e0e0e0);
}

body.dark-mode .daisy-tabs.pill .tab-btn.active {
  background: var(--primary-color);
  color: white;
}

/* ========== TIMELINE =========== */

.timeline-controls {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.timeline-help {
  background: var(--bg-white);
  padding: 15px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-width: 400px;
}

.timeline-filter {
  background: var(--bg-white);
  padding: 15px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.timeline-filter label {
  font-weight: 600;
  white-space: nowrap;
}

.werknemer-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-white);
  font-size: 14px;
  cursor: pointer;
  min-width: 150px;
}

.werknemer-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.timeline-help p {
  margin-bottom: 10px;
  font-weight: 600;
}

.legend-items {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.week-header-multi {
  background: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  margin: 30px 0 15px 0;
  box-shadow: var(--shadow-sm);
}

.week-header-multi:first-child {
  margin-top: 0;
}

.week-header-multi h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.timeline-section {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 15px;
  overflow: hidden;
}

.timeline-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
}

.timeline-header h3 {
  margin: 0;
  font-size: 18px;
}

.timeline-grid {
  padding: 20px;
  overflow-x: auto;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.timeline-table th {
  background: var(--bg-gray);
  padding: 8px;
  text-align: center;
  font-weight: 600;
  border: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-table th.time-col {
  width: 60px;
  background: var(--bg-gray);
}

.timeline-table th.day-col {
  min-width: 120px;
}

.timeline-table td {
  border: 1px solid var(--border-color);
  padding: 4px;
  text-align: center;
  vertical-align: middle;
  height: 30px;
}

.timeline-table td.time-cell {
  background: var(--bg-gray);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
  position: sticky;
  left: 0;
  z-index: 5;
}

.timeline-table td.timeline-cell {
  position: relative;
  font-size: 11px;
  padding: 2px;
  max-width: 120px;
  overflow: visible;  /* Allow tooltip to show */
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-table td.timeline-cell.first-slot {
  border-top: 2px solid var(--text-dark);
  font-weight: 600;
}

.timeline-table td.timeline-cell.travel-slot {
  opacity: 0.7;
  font-style: italic;
}

.status-indicator {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 10px;
  font-weight: bold;
  color: var(--text-dark);
}

.cell-info {
  font-size: 9px;
  color: var(--text-dark);
  margin-top: 2px;
  font-weight: 600;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ========== PRESTATIES ========== */

.prestaties-controls {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.controls-row {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  margin-bottom: 15px;
}

.controls-row:last-child {
  margin-bottom: 0;
}

.periode-info {
  text-align: center;
  margin-bottom: 30px;
}

.periode-info h2 {
  font-size: 22px;
  color: var(--text-secondary);
}

.prestaties-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.prestatie-card {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.prestatie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background: var(--bg-gray);
  border-radius: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.stat-value.highlight {
  color: var(--success-color);
}

.klanten-section {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.klanten-list {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ========== MAIN INDEX ========== */

.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 60px 30px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}

.hero-section h1 {
  font-size: 48px;
  margin-bottom: 15px;
}

.hero-section p {
  font-size: 18px;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.module-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.module-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.module-card h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.module-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 15px;
}

.module-features {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.module-features li {
  padding: 5px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.module-features li::before {
  content: "✓ ";
  color: var(--success-color);
  font-weight: bold;
  margin-right: 5px;
}

/* ========== FOOTER ========== */

.page-footer {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-top: 40px;
}

.page-footer p {
  margin: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.version-info {
  font-size: 12px;
  color: var(--text-muted-light);
}

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

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 15px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .week-selector {
    flex-direction: column;
  }

  .week-content {
    grid-template-columns: 1fr;
  }

  .prestaties-content {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== AANKOPEN MODULE ========== */

.aankopen-section {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.aankopen-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(to right, var(--bg-gray), var(--bg-white));
  border-bottom: 2px solid var(--border-color);
}

.aankopen-section .section-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.aankopen-section .section-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.aankopen-section .section-controls select {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 14px;
}

/* Facturen zoek-in-alles box */
.facturen-search-box {
  display: flex;
  gap: 4px;
  align-items: center;
}

.facturen-search-box input {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
}

.facturen-search-box input:focus {
  outline: none;
  border-color: var(--info-color);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.facturen-search-box button {
  padding: 6px 12px;
  background: var(--info-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.facturen-search-box button:hover {
  background: var(--info-color);
}

/* Aankoopfacturen section fills remaining space */
.aankoopfacturen-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.aankoopfacturen-section .table-container {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: auto;
  max-height: 500px;
}

/* Afhalingen/Bestellingen auto-height */
.aankopen-section:not(.aankoopfacturen-section) .table-container {
  max-height: 400px;
  overflow-y: auto;
}

/* Zorgen dat dropdowns niet worden afgeknipt door overflow (alleen aankopen) */
.aankopen-section .table-container {
  /* Allow dropdowns to escape on aankopen page */
  contain: none;
}

/* Disabled columns styling */
.table .disabled-col {
  background: var(--bg-gray);
  color: var(--text-muted-light);
}

/* Table row background colors */
#afhalingen-section tbody tr {
  background: var(--info-bg);
}

#afhalingen-section tbody tr:hover {
  background: var(--info-bg);
}

#bestellingen-section tbody tr {
  background: var(--warning-light);
}

#bestellingen-section tbody tr:hover {
  background: var(--warning-light);
}

#aankoopfacturen-section tbody tr {
  background: var(--success-light);
}

#aankoopfacturen-section tbody tr:hover {
  background: var(--success-light);
}



/* ========== ACTION BAR ========== */

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}

.selected-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}


/* ========== GROUPED VIEW ========== */

.data-table tbody tr.group-header {
  background: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
  color: white;
  font-weight: 600;
  border-left: 4px solid var(--info-color);
}

.data-table tbody tr.group-header td {
  padding: 12px 15px;
  color: white;
}

.group-header strong {
  font-size: 16px;
  margin-right: 10px;
}

.group-count {
  font-size: 13px;
  opacity: 0.9;
  font-weight: normal;
}

.grouped-row {
  background: var(--bg-hover);
}

.grouped-row:hover {
  background: var(--bg-light-gray);
}


/* ========== BULK ACTIONS ========== */

.checkbox-col {
  width: 40px;
  text-align: center;
}

.row-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.bulk-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.bulk-info {
  font-weight: 600;
  font-size: 15px;
}

.bulk-actions {
  display: flex;
  gap: 10px;
}

.btn-bulk {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-bulk:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-bulk.btn-export {
  background: var(--success-color);
}

.btn-bulk.btn-export:hover {
  background: var(--success-color);
}

.btn-bulk.btn-secondary {
  background: rgba(0, 0, 0, 0.2);
}

.btn-bulk.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ========== MODALS ========== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card, white);
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--bg-light-gray);
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted-light);
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 20px;
}

.modal-body label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-select,
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-info {
  background: var(--bg-gray);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.export-info p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--info-color);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-muted);
}

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

/* ========== EXPORTED INDICATOR ========== */

.data-table tbody tr.exported-row {
  background: var(--bg-light);
}

.exported-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 16px;
  cursor: help;
}

/* ========== EDITABLE FIELD SELECT ========== */

.field-select {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 14px;
  background: var(--bg-card, white);
  min-width: 150px;
}

.field-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}


/* ========== SEARCHABLE SELECT ========== */

.searchable-select {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 200px;
}

.searchable-select-btn {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-card, white);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted-light);
  position: relative;
  transition: all 0.2s;
}

.searchable-select-btn:hover {
  border-color: var(--primary-color);
}

.searchable-select-btn.has-value {
  color: var(--text-primary);
}

.searchable-select-btn::after {
  content: '▼';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted-light);
}

.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card, white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.searchable-select-search {
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--bg-light-gray);
  font-size: 14px;
  outline: none;
}

.searchable-select-search:focus {
  background: var(--bg-hover);
}

.searchable-select-options {
  overflow-y: auto;
  max-height: 340px;
}

.searchable-select-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray);
  transition: background 0.15s;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
  background: var(--bg-gray);
}

.searchable-select-option.selected {
  background: var(--info-bg);
}

.searchable-select-option.selected .option-label {
  font-weight: 600;
  color: var(--primary-color);
}

.option-label {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.option-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.searchable-select-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}


/* ========== AGENDA STATUS BADGES ========== */

.agenda-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  flex-shrink: 0;
}

.agenda-status-badge.status-matched {
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.agenda-status-badge.status-no-agenda {
  background: var(--warning-light);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

.data-table .checkbox-col,
.table .checkbox-col {
  width: 60px;
}


/* ========== SETTINGS PAGE ========== */

.settings-container {
  max-width: 800px;
  margin: 0 auto;
}

.settings-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: var(--text-primary);
}

.settings-description {
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.current-path {
  background: var(--bg-gray);
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
}

.current-path strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.current-path code {
  display: block;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

.settings-actions {
  text-align: center;
  margin-top: 30px;
}

.btn-large {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
}

.success-message {
  background: var(--success-light);
  color: var(--success-color);
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--success-color);
}

/* ========== AANKOPEN - BULK EDITING ========== */

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--info-bg);
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.bulk-toolbar span {
  font-weight: 600;
  color: var(--primary-color);
}

.row-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.select-all-section {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* Modified ref2 highlighting */
.table .ref2-modified,
.data-table .ref2-modified {
  background-color: var(--warning-light);
  font-weight: 600;
  color: var(--warning-color);
  border-left: 3px solid var(--warning-orange);
  padding-left: 8px;
}

/* ========== IMAGE TOOLTIP ========== */

.image-tooltip {
  position: absolute;
  z-index: 10000;
  background: var(--bg-card, white);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  max-width: 300px;
}

.image-tooltip img {
  display: block;
  max-width: 280px;
  max-height: 280px;
  object-fit: contain;
  border-radius: 4px;
}

.product-description:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Omschrijving-cel moet wrappen (override van td.editable nowrap) en nooit breder dan nodig */
td.product-description,
td.editable.product-description {
  white-space: normal;
  word-break: break-word;
  max-width: 420px;
  width: auto;
}

th.oms-col-header {
  min-width: 280px;
}

/* ================================
   Referentie Dropdown Styling
   ================================ */

.referentie-dropdown {
  position: relative;
  width: 100%;
}

.referentie-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.referentie-select--vast {
  background: var(--info-bg);
  border-color: var(--info-light);
  color: var(--info-color);
  font-weight: 700;
}

.referentie-select--klant {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.referentie-select--leeg {
  color: var(--text-muted);
  font-style: italic;
}

.referentie-select:hover {
  border-color: var(--primary-color);
}

.referentie-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--hoofdkleur-rgb, 220, 31, 38), 0.15);
}

.referentie-options {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  min-width: 320px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  color: var(--text-primary);
}

.referentie-options.show {
  display: block;
}

.modal .referentie-options {
  max-height: 500px;
}

.referentie-search {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.referentie-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-light-gray);
  color: var(--text-primary);
}

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

.referentie-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-card);
}

.referentie-group {
  padding: 4px 0;
}

.referentie-group-label {
  padding: 8px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: transparent;
  border-top: 1px solid var(--border-color);
}

.referentie-group:first-child .referentie-group-label {
  border-top: none;
}

.ref-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color 0.15s;
}

.ref-item:hover,
.ref-item--focused {
  background-color: var(--bg-hover);
}

.ref-item-hoofd {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.ref-item-check {
  width: 16px;
  color: var(--success-color);
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  text-align: center;
}

.ref-code {
  font-size: 14px;
  font-weight: 600;
  min-width: 54px;
}

.ref-item.vast .ref-code {
  color: var(--info-color);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ref-item.klant .ref-code {
  color: var(--text-primary);
}

.ref-klant-naam {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-adres {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-suggested-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--warning-light);
  color: var(--warning-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.ref-geen-resultaten {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.ref-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}


/* Product code styling */
.product-code {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 500;
  color: var(--info-color);
  font-size: 0.875rem;
  letter-spacing: normal;
}

/* ========== EDITABLE CELLS ========== */

/* Editable cel (bv. Eenheid-kolom) — compact, geen min-width forceren binnen tabel */
td.editable {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, outline-color 0.15s;
  width: 1%;
  white-space: nowrap;
}

td.editable:hover {
  background: var(--bg-hover);
  outline: 1px solid var(--border-light);
}

td.editable.editing {
  background: var(--bg-card);
  outline: 2px solid var(--info-color);
}

td.editable input {
  width: 100%;
  padding: 2px 6px;
  border: none;
  font-size: inherit;
  font-family: inherit;
  background: transparent;
  color: inherit;
}

td.editable input:focus {
  outline: none;
}

/* Editable cells voor facturen voorraad */
.editable-cell {
  cursor: pointer;
  transition: background 0.15s;
}

.editable-cell:hover {
  background: var(--info-bg);
}

.editable-cell.editing {
  background: var(--bg-card, white);
  padding: 0;
}

.editable-cell.editing input {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--info-color);
  border-radius: 4px;
  font-size: inherit;
  font-family: inherit;
  box-sizing: border-box;
}

.editable-cell.editing input:focus {
  outline: none;
}

/* ========== ROLE SELECTOR ========== */

.role-selector {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-option:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg);
}

.role-option.selected {
  border-color: var(--primary-color);
  background: var(--hover-bg);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.role-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gray);
  border-radius: 8px;
  flex-shrink: 0;
}

.role-option.selected .role-icon {
  background: var(--primary-color);
}

.role-info {
  flex: 1;
}

.role-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.role-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.role-checkmark {
  font-size: 24px;
  color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.role-option.selected .role-checkmark {
  opacity: 1;
}

/* ========== DASHBOARD STYLES ========== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-widget {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.dashboard-widget h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.todo-item {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.2s ease;
}

.todo-item:hover {
  background: var(--bg-gray);
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.todo-content {
  flex: 1;
}

.todo-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.todo-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.health-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  background: var(--bg-gray);
  margin-bottom: 10px;
}

.health-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-dot.online {
  background: var(--success-color);
}

.health-dot.offline {
  background: var(--danger-color);
}

.health-dot.warning {
  background: var(--warning-color);
}

.health-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.health-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-card {
  text-align: center;
  padding: 20px;
  background: var(--bg-gray);
  border-radius: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.email-item {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.email-item:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

.email-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.email-from {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.email-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.email-subject {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.email-preview {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ===================================
   BULK PREVIEW STYLING
   =================================== */

.btn.btn-preview {
  background: var(--primary-color);
  color: white;
  margin-left: 15px;
  font-size: 14px;
}

.btn.btn-preview:hover {
  background: var(--info-color);
}

.bulk-preview {
  background: var(--bg-card, white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 15px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-height: 600px;
  overflow-y: auto;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-gray);
}

.preview-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.preview-close {
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
}

.preview-close:hover {
  color: var(--danger-color);
}

.preview-content {
  padding: 20px;
}

.preview-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 16px;
}

.preview-day {
  background: var(--bg-gray);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
}

.preview-day:last-child {
  margin-bottom: 0;
}

.preview-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.preview-day-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text-primary);
}

.preview-day-count {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card, white);
  padding: 4px 10px;
  border-radius: 12px;
}

.preview-day-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .preview-day-totals {
    grid-template-columns: repeat(2, 1fr);
  }
}

.preview-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card, white);
  padding: 10px;
  border-radius: 6px;
}

.preview-total-netto {
  background: var(--primary-color);
}

.preview-total-netto .preview-label,
.preview-total-netto .preview-value {
  color: white;
}

.preview-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.preview-value {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.preview-materialen {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.preview-materialen h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text-primary);
}

.preview-mat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-mat-item {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 15px;
  align-items: center;
  background: var(--bg-card, white);
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .preview-mat-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.preview-mat-code {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 500;
  color: var(--info-color);
  font-size: 0.875rem;
  letter-spacing: normal;
  cursor: pointer;
  transition: color 0.2s;
}

.preview-mat-code:hover {
  color: var(--info-color);
  text-decoration: underline;
}

.preview-mat-naam {
  color: var(--text-primary);
  padding-left: 10px;
}

.preview-mat-qty {
  text-align: right;
  color: var(--text-secondary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .preview-mat-qty {
    text-align: left;
  }
}

/* Warning banner */
.preview-warning {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  background: var(--warning-light);
  border: 2px solid var(--warning-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.preview-warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.preview-warning-text {
  flex: 1;
}

.preview-warning-text strong {
  display: block;
  color: var(--warning-color);
  margin-bottom: 5px;
}

.preview-warning-text p {
  margin: 0;
  color: var(--warning-color);
  font-size: 14px;
}

/* Uitvoerders tags */
.preview-day-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-uitvoerders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-uitvoerder-tag {
  display: inline-block;
  background: var(--info-light);
  color: var(--info-color);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
}

/* Materiaal image tooltip */
.materiaal-image-tooltip {
  position: fixed;
  background: var(--bg-card, white);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  max-width: 300px;
}

.materiaal-image-tooltip img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 8px;
}

.materiaal-image-tooltip .tooltip-code {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
  font-size: 13px;
}

/* ========== DOCUMENT SCANNER & EMAIL ANIMATIONS ========== */

@keyframes progress {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

.scan-btn {
  animation: pulse-scan 3s infinite;
}

@keyframes pulse-scan {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
  }
}

/* ========== NIEUWE REGISTRATIE FORM ========== */

.nieuwe-registratie-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background: var(--bg-card, white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nieuwe-registratie-container h2 {
  margin: 0 0 10px 0;
  color: var(--primary-color);
  font-size: 28px;
}

.form-description {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 14px;
}

.registratie-form {
  margin-top: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="number"] {
  -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-calculated {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.form-calculated h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: var(--text-dark);
}

.calculated-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.calculated-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-card, white);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.calculated-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
}

.calculated-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.form-actions button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.form-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}

.form-message-success {
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-light);
}

.form-message-error {
  background: var(--danger-light);
  color: var(--danger-color);
  border: 1px solid var(--danger-light);
}

.form-message-info {
  background: var(--info-light);
  color: var(--info-color);
  border: 1px solid var(--info-light);
}

.form-message-warning {
  background: var(--warning-light);
  color: var(--warning-color);
  border: 1px solid var(--warning-light);
}

/* === COMPACT FORM LAYOUT === */
.registratie-form-compact {
  max-width: 600px;
  margin: 0 auto;
}

.form-group-full {
  margin-bottom: 20px;
}

.form-group-full label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 14px;
}

.form-group-full select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--bg-card, white);
}

.form-group-full select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group-full select:disabled {
  background: var(--bg-gray);
  color: var(--text-muted-light);
  cursor: not-allowed;
}

.form-group-full .label-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
  font-style: italic;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 6px;
  border: 2px solid var(--border-color);
}

.checkbox-label {
  /* Light mode default */
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  background: var(--bg-card, white);
  border-radius: 6px;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
  user-select: none;
}

.checkbox-label:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg, #f0f7ff);
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-label span {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
}

.checkbox-label input[type="checkbox"]:checked + span {
  color: var(--primary-color);
  font-weight: 600;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.form-row-2col .form-group {
  display: flex;
  flex-direction: column;
}

.form-row-2col .form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 14px;
}

.form-row-2col .form-group input,
.form-row-2col .form-group select {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--bg-card, white);
}

.form-row-2col .form-group input:focus,
.form-row-2col .form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row-2col .form-group input[type="number"] {
  -moz-appearance: textfield;
}

.form-row-2col .form-group input[type="number"]::-webkit-outer-spin-button,
.form-row-2col .form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-calculated-compact {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.form-calculated-compact h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--text-dark);
}

.calc-values {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.calc-item {
  flex: 1;
  min-width: 200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: var(--bg-card, white);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.calc-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}

.calc-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
}

.form-actions-compact {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 25px;
}

.form-actions-compact button {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.form-actions-compact .btn-primary {
  background: var(--primary-color);
  color: white;
}

.form-actions-compact .btn-primary:hover {
  background: var(--info-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.form-actions-compact .btn-secondary {
  background: var(--text-muted);
  color: white;
}

.form-actions-compact .btn-secondary:hover {
  background: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .calculated-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .calc-values {
    flex-direction: column;
  }

  .calc-item {
    min-width: 100%;
  }

  .form-actions-compact {
    flex-direction: column;
  }

  .form-actions-compact button {
    width: 100%;
  }

  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ======================================
   APPROVAL ICON & TOOLTIP
   ====================================== */

.approved-icon-only {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 16px;
  color: var(--success-color);
  font-weight: bold;
  animation: fadeIn 0.3s;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.approval-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(40, 44, 52, 0.95);
  color: var(--bg-white);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: normal;
  max-width: 350px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}

.timeline-cell:hover .approval-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.timeline-cell {
  position: relative;
}

/* Agenda approved strikethrough styling */
.timeline-cell.agenda-approved {
  text-decoration: line-through;
  text-decoration-color: var(--text-dark);
  text-decoration-thickness: 2px;
}

/* System Health Warning Banner */
.system-health-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-color) 100%);
  color: white;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  z-index: 99999;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.system-health-warning .warning-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-health-warning .warning-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.system-health-warning .warning-text {
  flex: 1;
}

.system-health-warning .warning-text strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
  font-weight: 600;
}

.system-health-warning .warning-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
}

.system-health-warning .warning-dismiss {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.system-health-warning .warning-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   FACTUREN PAGE STYLING
   ======================================== */

/* Two tables layout */
.facturen-tables-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

@media (max-width: 1400px) {
  .facturen-tables-container {
    grid-template-columns: 1fr;
  }
}

.facturen-table-section {
  background: var(--bg-card, white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.table-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border-color);
}

.table-section-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

/* Status badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-exported {
  background: var(--success-light);
  color: var(--success-color);
}

.status-pending {
  background: var(--warning-light);
  color: var(--warning-color);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 16px;
  background: var(--bg-card, white);
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid var(--border-color);
}

/* Preview afhalingen header */
.preview-afhalingen-header {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid var(--primary-color);
}

.preview-afhalingen-header h5 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--primary-color);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Preview summary */
.preview-summary {
  background: var(--bg-gray);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.preview-summary h4 {
  margin: 0 0 5px 0;
  font-size: 18px;
  color: var(--text-primary);
}

.preview-summary p {
  margin: 5px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.preview-summary strong {
  color: var(--text-primary);
}

/* Photo tooltip */
.photo-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--bg-card, white);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  max-width: 300px;
}

.photo-tooltip img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
}

/* Product code with photo hover */
.product-code {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--text-secondary);
}

.product-code:hover {
  color: var(--primary-color);
  text-decoration-color: var(--primary-color);
}

/* Export info in modal */
.export-info {
  background: var(--bg-gray);
  padding: 15px;
  border-radius: 6px;
  margin: 15px 0;
}

.export-info p {
  margin: 8px 0;
  font-size: 14px;
}

/* Required field indicator */
.required {
  border-left: 3px solid var(--danger-color);
}

/* Smaller table columns for facturen */
.code-col {
  width: 120px;
}

.omschrijving-col {
  min-width: 200px;
}

.qty-col {
  width: 80px;
  text-align: right;
}

.eenheid-col {
  width: 80px;
}

.ref-col {
  width: 120px;
}

.bron-col {
  width: 100px;
}

/* ========== TOP BAR - SERVER STATUS ========== */

.user-tag {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

/* Server Status Section */
.server-status-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.server-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 40px;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.status-light.online {
  background-color: var(--success-color);
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.status-light.offline {
  background-color: var(--text-secondary);
}

/* Navigation rechts: Klanten, Leveranciers, Settings */
.nav-right:first-of-type {
  margin-left: auto;
}

.nav-right,
.nav-settings {
  background: var(--bg-light);
  border-radius: 4px;
}

.nav-settings {
  /* Settings blijft als laatste rechts */
}

/* ========== BACK OFFICE DASHBOARD - ENHANCED TODO WIDGET ========== */

/* Optimize dashboard grid for 2-column TODO widget */
#dashboard-container .dashboard-grid {
  max-width: 1600px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

/* Enhanced widget spacing */
#dashboard-container .dashboard-widget {
  min-height: 600px;
}

/* Give TODO widget more breathing room for 2-column layout */
#todos-widget-main {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--border-light);
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #dashboard-container .dashboard-grid {
    max-width: 100%;
    padding: 0 10px;
  }

  #dashboard-container .dashboard-widget {
    min-height: auto;
  }
}

/* ========== DARK MODE TOGGLE SWITCH ========== */

.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-light);
  transition: .3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-slider:hover {
  background-color: var(--border-light);
}

.toggle-switch input:checked + .toggle-slider:hover {
  background-color: var(--primary-hover);
}

/* Dark mode - gebruikers tabel */
body.dark-mode .tabler-content tbody tr {
  background: var(--bg-gray);
  color: var(--text-secondary);
}

body.dark-mode .tabler-content tbody tr:hover {
  background: var(--bg-gray);
}

body.dark-mode .tabler-content .table-striped tbody tr:nth-of-type(odd) {
  background: var(--text-dark);
}



/* ========================================
   DARK MODE - GECONSOLIDEERDE STYLES
   ======================================== */

/* Stat cards */

body.dark-mode .stat-icon,
body.dark-mode .stat-value,
body.dark-mode .stat-label {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

body.dark-mode .stat-value {
    color: var(--primary-color);
}

/* Stats row container */
body.dark-mode .row.g-3.mb-3:first-of-type {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 10px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

body.dark-mode .col-md-3 {
    border: none;
    box-shadow: none;
}

/* Cards algemeen */
body.dark-mode .card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

body.dark-mode .card-body {
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .card-header {
    background: var(--text-dark);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

/* Empty states */
body.dark-mode .empty-state {
    background: transparent;
    color: var(--text-secondary);
}

body.dark-mode .empty-state-icon {
    background: transparent;
}

/* Containers */
body.dark-mode .container {
    background: transparent;
}

body.dark-mode .row,
body.dark-mode .col,
body.dark-mode [class*='col-'] {
    background: transparent;
}

/* Email cards */
body.dark-mode .email-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .email-card:hover {
    background: var(--bg-card);
}

body.dark-mode .email-card * {
    color: var(--text-secondary);
}

body.dark-mode .email-card .badge,
body.dark-mode .email-card .btn {
    color: var(--bg-white);
}

/* Input velden */
body.dark-mode input[type=text],
body.dark-mode input[type=search],
body.dark-mode input[type=date],
body.dark-mode input[type=email],
body.dark-mode input[type=password],
body.dark-mode input[type=number],
body.dark-mode input[type=tel],
body.dark-mode input[type=url],
body.dark-mode input:not([type]),
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .field-input,
body.dark-mode .field-select,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-muted);
}

body.dark-mode select option {
    background: var(--bg-card);
    color: var(--text-secondary);
}

/* Delegation badge */
body.dark-mode .delegation-badge {
    background: var(--info-color);
    color: var(--bg-white);
    border: 1px solid var(--info-color);
}

/* Nav links */
/* Todo inline comments */
body.dark-mode .todo-inline-comment {
    background: var(--text-dark);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

/* Tables */
body.dark-mode table,
body.dark-mode th,
body.dark-mode td {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

body.dark-mode tr:hover {
    background: var(--bg-card);
}

/* Todo/werf/email items */
body.dark-mode .todo-item,
body.dark-mode .werf-item,
body.dark-mode .email-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .todo-item:hover,
body.dark-mode .werf-item:hover,
body.dark-mode .email-item:hover {
    background: var(--bg-card);
}

/* Modals */
body.dark-mode .modal-content {
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: var(--border-color);
}

/* Dropdowns */
body.dark-mode .dropdown-menu {
    background: var(--bg-card);
    color: var(--text-secondary);
}

/* Links */
body.dark-mode a:not(.btn) {
    color: var(--danger-color);
}

/* Scrollbars */
body.dark-mode ::-webkit-scrollbar {
    background: var(--bg-card);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

/* Menu knoppen tekst wit */
body.dark-mode .nav-link,
body.dark-mode nav a,
body.dark-mode .navbar a,
body.dark-mode [class*='nav'] a {
    color: var(--text-primary);
}

body.dark-mode .nav-link:hover,
body.dark-mode nav a:hover {
    color: var(--danger-color);
}

/* ===========================================
   BLOG PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .blog-stat {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

body.dark-mode .blog-stat-value,
body.dark-mode .blog-stat-label {
    color: var(--text-secondary);
}

body.dark-mode .artikel-item,
body.dark-mode .article-item,
body.dark-mode .blog-article {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .artikel-item:hover {
    background: var(--bg-hover);
}

body.dark-mode .artikel-item.active {
    background: var(--primary-color);
    color: #fff;
}

/* ===========================================
   CAD PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .cad-card {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

body.dark-mode .cad-card-header {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

body.dark-mode .symbool-item {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

body.dark-mode .symbool-item:hover {
    background: var(--bg-gray);
}

body.dark-mode .file-input-label {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

body.dark-mode .cad-canvas,
body.dark-mode #canvas-container {
    background: var(--bg-gray);
}

/* ===========================================
   MENU KNOPPEN - Uniforme stijl
   =========================================== */
body.dark-mode .nav-link:not(.active) {
    background: #3a3a3a;
    color: var(--text-primary);
}

body.dark-mode .nav-menu {
    background: var(--bg-gray);
}

/* ===========================================
   OFFERTES PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .filter-bar {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .concept-card {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

body.dark-mode .concept-card:hover {
    background: var(--bg-card);
}

/* ===========================================
   EMAILS PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .inference-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
}

body.dark-mode .inference-btn {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

/* ===========================================
   OPDRACHTEN PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .detail-panel {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ===========================================
   KLANTEN PAGE - Dark mode fixes
   =========================================== */
body.dark-mode .form-card {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ===========================================
   VENTILATIE TEMPLATES - Dark mode fixes
   =========================================== */
body.dark-mode .template-section {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

body.dark-mode .template-section table {
    background: var(--bg-card);
}

body.dark-mode .template-section th {
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .template-section td {
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .template-section input {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

/* ===========================================
   GENERIEKE DARK MODE - Catch-all voor kaarten/secties
   =========================================== */
body.dark-mode .card,
body.dark-mode .section,
body.dark-mode .panel,
body.dark-mode .box,
body.dark-mode [class*='-card'],
body.dark-mode [class*='-section'],
body.dark-mode [class*='-panel'],
body.dark-mode [class*='-box'] {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

body.dark-mode .card-header,
body.dark-mode .section-header,
body.dark-mode .panel-header {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ===========================================
   EMAILS PAGE - Dark mode button fixes
   =========================================== */
body.dark-mode .email-tools button,
body.dark-mode .management-tools button,
body.dark-mode [class*='tools'] button,
body.dark-mode button:not(.btn):not([class*='btn']) {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

body.dark-mode .email-tools button:hover,
body.dark-mode button:not(.btn):not([class*='btn']):hover {
    background: var(--bg-gray);
}

/* Fix remaining white divs in emails */
body.dark-mode .container > div {
    background: transparent;
}

/* Uitvoerders Portaal - Dark Mode */
body.dark-mode .tab-container {
    background: var(--bg-card);
    border-bottom-color: var(--border-color);
}

body.dark-mode .tab-container .tab-btn {
    background: var(--bg-gray);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .tab-container .tab-btn:hover:not(.active) {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

body.dark-mode .tab-container .tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}

body.dark-mode .agenda-day {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.dark-mode .agenda-day-header {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .agenda-event {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

body.dark-mode .registratie-item {
    border-bottom-color: var(--border-color);
}

body.dark-mode .registratie-item:hover {
    background: var(--bg-gray);
}

body.dark-mode .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.dark-mode .dropzone {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .dropzone:hover {
    border-color: var(--primary-color);
}

body.dark-mode .modal-content {
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: var(--border-color);
}

/* Fix dark mode todo titles and text */
body.dark-mode .todo-title,
body.dark-mode .todo-text,
body.dark-mode .todo-item .todo-title,
body.dark-mode .todo-item .todo-text,
body.dark-mode .delegated-item,
body.dark-mode .delegated-item .todo-title,
body.dark-mode .todo-item span,
body.dark-mode .todo-item p,
body.dark-mode .todo-item label {
    color: var(--text-secondary);
}

body.dark-mode .todo-item .text-muted,
body.dark-mode .todo-item .todo-meta,
body.dark-mode .delegated-item .text-muted {
    color: var(--text-muted-light);
}

/* Fix dark mode email page elements */
body.dark-mode .btn-secondary {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

body.dark-mode .btn-secondary:hover {
    background: var(--bg-gray);
}

body.dark-mode .email-column {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .email-columns {
    border-color: var(--border-color);
}

body.dark-mode .email-list {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .email-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Fix stat cards with borders */
body.dark-mode .stat-card,
body.dark-mode [class*='stat-'] {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Fix filter inputs on email page */
body.dark-mode .filter-row input,
body.dark-mode .filter-row select,
body.dark-mode .filters input,
body.dark-mode .filters select {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

/* Force dark mode on all stat cards */
body.dark-mode .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .stat-card * {
    color: inherit;
}

body.dark-mode .stat-card .stat-value,
body.dark-mode .stat-card .stat-number {
    color: var(--primary-color);
}

/* Stat cards - consistent dark mode styling with frames */
body.dark-mode .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: none;
}

body.dark-mode .stat-card .stat-value,
body.dark-mode .stat-card .stat-label,
body.dark-mode .stat-card .stat-icon {
    background: transparent;
}

body.dark-mode .stat-value {
    color: var(--primary-color);
}

body.dark-mode .stat-label {
    color: var(--text-muted-light);
}

/* ===========================================
   Version Update Banner
   =========================================== */
#version-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-color) 100%);
  color: white;
  padding: 0.75rem 1rem;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.version-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.version-banner-icon {
  font-size: 1.25rem;
}

.version-banner-text {
  font-weight: 500;
  font-size: 0.95rem;
}

.version-banner-btn {
  background: var(--bg-card, white);
  color: var(--warning-color);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.version-banner-btn:hover {
  background: var(--warning-light);
  transform: scale(1.02);
}

.version-banner-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.version-banner-close:hover {
  opacity: 1;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #version-update-banner {
    background: linear-gradient(135deg, #b45309 0%, var(--warning-color) 100%);
  }
}
