.version-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid #47769f;
  border-radius: 999px;
  color: #b9dcff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}

.customer-file-row {
  grid-template-columns: 120px 170px minmax(220px, 1fr);
  align-items: center;
}

.customer-files {
  overflow-x: auto;
}

.customer-page-head,
.customer-page-grid {
  display: grid;
  grid-template-columns: 92px 145px 340px 125px 78px 125px 90px 90px 130px 65px 82px 92px;
  width: max-content;
  min-width: 0;
  gap: 12px;
  align-items: center;
  justify-content: start;
}

.customer-page-head {
  padding: 10px 12px;
  border-radius: 9px;
  color: #fff;
  background: #173f64;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.customer-page-grid {
  padding: 12px;
  border-bottom: 1px solid #d8e4ee;
}

.customer-page-grid:nth-child(odd) {
  background: #f5f9fc;
}

.customer-page-grid > span {
  min-width: 0;
}

.modal .dialog.dialog-order {
  width: 96vw;
  max-width: none;
  height: 94vh;
  max-height: 94vh;
  overflow: auto;
}

.admin-page-table {
  margin-top: 8px;
}

.order-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 4px;
}

.order-row-print {
  margin-left: 0;
  white-space: nowrap;
}
.customer-order-actions .order-row-print { margin-left: auto; }

.column-drag-grip {
  display: inline-block;
  margin-right: 6px;
  color: #4d86b6;
  font-size: 14px;
}

.column-head-cell {
  touch-action: none;
}

.dragging-columns,
.dragging-columns * {
  cursor: grabbing !important;
  user-select: none !important;
}

.customer-order-actions,
.admin-order-actions {
  width: 100%;
  flex-wrap: wrap;
  white-space: normal;
}

.column-action,
.column-actions {
  overflow: visible;
  white-space: normal;
}

.locker-code-editor {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #c9e2f7;
}

.locker-code-editor label {
  flex: 1;
  color: #174e7d;
  font-size: 12px;
  font-weight: 850;
}

.locker-code-editor input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px;
  border: 1px solid #8fc5ef;
  border-radius: 8px;
  background: #fff;
}

