/* ===== CUSTOMS TOOL — MAIN STYLESHEET ===== */

:root {
  --primary: #1a3a5c;
  --primary-dark: #0f2540;
  --primary-light: #2563a8;
  --accent: #e8a020;
  --accent-hover: #d4901a;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #d1dce8;
  --text: #1e2d3d;
  --text-muted: #6b7f94;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 2px 8px rgba(26,58,92,0.10);
  --shadow-lg: 0 8px 32px rgba(26,58,92,0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  height: 60px;
  width: auto;
}

.login-logo-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--primary);
}

.login-logo-text svg {
  width: 48px;
  height: 48px;
}

.login-logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.login-logo-text span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
  line-height: 1.4;
  min-height: 38px;
  box-sizing: border-box;
}

.btn:active { transform: translateY(1px); }

/* Utility */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff !important; }

.btn-accent {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff !important; }

.btn-ghost {
  background: transparent;
  color: var(--primary) !important;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--primary) !important; }

.btn-danger {
  background: var(--danger);
  color: #fff !important;
  border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; color: #fff !important; }

.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
  min-height: 30px;
}

/* Taalswitch */
.lang-switcher {
  display: flex;
  gap: 4px;
  align-items: center;
}

.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .15s, border-color .15s;
  line-height: 0;
}
.lang-btn img {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  display: block;
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn.lang-active {
  opacity: 1;
  border-color: rgba(255,255,255,0.6);
}

/* Topbar logout — wit op donker */
.btn-topbar {
  background: transparent;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,0.35);
}
.btn-topbar:hover { background: rgba(255,255,255,0.12); color: #fff !important; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo img {
  height: 32px;
  width: auto;
}

.ship-badge {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* Ship switcher dropdown (master/manager only) */
.ship-switcher {
  position: relative;
}

.ship-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}
.ship-switcher-btn:hover { background: rgba(255,255,255,0.25); }

.ship-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}
.ship-switcher-dropdown.open { display: block; }

