/* ============================================
   OceanNet Smart Upload Demo - Stylesheet
   Huisstijl: Geel (#FFD700) / Zwart / Wit
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-yellow: #FFD700;
  --color-yellow-hover: #E6C200;
  --color-yellow-light: #FFF8DC;
  --color-yellow-bg: #FFFEF5;
  --color-black: #1A1A1A;
  --color-dark-grey: #32373C;
  --color-mid-grey: #6B7280;
  --color-light-grey: #F3F4F6;
  --color-border: #E5E7EB;
  --color-white: #FFFFFF;
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-ai-highlight: #FEF3C7;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-error: #EF4444;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --transition: 200ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }

body {
  font-family: var(--font-primary);
  color: var(--color-black);
  background: var(--color-light-grey);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Layout Grid --- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 90;
  transition: transform var(--transition);
}

.main-content {
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--header-height));
  padding: 32px;
  transition: margin-left var(--transition);
}

/* --- Header --- */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--color-dark-grey);
}
.sidebar-toggle:hover { background: var(--color-light-grey); }

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.breadcrumb-parent { color: var(--color-mid-grey); font-weight: 500; }
.breadcrumb-sep { color: var(--color-border); }
.breadcrumb-current { color: var(--color-black); font-weight: 600; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-yellow-light);
  color: var(--color-dark-grey);
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-black);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Sidebar --- */
.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-mid-grey);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.nav-item:hover:not(.disabled) {
  background: var(--color-light-grey);
  color: var(--color-black);
}

.nav-item.active {
  background: var(--color-yellow-light);
  color: var(--color-black);
  font-weight: 600;
  border-left-color: var(--color-yellow);
}

.nav-item.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-label { white-space: nowrap; }

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-yellow);
  color: var(--color-black);
  white-space: nowrap;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-mid-grey);
}
.powered-brand {
  font-weight: 700;
  color: var(--color-dark-grey);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 85;
}

/* --- Upload Zone (EMPTY state) --- */
.upload-section {
  max-width: 860px;
  margin: 0 auto;
}

.upload-header {
  margin-bottom: 28px;
}
.upload-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 6px;
}
.upload-header p {
  font-size: 15px;
  color: var(--color-mid-grey);
}

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--color-yellow);
  background: var(--color-yellow-bg);
}
.drop-zone.drag-over {
  border-style: solid;
  transform: scale(1.01);
}

.drop-zone-icon {
  margin-bottom: 16px;
  color: var(--color-mid-grey);
}
.drop-zone.drag-over .drop-zone-icon { color: var(--color-yellow-hover); }

.drop-zone-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 4px;
}
.drop-zone-subtitle {
  font-size: 14px;
  color: var(--color-mid-grey);
  margin-bottom: 12px;
}
.drop-zone-formats {
  font-size: 12px;
  color: var(--color-mid-grey);
  opacity: 0.7;
}

.file-input { display: none; }

/* --- Demo Scenario Cards --- */
.demo-scenarios {
  margin-top: 32px;
}
.demo-scenarios-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-mid-grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.scenario-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.scenario-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.scenario-card:hover {
  border-color: var(--color-yellow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.scenario-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--color-mid-grey);
}
.scenario-card:hover .scenario-icon {
  background: var(--color-yellow-light);
  color: var(--color-dark-grey);
}

.scenario-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 4px;
}
.scenario-desc {
  font-size: 13px;
  color: var(--color-mid-grey);
  margin-bottom: 10px;
  line-height: 1.4;
}
.scenario-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.scenario-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-light-grey);
  color: var(--color-mid-grey);
}
.scenario-pill.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.btn-view-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mid-grey);
  background: var(--color-light-grey);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-view-source:hover {
  color: var(--color-black);
  background: var(--color-yellow-light);
  border-color: var(--color-yellow);
}
.btn-view-source svg {
  width: 13px;
  height: 13px;
}