.locker-code-wait {
  margin-top: 10px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.customer-locker-code {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 9px;
  border: 1px solid #87bceb;
  border-radius: 8px;
  color: #075eaf;
  background: #e4f2ff;
}

.admin-download-small {
  display: inline-block;
  margin-top: 7px;
  color: #0b6bcb;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.customer-order-info {
  padding: 0;
  margin: 16px 0;
  border: 0;
  background: transparent;
}

.customer-order-info section {
  padding: 14px;
  border: 1px solid #c9e2f7;
  border-radius: 11px;
  background: linear-gradient(135deg,#edf6ff,#f4faff);
}

.customer-order-info h3,
.customer-order-info p {
  margin: 0;
}

.customer-order-info h3 {
  margin-bottom: 8px;
}

.value-kind {
  display: inline-block;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.value-kind.is-color {
  color: #075eaf;
  background: #e4f2ff;
  border: 1px solid #8fc5ef;
}

.value-kind.is-bw {
  color: #27313d;
  background: #edf0f3;
  border: 1px solid #b9c2cb;
}

.customer-file-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.customer-file-preview .placed-thumb,
.customer-file-preview .deleted-thumb {
  width: 150px;
  height: 115px;
}

.file-kind,
.print-kind {
  display: block;
  width: 150px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.file-kind.is-color,
.print-kind.is-color {
  color: #075eaf;
  background: #e4f2ff;
  border: 1px solid #8fc5ef;
}

.file-kind.is-bw,
.print-kind.is-bw {
  color: #27313d;
  background: #edf0f3;
  border: 1px solid #b9c2cb;
}

.print-kind {
  margin-top: 1px;
}

.pdf-view-link {
  display: inline-block;
  width: 150px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #fff;
  background: #0b6bcb;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.customer-files .pdf-view-link,
.order-rows .pdf-view-link {
  color: #fff;
}

button.pdf-view-link {
  border: 0;
  cursor: pointer;
}

.customer-pdf-view {
  align-self: center;
  justify-self: start;
  width: 110px;
}

.pdf-unavailable {
  display: inline-block;
  width: 110px;
  color: #687386;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.pdf-view-link:hover {
  background: #0757a6;
}

.customer-file-name {
  padding-top: 0;
}

.control-page-row {
  grid-template-columns: 110px 26px 140px minmax(170px, 1.6fr) 145px minmax(145px, 1fr) minmax(135px, 1fr) minmax(155px, 1fr) 75px 110px 36px;
  min-width: 1435px;
  align-items: center;
}

.control-pdf-view {
  width: 105px;
}

.control-file-preview {
  display: flex;
  width: 130px;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.control-file-preview .file-kind,
.control-file-preview .print-kind {
  width: 130px;
}

.control-file-preview .control-thumb {
  width: 130px;
  height: 96px;
}

.pdf-viewer {
  z-index: 100;
  padding: 18px;
}

.pdf-viewer-dialog {
  display: flex;
  width: min(1500px, 96vw);
  height: 94vh;
  flex-direction: column;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px #0008;
}

.pdf-viewer-dialog > header,
.pdf-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.pdf-viewer-dialog h2 {
  margin: 2px 0 10px;
}

.pdf-viewer-toolbar {
  padding: 8px 0 12px;
}

.pdf-viewer-toolbar button {
  min-width: 130px;
}

#pdfViewerFrame,
#adminPdfViewerFrame {
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 1px solid #b8cadb;
  border-radius: 10px;
  background: #e8edf2;
}

.pdf-viewer-dialog > small {
  padding-top: 7px;
  color: #667085;
  text-align: center;
}

@media (max-width: 560px) {
  .customer-file-row {
    grid-template-columns: 1fr;
  }
  .customer-file-name {
    padding-top: 0;
  }
  .pdf-viewer {
    padding: 4px;
  }
  .pdf-viewer-dialog {
    width: 99vw;
    height: 98vh;
    padding: 10px;
  }
  .pdf-viewer-toolbar button {
    min-width: 0;
  }
  .customer-page-grid {
    grid-template-columns: 92px 145px 340px 125px 78px 125px 90px 90px 130px 65px 82px 92px;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }
  body * {
    visibility: hidden;
  }
  #orderModal,
  #orderModal *,
  .print-customer-order,
  .print-customer-order * {
    visibility: visible;
  }
  #orderModal {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    background: #fff;
  }
  #orderModal .dialog-order {
    width: 100%;
    max-height: none;
    padding: 0;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }
  .print-customer-order {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100%;
    padding: 0;
    border: 0;
    background: #fff;
  }
  #orderModal > .dialog > .panel-head,
  #closeOrder,
  .print-order-button,
  .download-link,
  .admin-download-small,
  .locker-code-editor,
  .locker-code-wait,
  .admin-page-table .pdf-view-link {
    display: none !important;
  }
  .print-customer-order .print-order-button,
  .print-customer-order .pdf-view-link {
    display: none !important;
  }
  .order-detail-title,
  .order-detail-grid,
  .customer-page-grid {
    break-inside: avoid;
  }
  .admin-page-table {
    overflow: visible;
  }
  .admin-page-table .customer-page-head,
  .admin-page-table .customer-page-grid,
  .print-customer-order .customer-page-head,
  .print-customer-order .customer-page-grid {
    grid-template-columns: 90px minmax(180px, 2fr) 95px 55px 72px 72px 90px 48px 62px 68px;
    min-width: 0;
    gap: 7px;
    padding: 7px;
    font-size: 10px;
  }
  .admin-page-table .customer-page-head > span:first-child,
  .admin-page-table .customer-page-grid > :first-child,
  .print-customer-order .customer-page-head > span:first-child,
  .print-customer-order .customer-page-grid > :first-child {
    display: none;
  }
  .admin-page-table .customer-file-preview .file-kind,
  .admin-page-table .customer-file-preview .print-kind,
  .admin-page-table .customer-file-preview .placed-thumb {
    width: 82px;
  }
  .admin-page-table .customer-file-preview .placed-thumb {
    height: 58px;
  }
  .print-customer-order .customer-file-preview .file-kind,
  .print-customer-order .customer-file-preview .print-kind,
  .print-customer-order .customer-file-preview .placed-thumb {
    width: 82px;
  }
  .print-customer-order .customer-file-preview .placed-thumb {
    height: 58px;
  }
}

.order-filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(145px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid #c5e0f8;
  border-radius: 12px;
  background: #f1f8ff;
}
.order-filters label { color: #174e7d; font-size: 12px; font-weight: 800; }
.order-filters input,.order-filters select { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1px solid #abcbe7; border-radius: 8px; background: #fff; }
#filterResult { align-self: center; color: #155a91; white-space: nowrap; }
.backup-status { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #a8dfc8; border-radius: 12px; background: #edfaf5; }
.backup-status div { min-width: 0; }
.backup-status b,.backup-status span { display: block; }
.backup-status span { overflow: hidden; color: #376759; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.push-status { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #9fc7e8; border-radius: 12px; background: #eef7ff; }
.push-status div { min-width: 0; }
.push-status b,.push-status span,.push-status code { display: block; }
.push-status span { color: #315f84; font-size: 12px; }
.push-status code { margin-top: 3px; overflow: hidden; color: #174e7d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.live-refresh { display: block; margin-top: 6px; color: #087c55; font-weight: 750; }
.live-refresh.refresh-error { color: #b42318; }
.production-price-option { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12px; font-weight: 750; }
.edit-order-dialog { width: min(1100px, 96vw); }
.edit-order-dialog textarea { display: block; width: 100%; margin-top: 5px; padding: 9px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.edit-order-items { display: grid; gap: 8px; margin: 12px 0 18px; }
.edit-item { display: grid; grid-template-columns: minmax(260px, 1fr) 145px 130px 150px 170px 100px; gap: 12px; align-items: end; padding: 11px; border: 1px solid #d7e6f3; border-radius: 10px; background: #f6faff; }
.edit-item small { display: block; color: #667085; }
.edit-item label { color: #536275; font-size: 12px; font-weight: 750; }
.edit-item input,.edit-item select { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid #b8cbdd; border-radius: 8px; background: #fff; }
.shipping-toggle { margin-top: 8px; padding: 11px; border: 1px solid #a7cdea; border-radius: 10px; background: #eef7ff; color: #174e7d; }
.shipping-fields { grid-column: 1 / -1 !important; padding: 14px; border: 1px solid #8fc5ef; border-radius: 12px; background: linear-gradient(135deg,#edf6ff,#f8fbff); }
.shipping-fields h3 { margin: 0 0 12px; color: #174e7d; }
.shipping-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.shipping-grid label { color: #344054; font-size: 13px; font-weight: 750; }
.shipping-grid input,.shipping-grid select { display: block; width: 100%; margin-top: 4px; padding: 9px; border: 1px solid #abc7df; border-radius: 8px; background: #fff; }
.customer-order-info,.order-detail-grid { grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); }
.print-frame { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; border: 0; opacity: .01; pointer-events: none; }
.production-sheet { color: #101827; background: #fff; font: 12px/1.35 Arial,sans-serif; }
.production-sheet header { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 3px solid #123f65; }
.production-sheet header strong { display: block; color: #123f65; font-size: 25px; }
.production-sheet header small { letter-spacing: 2px; }
.production-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 12px 0; }
.production-summary div,.production-notes { padding: 9px; border: 1px solid #afc7dc; border-radius: 7px; }
.production-sheet table { width: 100%; border-collapse: collapse; }
.production-sheet th,.production-sheet td { padding: 7px; border: 1px solid #9eb3c5; text-align: left; vertical-align: top; }
.production-sheet th { color: #fff; background: #123f65; }
.production-sheet td small { display: block; color: #536275; }
.production-total { text-align: right; font-size: 15px; font-weight: 800; }
.production-sheet footer { margin-top: 18px; padding-top: 8px; border-top: 1px solid #9eb3c5; color: #536275; }
@media (max-width: 950px) {
  .order-filters { grid-template-columns: repeat(2,1fr); }
  .edit-item { grid-template-columns: 1fr 1fr; }
  .shipping-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) { .shipping-grid { grid-template-columns: 1fr; } }
@media print {
  body.production-printing * { visibility: hidden !important; }
  body.production-printing #productionPrint,body.production-printing #productionPrint * { visibility: visible !important; }
  body.production-printing #productionPrint { position: absolute; inset: 0; display: block !important; width: 100%; }
}

.article-code-field input{width:100%;background:#edf4fa;color:#123e60;font-weight:750!important}.article-code{font-variant-numeric:tabular-nums;color:#123e60}.packing-slip-editor{display:flex;gap:6px;align-items:center}.packing-slip-editor input{min-width:0;width:145px;padding:8px;border:1px solid #99b8d1;border-radius:7px}.packing-slip-editor button{flex-shrink:0}

/* Pakbon is visible beside the initial order controls, without scrolling right. */
.customer-order-row .column-number{white-space:normal;overflow-wrap:anywhere}
.customer-packing-number{display:block;margin-top:7px;padding:7px 9px;border:1px solid #a2cae9;border-radius:8px;background:#eaf4ff;color:#143d60;white-space:normal;overflow-wrap:anywhere}
.customer-packing-number>b{display:block;font-size:12px}.customer-packing-number>span{display:block;font-size:15px;font-weight:750}
.customer-packing-detail{margin-top:8px;padding:10px 13px;border:1px solid #a2cae9;border-radius:8px;background:#eaf4ff;color:#143d60;overflow-wrap:anywhere}

/* V1.6.35: formaat en materiaal als aparte kolommen; tabel compacter richting thumbnail/bestandsnaam */
.customer-page-head,.customer-page-grid{column-gap:9px}
.customer-file-name{min-width:0}
.customer-file-name>strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:normal}
.material-cell{font-weight:700;white-space:normal}

/* V1.6.37: besteller stap 2 compacter; kolommen direct na thumbnail/naam en verticaal uitgelijnd */
.order-rows { overflow-x: auto; }
.control-page-row {
  grid-template-columns: 96px 24px 126px minmax(210px,1.55fr) 112px 92px 112px 132px 148px 62px 92px 32px;
  column-gap: 8px;
  min-width: 1230px;
  align-items: start;
  padding-left: 8px;
  padding-right: 8px;
}
.control-pdf-view { width: 92px; margin-top: 28px; }
.control-file-preview { width: 120px; }
.control-file-preview .file-kind,
.control-file-preview .print-kind { width: 120px; }
.control-file-preview .control-thumb { width: 120px; height: 90px; }
.control-page-row .filename { padding-top: 25px; }
.control-page-row .control-field,
.control-page-row .control-price { align-self: start; margin-top: 0; }
.control-page-row .control-field > label,
.control-page-row label.control-field { margin-top: 0; }
.control-page-row .qty { margin-top: 0; }
.control-page-row .price.control-price { padding-top: 0; min-width: 0; text-align: right; }
.control-page-row .price.control-price small,
.control-page-row .price.control-price strong { white-space: nowrap; }
.control-page-row .remove { margin-top: 24px; }

/* V1.6.37: besteller stap 2 volledig binnen de werkbreedte; kolommen sluiten direct aan op thumbnail/naam */
.control-page-row {
  grid-template-columns: 88px 22px 108px minmax(175px,1fr) 96px 76px 92px 104px 112px 56px 78px 30px;
  column-gap: 6px;
  min-width: 0;
  width: 100%;
  align-items: start;
  padding-left: 4px;
  padding-right: 4px;
}
.control-pdf-view { width: 84px; }
.control-file-preview { width: 104px; }
.control-file-preview .file-kind,
.control-file-preview .print-kind { width: 104px; }
.control-file-preview .control-thumb { width: 104px; height: 82px; }
.control-page-row .filename { padding-top: 25px; }
.control-page-row .control-field select,
.control-page-row .control-field input { min-width: 0; padding-left: 6px; padding-right: 6px; }
.control-page-row .article-code-field { min-width: 0; }
.control-page-row .qty { width: 54px!important; }
.control-page-row .control-price { min-width: 74px; text-align: right; }
.control-page-row .control-price small,
.control-page-row .control-price strong { white-space: nowrap; }