.ship-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.ship-switcher-item:hover { background: var(--surface2); }
.ship-switcher-item.active {
  color: var(--primary);
  font-weight: 600;
}
.ship-switcher-item i { width: 16px; text-align: center; color: var(--primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  font-size: 13px;
  opacity: 0.85;
}

/* ===== TABS ===== */
.tabs {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  gap: 0;
  padding: 0 24px;
}

.tab {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

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

.tab-right { margin-left: auto; }

.btn i { margin-right: 5px; }

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ===== TABLE ===== */
.table-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: nowrap;
}

.table-header .btn,
.table-header .btn-sm {
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.table-header .flex {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.table-header h2 {
  font-size: 16px;
  font-weight: 600;
}

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

th {
  background: var(--surface2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

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

tr:hover td { background: var(--surface2); }

.row-laden { border-left: 3px solid var(--success); }
.row-lossen { border-left: 3px solid var(--primary-light); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-laden { background: #dcfce7; color: #15803d; }
.badge-laden i, .badge-lossen i { margin-right: 4px; }
.badge-lossen { background: #dbeafe; color: #1d4ed8; }
.badge-open { background: #ffedd5; color: #c2410c; }
.badge-leeg { background: #dcfce7; color: #15803d; }
.badge-gedeeltelijk { background: #ffedd5; color: #c2410c; }

.mt-value {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
}

.remaining-value {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.locked-icon {
  color: var(--text-muted);
  font-size: 12px;
  opacity: 0.5;
}

.row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

tr:hover .row-actions { opacity: 1; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,37,64,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  background: none;
  border: none;
  transition: background 0.2s;
}

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

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-wrap: nowrap;
}

.modal-footer .btn {
  width: auto;
  flex-shrink: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.full { grid-template-columns: 1fr; }

.form-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.form-section h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* Checkbox groups */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ===== BGD OVERVIEW ===== */
.bgd-grid {
  display: grid;
  gap: 12px;
}

.bgd-row {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.bgd-row:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.bgd-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  min-width: 110px;
}

.bgd-progress {
  flex: 1;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary-light);
  transition: width 0.4s ease;
}

.progress-fill.full { background: var(--text-muted); }

/* ===== BGD DETAIL ===== */
.bgd-detail {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bgd-detail-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bgd-detail-header h2 {
  font-size: 20px;
  font-weight: 700;
}

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

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ===== DRAG HANDLE ===== */
.drag-handle {
  cursor: grab;
  color: var(--border);
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

tr.dragging { opacity: 0.5; }
tr.drag-over td { border-top: 2px solid var(--primary-light); }

/* ===== INLINE EXPAND ROW ===== */
.expand-row td { padding: 0 !important; }
.expand-cell {
  background: var(--surface2);
  border-left: 3px solid var(--primary-light);
  border-bottom: 1px solid var(--border);
}

/* Dimmer overlay achter het formulier */
.table-dimmer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
  animation: dimmerIn 0.2s ease;
}
@keyframes dimmerIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* De expand row staat boven de dimmer */
tr[id^="expand-"] {
  position: relative;
  z-index: 11;
}
/* De lege placeholder rij ook */
tr[data-new="true"] {
  position: relative;
  z-index: 11;
}

.expand-content {
  padding: 0 24px 0 24px;
  overflow: hidden;
  animation: expandIn 0.2s ease;
}

@keyframes expandIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.expand-form {
  padding: 20px 0;
}

.expand-form-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: 16px;
}

.ef-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 20px;
  margin-bottom: 16px;
}

.ef-section {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.ef-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ef-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
}

.ef-toggle input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.expand-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.expand-actions .btn {
  width: auto;
  flex-shrink: 0;
}

.input-with-btn {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.input-with-btn .form-control {
  flex: 1;
}

.btn-now {
  padding: 0 12px;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-now:hover { background: var(--bg); color: var(--primary); }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background .15s;
}
.checkbox-item:hover { background: var(--surface); }
.checkbox-item input { accent-color: var(--primary); cursor: pointer; }

.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* MRN status indicator */
.mrn-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 7px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background .2s;
}
.mrn-empty  { background: #d1d5db; }
.mrn-filled { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

.mrn-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.mrn-edit-row .form-control { flex: 1; }

/* btn-sm inherits color from btn-primary/ghost/accent/danger — no override needed */

.product-info-pill {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  min-height: 36px;
  line-height: 22px;
  letter-spacing: .3px;
}

.fw-medium { font-weight: 500; }
.fs-11 { font-size: 11px; }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.form-control-sm {
  padding: 4px 8px;
  font-size: 12px;
  height: 28px;
  width: auto;
}

/* Per-rij balance cel */
.balance-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 700;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.balance-cell-laden {
  background: rgba(232,163,20,.12);
  color: #92640a;
}
.balance-cell-lossen {
  background: rgba(37,99,168,.1);
  color: var(--primary);
}
.balance-cell-unit {
  font-size: 10px;
  font-weight: 400;
  opacity: .65;
}

/* Icon buttons */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.icon-btn-edit:hover { color: var(--primary-light); background: rgba(37,99,168,.08); }
.icon-btn-danger { color: var(--text-muted); }
.icon-btn-danger:hover { color: var(--danger); background: rgba(220,38,38,.08); }

/* ===== SEARCHABLE SELECT ===== */
.ss-wrapper { position: relative; }
.ss-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s;
}
.ss-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ss-icon { position: absolute; left: 10px; color: var(--text-muted); font-size: 12px; pointer-events: none; }
.ss-arrow { position: absolute; right: 10px; color: var(--text-muted); font-size: 11px; pointer-events: none; transition: transform .15s; }
.ss-wrapper:focus-within .ss-arrow { transform: rotate(180deg); }
.ss-search {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-left: 30px !important;
  padding-right: 28px !important;
  cursor: text;
  width: 100%;
  z-index: 1;
}
.ss-display {
  position: absolute;
  left: 30px;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13.5px;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
}
.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
}
.ss-list { padding: 4px 0; }
.ss-group-label {
  padding: 6px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.ss-option {
  padding: 7px 12px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .1s;
}
.ss-option:hover { background: var(--surface2); }
.ss-option.ss-selected { background: rgba(37,99,235,.08); color: var(--primary); font-weight: 500; }

/* ===== TERMINALS / BARGES DRAG LIST ===== */
.term-drag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}
.term-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: default;
  transition: box-shadow .15s, opacity .15s;
}
.term-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.term-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 13px;
  flex-shrink: 0;
}
.term-dragging { opacity: .35; }
.term-drag-over-above { box-shadow: 0 -3px 0 0 var(--primary); }
.term-drag-over-below { box-shadow: 0 3px 0 0 var(--primary); }

/* ===== ABOARD BANNER ===== */
.aboard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 12px;
}
.aboard-products {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.aboard-product-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aboard-product-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .75;
}
.aboard-product-mt {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
}
.aboard-product-unit {
  font-size: 12px;
  font-weight: 400;
  opacity: .7;
  margin-left: 3px;
}
.aboard-transport-btn {
  color: #fff !important;
  border-color: rgba(255,255,255,.35) !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.aboard-transport-btn:hover {
  background: rgba(255,255,255,.12) !important;
}

/* ===== FILTER CARD ===== */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-preset {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.filter-preset:hover { border-color: var(--primary-light); color: var(--primary); }
.filter-preset.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-custom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== ACTIVITIES LAYOUT ===== */
.activities-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ===== TOTALS BAR ===== */
.totals-bar {
  border-top: 1px solid var(--border);
  padding: 0;
  background: var(--surface2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.totals-inner {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.totals-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.totals-col {
  flex: 1;
  min-width: 180px;
  padding: 14px 20px;
  border-right: 1px solid var(--border);
}
.totals-col:last-child { border-right: none; }

.totals-product {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
}

.totals-divider {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
}

.totals-label {
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.totals-val { font-weight: 600; font-size: 13px; }
.totals-pct { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.laden-color  { color: var(--accent); }
.lossen-color { color: var(--primary-light); }

.totals-sep {
  width: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ===== BALANCE SIDEBAR ===== */
.balance-sidebar { width: 200px; flex-shrink: 0; }

.balance-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 18px;
  position: sticky;
  top: 80px;
}

.balance-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .75;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.balance-subtitle {
  font-size: 11px;
  opacity: .55;
  margin-bottom: 18px;
}

.balance-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.balance-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.balance-product {
  font-size: 11px;
  font-weight: 600;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}

.balance-mt {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.balance-unit {
  font-size: 12px;
  font-weight: 400;
  opacity: .6;
  margin-left: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; padding: 0 16px; }
  .tab { padding: 12px 14px; font-size: 13px; }
  th, td { padding: 8px 10px; }
  .ef-grid { grid-template-columns: 1fr; }
}