/* --- Processing State --- */
.processing-section {
  max-width: 520px;
  margin: 60px auto 0;
  text-align: center;
}

.processing-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark-grey);
}
.processing-file-icon { color: var(--color-mid-grey); }

.processing-animation {
  margin-bottom: 40px;
  position: relative;
  width: 80px;
  height: 100px;
  margin-left: auto;
  margin-right: auto;
}

.doc-icon-wrapper {
  width: 80px;
  height: 100px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.doc-icon-wrapper::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 20px;
  background: var(--color-light-grey);
  border-bottom-left-radius: 4px;
  border-left: 2px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
}

.scan-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: var(--color-yellow);
  border-radius: 1px;
  animation: scanLine 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

@keyframes scanLine {
  0% { top: 8px; opacity: 1; }
  50% { top: 85px; opacity: 1; }
  51% { opacity: 0; }
  52% { top: 8px; opacity: 0; }
  53% { opacity: 1; }
  100% { top: 8px; opacity: 1; }
}

.processing-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 300ms ease;
}
.processing-step.visible {
  opacity: 1;
  transform: translateY(0);
}
.processing-step.active { color: var(--color-black); font-weight: 500; }
.processing-step.complete { color: var(--color-mid-grey); }

.step-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-indicator.pending {
  background: var(--color-light-grey);
}
.step-indicator.active {
  background: var(--color-yellow);
  animation: pulse 1s ease infinite;
}
.step-indicator.complete {
  background: var(--color-success-bg);
  color: var(--color-success);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255, 215, 0, 0); }
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-black);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --- Results State --- */
.results-section {
  max-width: 960px;
  margin: 0 auto;
}

.results-header {
  background: var(--color-dark-grey);
  color: var(--color-white);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.results-header-left h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.results-header-left .results-source {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.results-header-right {
  display: flex;
  gap: 8px;
}

.results-summary {
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.summary-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.summary-stat {
  font-size: 13px;
  color: var(--color-mid-grey);
}
.summary-stat strong {
  color: var(--color-black);
  font-weight: 600;
}
.summary-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.time-ai {
  color: var(--color-success);
  font-weight: 600;
}
.time-manual {
  color: var(--color-mid-grey);
  text-decoration: line-through;
}

/* --- Warnings --- */
.results-warnings {
  background: var(--color-warning-bg);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 12px 24px;
}
.warning-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #92400E;
  margin-bottom: 4px;
}
.warning-item:last-child { margin-bottom: 0; }
.warning-icon { flex-shrink: 0; margin-top: 2px; }

/* --- Receiver Sections --- */
.receiver-section {
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.receiver-section:last-of-type {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.receiver-header {
  padding: 16px 24px;
  background: var(--color-light-grey);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.receiver-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 2px;
}
.receiver-meta {
  font-size: 12px;
  color: var(--color-mid-grey);
  display: flex;
  gap: 16px;
}

.receiver-toggle {
  color: var(--color-mid-grey);
  transition: transform var(--transition);
}
.receiver-section.collapsed .receiver-toggle {
  transform: rotate(-90deg);
}
.receiver-section.collapsed .receiver-body {
  display: none;
}

.receiver-body { padding: 0; }

/* --- Goods Table --- */
.goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.goods-table th {
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mid-grey);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.goods-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-light-grey);
  color: var(--color-dark-grey);
  vertical-align: top;
}
.goods-table tr:last-child td { border-bottom: none; }

.goods-table th:first-child,
.goods-table td:first-child { padding-left: 24px; }
.goods-table th:last-child,
.goods-table td:last-child { padding-right: 24px; }

/* AI Enriched fields */
.ai-enriched {
  background: var(--color-ai-highlight);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.ai-enriched .sparkle {
  flex-shrink: 0;
}
.ai-enriched:hover::after {
  content: 'Automatisch verrijkt door AI';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-dark-grey);
  color: var(--color-white);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.vin-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* --- Results Actions --- */
.results-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-yellow);
  color: var(--color-black);
}
.btn-primary:hover { background: var(--color-yellow-hover); }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-dark-grey);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-light-grey); }

.btn-ghost {
  background: transparent;
  color: var(--color-mid-grey);
}
.btn-ghost:hover { color: var(--color-black); background: var(--color-light-grey); }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Comparison View --- */
.comparison-section {
  max-width: 960px;
  margin: 0 auto;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.comparison-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.comparison-panel {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.comparison-panel-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
}
.panel-manual .comparison-panel-header {
  background: #FEF2F2;
  color: #991B1B;
  border-bottom: 2px solid #FECACA;
}
.panel-ai .comparison-panel-header {
  background: var(--color-success-bg);
  color: #065F46;
  border-bottom: 2px solid #A7F3D0;
}

.comparison-panel-header .panel-time {
  font-size: 24px;
  font-weight: 700;
}

.comparison-steps {
  padding: 20px 24px;
}
.comparison-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-light-grey);
  font-size: 14px;
}
.comparison-step:last-child { border-bottom: none; }

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.panel-manual .step-number { background: #FEE2E2; color: #991B1B; }
.panel-ai .step-number { background: #D1FAE5; color: #065F46; }

.step-content { flex: 1; }
.step-label { font-weight: 500; }
.step-time {
  font-size: 12px;
  color: var(--color-mid-grey);
  margin-top: 2px;
}

/* Savings Banner */
.savings-banner {
  background: var(--color-dark-grey);
  border-radius: var(--radius-md);
  padding: 32px;
  color: var(--color-white);
  text-align: center;
}
.savings-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.savings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.savings-item {}
.savings-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-yellow);
  line-height: 1.1;
}
.savings-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .sidebar-toggle {
    display: flex;
  }
  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .main-content { padding: 20px 16px; }

  .scenario-cards {
    grid-template-columns: 1fr;
  }

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

  .savings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .results-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .goods-table { font-size: 12px; }
  .goods-table th, .goods-table td { padding: 8px 10px; }
  .goods-table th:first-child, .goods-table td:first-child { padding-left: 16px; }

  .drop-zone { padding: 32px 20px; }

  /* BL responsive */
  .bl-page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bl-parties-grid { grid-template-columns: 1fr; }
  .bl-transport-grid { grid-template-columns: 1fr 1fr; }
  .bl-field-block { padding: 12px 20px; }
  .bl-parties-grid .bl-field-block:nth-child(2n) { border-right: none; }
  .bl-doc-header { flex-direction: column; gap: 16px; padding: 20px; }
  .bl-doc-number { text-align: left; }
  .bl-goods-section { padding: 12px 16px 0; overflow-x: auto; }
  .bl-goods-table { min-width: 400px; }
  .bl-totals { flex-direction: column; gap: 8px; padding: 12px 20px; }
  .bl-footer { flex-direction: column; gap: 20px; padding: 16px 20px; }
  .bl-footer-right { text-align: left; }
  .bl-signature-line { margin: 32px 0 6px 0; }
  .bl-time-banner { flex-wrap: wrap; }
}

/* --- Dashboard --- */
.dashboard-section {
  max-width: 1100px;
  margin: 0 auto;
}
.dashboard-header {
  margin-bottom: 24px;
}
.dashboard-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 4px;
}
.dashboard-header p {
  font-size: 15px;
  color: var(--color-mid-grey);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-card-alert {
  border-color: #FBBF24;
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon-yellow { background: #FEF3C7; color: #D97706; }
.kpi-icon-green  { background: #D1FAE5; color: #059669; }
.kpi-icon-blue   { background: #DBEAFE; color: #2563EB; }
.kpi-icon-orange { background: #FED7AA; color: #EA580C; }

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1.1;
}
.kpi-label {
  font-size: 13px;
  color: var(--color-mid-grey);
  margin-top: 2px;
}

/* Dashboard Toolbar */
.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.filter-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-dark-grey);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-select:focus {
  outline: none;
  border-color: var(--color-yellow);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-mid-grey);
  pointer-events: none;
}
.search-input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--color-dark-grey);
  width: 280px;
}
.search-input:focus {
  outline: none;
  border-color: var(--color-yellow);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}
.search-input::placeholder {
  color: var(--color-mid-grey);
  opacity: 0.7;
}

/* Dossier Table */
.dossier-table-wrap {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.dossier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dossier-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mid-grey);
  background: var(--color-light-grey);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.dossier-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-light-grey);
  color: var(--color-dark-grey);
  vertical-align: middle;
}
.dossier-table tr:last-child td { border-bottom: none; }

.dossier-row.clickable {
  cursor: pointer;
}
.dossier-row.clickable:hover td {
  background: var(--color-yellow-bg);
}
.dossier-row:hover td {
  background: var(--color-light-grey);
}

.dossier-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--color-mid-grey);
}
.container-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.receivers-count {
  font-size: 11px;
  color: var(--color-mid-grey);
  margin-left: 4px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  color: var(--color-mid-grey);
}
.source-badge svg { width: 16px; height: 16px; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-footer-info {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--color-mid-grey);
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .kpi-card { padding: 10px; gap: 8px; flex-direction: column; text-align: center; }
  .kpi-icon { width: 32px; height: 32px; }
  .kpi-icon svg { width: 16px; height: 16px; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 11px; }
  .dashboard-toolbar { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
  .dossier-table-wrap { overflow-x: auto; }
  .dossier-table { min-width: 700px; }
}

/* --- Source Preview Modal --- */
.source-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.source-modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}
.source-overlay.open .source-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.source-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-light-grey);
}
.source-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.source-modal-icon {
  color: var(--color-mid-grey);
  flex-shrink: 0;
}
.source-modal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-black);
}
.source-modal-meta {
  font-size: 12px;
  color: var(--color-mid-grey);
}
.source-modal-close {
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px !important;
}

.source-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.source-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-light-grey);
}
.source-modal-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-yellow-light);
  color: var(--color-dark-grey);
}
.source-modal-hint {
  font-size: 12px;
  color: var(--color-mid-grey);
  font-style: italic;
}

/* Email preview */
.source-email-headers {
  background: var(--color-light-grey);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.source-email-field {
  font-size: 13px;
  color: var(--color-dark-grey);
  margin-bottom: 4px;
}
.source-email-field:last-child { margin-bottom: 0; }
.source-email-label {
  font-weight: 600;
  color: var(--color-mid-grey);
  display: inline-block;
  min-width: 80px;
}
.source-email-body {
  font-family: 'Calibri', 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--color-black);
  padding: 4px 0;
}

/* Document preview */
.source-document-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-mid-grey);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.source-document-icon { color: var(--color-mid-grey); }

.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.source-table th {
  background: var(--color-dark-grey);
  color: var(--color-white);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.source-table .source-table-head td {
  background: var(--color-light-grey);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-mid-grey);
  padding: 8px 12px;
}
.source-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-dark-grey);
  vertical-align: top;
}

/* Image preview */
.source-image {
  text-align: center;
}
.source-image-preview {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.source-image-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-mid-grey);
  font-style: italic;
}

@media (max-width: 768px) {
  .source-overlay { padding: 12px; }
  .source-modal { max-height: 90vh; }
  .source-modal-body { padding: 16px; }
  .source-modal-footer { flex-direction: column; gap: 6px; text-align: center; }
}

/* --- Bill of Lading Preview --- */
.bl-section {
  max-width: 960px;
  margin: 0 auto;
}
.bl-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.bl-page-header h2 {
  font-size: 22px;
  font-weight: 700;
}
.bl-page-subtitle {
  font-size: 14px;
  color: var(--color-mid-grey);
  margin-top: 2px;
}

.bl-time-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-success-bg);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  margin-bottom: 20px;
  font-size: 13px;
}
.bl-time-icon { color: var(--color-success); display: flex; }
.bl-time-ai { color: var(--color-success); font-weight: 600; }
.bl-time-manual { color: var(--color-mid-grey); text-decoration: line-through; }

.bl-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 0;
  overflow-x: auto;
}
.bl-tab {
  padding: 10px 20px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-mid-grey);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.bl-tab:hover { color: var(--color-black); background: var(--color-light-grey); }
.bl-tab.active { color: var(--color-black); border-bottom-color: var(--color-yellow); }

.bl-document { display: none; }
.bl-document.active { display: block; }

.bl-doc-inner {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.bl-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 28px;
  border-bottom: 2px solid var(--color-black);
}
.bl-doc-logo { display: flex; flex-direction: column; gap: 6px; }
.bl-logo-img { height: 24px; width: auto; }
.bl-doc-type {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-black);
}
.bl-doc-number { text-align: right; }
.bl-number-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mid-grey);
}
.bl-number-value {
  font-size: 16px;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  color: var(--color-black);
  letter-spacing: 0.02em;
}
.bl-number-date { font-size: 12px; color: var(--color-mid-grey); margin-top: 2px; }

.bl-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--color-border);
}
.bl-transport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--color-border);
}

.bl-field-block {
  padding: 14px 28px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.bl-parties-grid .bl-field-block:nth-child(2n) { border-right: none; }
.bl-transport-grid .bl-field-block:last-child { border-right: none; }

.bl-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-mid-grey);
  margin-bottom: 4px;
}
.bl-field-value {
  font-size: 13px;
  color: var(--color-black);
  line-height: 1.5;
}
.bl-mono {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.bl-goods-section { padding: 14px 28px 0; }
.bl-goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.bl-goods-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mid-grey);
  border-bottom: 1px solid var(--color-black);
  white-space: nowrap;
}
.bl-goods-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-dark-grey);
  vertical-align: top;
}
.bl-goods-table tr:last-child td { border-bottom: none; }
.bl-right { text-align: right; }
.bl-goods-detail { font-size: 11px; color: var(--color-mid-grey); }

.bl-totals {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
  padding: 12px 28px;
  border-top: 2px solid var(--color-black);
  background: var(--color-light-grey);
}
.bl-total-item {
  font-size: 13px;
  color: var(--color-dark-grey);
  display: flex;
  gap: 8px;
}
.bl-total-item strong { color: var(--color-black); }

.bl-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 28px;
  border-top: 1px solid var(--color-border);
}
.bl-footer-right { text-align: right; }
.bl-signature-line {
  width: 200px;
  height: 1px;
  background: var(--color-black);
  margin: 32px 0 6px auto;
}
.bl-signature-name { font-size: 12px; color: var(--color-mid-grey); }

.bl-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--color-yellow);
  color: var(--color-black);
  margin-left: 4px;
}

/* --- Notifications --- */
.notification-container {
  position: relative;
}
.notification-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-mid-grey);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.notification-bell:hover {
  color: var(--color-black);
  background: var(--color-light-grey);
}
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
}
.notification-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}
.notification-dropdown-title {
  font-weight: 600;
  font-size: 14px;
}
.notification-unread-count {
  font-size: 12px;
  color: #EF4444;
  font-weight: 600;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--color-border);
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--color-yellow-bg); }
.notification-item.unread { background: #FEFCE8; }
.notification-item.unread:hover { background: #FEF9C3; }
.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notification-icon svg { width: 14px; height: 14px; }
.notification-icon.notif-warning { background: #FFFBEB; color: #D97706; }
.notification-icon.notif-new { background: #EFF6FF; color: #2563EB; }
.notification-icon.notif-success { background: #ECFDF5; color: #059669; }
.notification-icon.notif-info { background: var(--color-light-grey); color: var(--color-mid-grey); }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notification-message { font-size: 12px; color: var(--color-mid-grey); line-height: 1.4; }
.notification-time { font-size: 11px; color: var(--color-mid-grey); margin-top: 4px; }
.notification-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  margin-top: 6px;
}
@media (max-width: 768px) {
  .notification-dropdown { width: calc(100vw - 32px); right: -60px; }
}

/* --- Dossier Detail --- */
.dossier-detail { max-width: 960px; margin: 0 auto; }
.dossier-detail-header { margin-bottom: 24px; }
.dossier-detail-back { margin-bottom: 12px; }
.dossier-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.dossier-detail-title h1 { margin: 0; font-size: 24px; }
.dossier-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--color-mid-grey);
  font-size: 13px;
}
.dossier-detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dossier-detail-meta svg { width: 14px; height: 14px; }
.dossier-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}
.dossier-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mid-grey);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.dossier-tab:hover { color: var(--color-black); }
.dossier-tab.active {
  color: var(--color-black);
  border-bottom-color: var(--color-yellow);
  font-weight: 600;
}
.dossier-tab-content { min-height: 200px; }
.dossier-empty-tab {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-mid-grey);
}
.text-muted { color: var(--color-mid-grey); }
.dossier-receiver-group { margin-bottom: 24px; }
.dossier-receiver-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-light-grey);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}
.dossier-receiver-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.dossier-table-wrap { overflow-x: auto; }
.dossier-goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dossier-goods-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-mid-grey);
  border-bottom: 1px solid var(--color-border);
}
.dossier-goods-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.dossier-documents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dossier-documents-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-mid-grey);
  border-bottom: 1px solid var(--color-border);
}
.dossier-documents-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.doc-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-icon svg { width: 16px; height: 16px; color: var(--color-mid-grey); }
.doc-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-light-grey);
  color: var(--color-mid-grey);
  text-transform: capitalize;
}
.doc-type-badge.bl { background: #EFF6FF; color: #2563EB; }
.doc-type-badge.email { background: #FFFBEB; color: #D97706; }
.dossier-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Timeline */
.dossier-timeline { padding: 4px 0; }
.timeline-event {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}
.timeline-event:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -4px;
  width: 2px;
  background: var(--color-border);
}
.timeline-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.timeline-marker svg { width: 14px; height: 14px; }
.tl-incoming { background: #EFF6FF; color: #2563EB; }
.tl-ai { background: #FFFBEB; color: #D97706; }
.tl-success { background: #ECFDF5; color: #059669; }
.tl-warning { background: #FEF2F2; color: #DC2626; }
.tl-bl { background: #EFF6FF; color: #2563EB; }
.tl-status { background: var(--color-light-grey); color: var(--color-mid-grey); }
.timeline-content { flex: 1; }
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.timeline-label { font-size: 13px; font-weight: 600; }
.timeline-time { font-size: 12px; color: var(--color-mid-grey); }
.timeline-detail { font-size: 12px; color: var(--color-mid-grey); }

@media (max-width: 768px) {
  .dossier-detail-title { flex-wrap: wrap; }
  .dossier-detail-meta { gap: 10px; }
  .dossier-tab { padding: 8px 12px; font-size: 13px; }
  .timeline-header { flex-direction: column; gap: 2px; }
}

/* --- BL Beheer (uses existing dashboard table styles) --- */
.bl-beheer-section { max-width: 1100px; margin: 0 auto; }
.kpi-icon-blue {
  background: #EFF6FF;
  color: #2563EB;
}

/* --- Inzichten --- */
.inzichten-section { max-width: 1100px; margin: 0 auto; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.inzichten-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.inzichten-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.inzichten-card-full { grid-column: 1 / -1; }
.inzichten-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-black);
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding-top: 20px;
}
.bar-chart-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.bar-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bar-chart-bar {
  width: 100%;
  max-width: 48px;
  background: var(--color-yellow);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: height 0.6s ease;
}
.bar-chart-value {
  font-size: 11px;
  font-weight: 700;
  margin-top: -18px;
  color: var(--color-black);
}
.bar-chart-label {
  font-size: 12px;
  color: var(--color-mid-grey);
  margin-top: 8px;
}

/* Trend Chart */
.trend-chart { display: flex; flex-direction: column; gap: 8px; }
.trend-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trend-label {
  font-size: 12px;
  color: var(--color-mid-grey);
  width: 32px;
  flex-shrink: 0;
}
.trend-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.trend-bar {
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
  transition: width 0.6s ease;
}
.trend-bar.manual { background: #FEE2E2; color: #DC2626; }
.trend-bar.ai { background: #ECFDF5; color: #059669; }
.trend-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-mid-grey);
}
.trend-legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.legend-dot.manual { background: #FEE2E2; }
.legend-dot.ai { background: #ECFDF5; }

/* Top Clients */
.top-clients-list { display: flex; flex-direction: column; gap: 10px; }
.top-client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.top-client-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.top-client-name { width: 160px; font-weight: 500; flex-shrink: 0; }
.top-client-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--color-light-grey);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.top-client-bar {
  height: 100%;
  background: var(--color-yellow);
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
}
.top-client-count { font-weight: 600; white-space: nowrap; }
.top-client-revenue { color: var(--color-mid-grey); white-space: nowrap; }

@media (max-width: 1024px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .inzichten-grid { grid-template-columns: 1fr; }
  .kpi-grid-4 { grid-template-columns: 1fr 1fr; }
  .top-client-name { width: 100px; }
  .top-client-revenue { display: none; }
  .bar-chart { gap: 6px; height: 140px; }
}

/* --- Factuurcontrole --- */
.factuur-section { max-width: 960px; margin: 0 auto; }
.factuur-header {
  background: var(--color-black);
  color: white;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.factuur-header h2 { margin: 0 0 8px 0; font-size: 18px; }
.factuur-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #9CA3AF;
}
.factuur-meta strong { color: white; }
.factuur-time-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #ECFDF5;
  color: #059669;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.factuur-time-banner svg { flex-shrink: 0; }
.factuur-time-manual { color: #9CA3AF; font-size: 12px; }
.factuur-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.factuur-summary-card {
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}
.factuur-summary-card.ok { background: #ECFDF5; }
.factuur-summary-card.warn { background: #FFFBEB; }
.factuur-summary-card.error { background: #FEF2F2; }
.factuur-summary-value { font-size: 24px; font-weight: 700; }
.factuur-summary-card.ok .factuur-summary-value { color: #059669; }
.factuur-summary-card.warn .factuur-summary-value { color: #D97706; }
.factuur-summary-card.error .factuur-summary-value { color: #DC2626; }
.factuur-summary-label { font-size: 12px; color: var(--color-mid-grey); margin-top: 2px; }

.factuur-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.factuur-table tfoot td { border-top: 2px solid var(--color-black); }
.diff-positive { color: #DC2626; font-weight: 600; }
.factuur-ok { }
.factuur-warn { background: #FFFBEB; }
.factuur-error { background: #FEF2F2; }
.factuur-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.factuur-status-badge.factuur-ok { background: #ECFDF5; color: #059669; }
.factuur-status-badge.factuur-warn { background: #FFFBEB; color: #D97706; }
.factuur-status-badge.factuur-error { background: #FEF2F2; color: #DC2626; }
.factuur-total-row { background: var(--color-light-grey); }
.factuur-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .factuur-summary { grid-template-columns: 1fr; }
  .factuur-meta { flex-direction: column; gap: 4px; }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.35s ease;
  animation-fill-mode: forwards;
}

@keyframes countUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
