:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --panel: #ffffff;
  --page: #f3f6f8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --danger: #b42318;
  --soft: #e8f4f2;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --font-main: "Segoe UI", "Tahoma", "Arial", sans-serif;
  --font-number: "Segoe UI", "Arial", sans-serif;
  --boundary-font-size: clamp(15px, 1.45vw, 24px);
  --boundary-font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

.invoice-panel {
  margin-top: 16px;
}

.shipment-panel {
  border: 1px solid #bfe7df;
  background: linear-gradient(180deg, #fbfffe 0%, #ffffff 100%);
}

.shipment-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) repeat(4, minmax(130px, 0.8fr)) max-content;
  gap: 12px;
  align-items: end;
}

.shipment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.shipment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shipment-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(240px, 2fr) max-content max-content max-content max-content;
  gap: 10px;
  align-items: center;
}

.shipment-chip span,
.shipment-chip em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

.invoice-toolbar,
.invoice-meta-grid,
.invoice-party-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.invoice-toolbar {
  grid-template-columns: minmax(170px, 1fr) minmax(132px, 150px) minmax(210px, 1fr) minmax(160px, 0.9fr) minmax(140px, 0.8fr) minmax(132px, 150px);
  margin-bottom: 12px;
  overflow: hidden;
}

.invoice-toolbar button {
  min-width: 0;
}

.invoice-toolbar button:nth-last-child(-n + 4) {
  grid-row: 2;
  justify-self: start;
}

.invoice-toolbar button:nth-last-child(4) {
  grid-column: 1;
}

.invoice-toolbar button:nth-last-child(3) {
  grid-column: 2;
}

.invoice-toolbar button:nth-last-child(2) {
  grid-column: 3;
}

.invoice-toolbar button:nth-last-child(1) {
  grid-column: 4;
}

.invoice-party-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  margin: 14px 0;
}

.invoice-settings-panel {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #fbfffe;
  padding: 14px;
  margin: 12px 0 0;
}

.invoice-options-panel {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f6fffd;
  padding: 12px;
  margin: 12px 0 14px;
}

.invoice-options-panel summary {
  cursor: pointer;
  color: #0f766e;
  font-size: 17px;
  font-weight: 950;
  list-style-position: inside;
}

.invoice-options-panel:not([open]) {
  background: #fff;
}
}

.invoice-settings-grid,
.invoice-bl-settings,
.invoice-group-settings {
  display: grid;
  gap: 10px;
  align-items: end;
}

.invoice-settings-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) max-content repeat(2, minmax(130px, 1fr)) max-content;
}

.invoice-bl-settings {
  margin-top: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(260px, 2fr) max-content;
}

.invoice-group-settings {
  margin-top: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) max-content;
}

.wide-field {
  grid-column: span 1;
}

.invoice-party-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  display: grid;
  gap: 10px;
}

.invoice-party-card h3 {
  margin: 0;
  font-size: 17px;
}

.invoice-party-fields {
  display: grid;
  gap: 8px;
}

.invoice-meta-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.invoice-containers-host {
  display: grid;
  gap: 14px;
}

.invoice-container-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.invoice-container-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.invoice-container-total-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.invoice-container-total-edit label {
  min-width: 145px;
}

.invoice-container-total-edit input {
  min-height: 34px;
  padding: 6px 8px;
}

.invoice-container-card header strong {
  display: block;
  font-size: 17px;
}

.invoice-container-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-edit-table {
  min-width: 1360px;
}

.invoice-edit-table input {
  min-width: 120px;
}

.invoice-edit-table td:nth-child(2) input {
  min-width: 230px;
}

.invoice-totals-bar {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f0fdfa;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-weight: 900;
}

.invoice-saved-panel,
.invoice-preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  margin: 12px 0 14px;
}

.invoice-saved-rows {
  display: grid;
  gap: 10px;
}

.invoice-saved-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.1fr) minmax(360px, 1.4fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.invoice-saved-row.active {
  border-color: #0f766e;
  background: #f0fdfa;
}

.invoice-saved-row strong,
.invoice-saved-row span {
  display: block;
}

.invoice-saved-row strong {
  font-size: 17px;
}

.invoice-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-saved-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-saved-metrics span {
  color: var(--ink);
  background: #eef6ff;
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  padding: 4px 8px;
}

.invoice-saved-actions,
.invoice-preview-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.invoice-preview-tools {
  margin-bottom: 12px;
}

.invoice-preview-tools label {
  min-width: 150px;
}

.invoice-preview-host {
  min-height: 180px;
  max-height: 760px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
  padding: 16px;
}

.invoice-preview-host .customs-page {
  display: block;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 16px;
  padding: 8mm;
  box-shadow: var(--shadow);
}

.invoice-print {
  display: none;
}

.cost-view .section-title {
  align-items: start;
}

.cost-actions,
.cost-toolbar {
  display: grid;
  gap: 12px;
  align-items: end;
}

.cost-actions {
  grid-template-columns: repeat(3, max-content);
  margin-bottom: 14px;
}

.cost-toolbar {
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) minmax(260px, 1fr);
  margin-bottom: 12px;
}

.cost-status {
  color: #0f766e;
  font-weight: 950;
  min-height: 24px;
}

.cost-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.cost-search-results span {
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef6ff;
  color: #123a63;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.cost-saved-rows {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.cost-saved-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  border: 1px solid #cddff2;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.cost-saved-row.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 #0f766e;
}

.cost-saved-row strong,
.cost-saved-row span {
  display: block;
}

.cost-saved-row strong {
  font-size: 17px;
}

.cost-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-settings-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) max-content repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.cost-expense-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.cost-expense-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #99d9cf;
  border-radius: 8px;
  background: linear-gradient(180deg, #ecfdf8 0%, #f8fffd 100%);
  padding: 10px 12px;
}

.cost-expense-header strong,
.cost-expense-header span {
  display: block;
}

.cost-expense-header strong {
  color: #0f766e;
  font-size: 17px;
}

.cost-expense-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-expense-card {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: 8px;
  align-items: end;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.cost-expense-save {
  margin-top: 12px;
}

.cost-column-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.cost-summary div {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f0fdfa;
  padding: 10px 12px;
}

.cost-summary strong,
.cost-summary span {
  display: block;
}

.cost-summary strong {
  color: #0f172a;
  font-size: 18px;
}

.cost-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-table {
  min-width: 1780px;
}

.cost-table th {
  background: #f4f8fb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.cost-table td {
  vertical-align: middle;
}

.cost-table th,
.cost-table td {
  border-inline-end: 1px solid #d7e2ee;
}

.cost-table .cost-col-item {
  min-width: 210px;
}

.cost-table .cost-col-costbasis,
.cost-table .cost-col-pcsperpackage,
.cost-table .cost-col-sqmperpiece {
  background: #f8fafc;
}

.cost-table th.cost-col-truecostjod,
.cost-table td.cost-col-truecostjod,
.cost-print-table th.cost-col-truecostjod,
.cost-print-table td.cost-col-truecostjod {
  background: #ecfdf5;
  border-inline: 2px solid #0f766e;
  color: #064e3b;
  font-weight: 950;
}

.cost-table td.cost-col-truecostjod {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.cost-table th.cost-col-expenseshare,
.cost-table td.cost-col-expenseshare {
  background: #fffbeb;
  color: #92400e;
}

.cost-table small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
}

.cost-table input {
  min-width: 110px;
}

.cost-page {
  padding: 8mm;
}

.cost-print-header {
  border: 2px solid #0f172a;
  border-bottom: 0;
  padding: 8px 10px;
  text-align: center;
}

.cost-print-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.cost-print-header p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 900;
}

.cost-print-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 2px solid #0f172a;
  border-bottom: 0;
}

.cost-print-summary span {
  border-inline-end: 1px solid #0f172a;
  padding: 7px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 950;
}

.cost-print-summary b {
  display: block;
  color: #0f766e;
  font-size: 10px;
  margin-bottom: 3px;
}

.cost-print-summary span:last-child {
  border-inline-end: 0;
}

.cost-print-expenses {
  border: 2px solid #0f172a;
  border-bottom: 0;
  padding: 7px;
}

.cost-print-expenses h2,
.cost-print-section h2 {
  margin: 0 0 6px;
  background: #0f172a;
  color: #fff;
  padding: 5px 8px;
  font-size: 13px;
  text-align: center;
}

.cost-print-expenses div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 5px;
}

.cost-print-expenses span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  padding: 5px 7px;
  font-size: 11px;
}

.cost-print-section {
  border: 2px solid #0f172a;
  border-top: 0;
  padding: 7px;
}

.cost-print-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.cost-print-table th,
.cost-print-table td {
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.cost-print-table th {
  background: #dbeafe;
}

.cost-print-table th small {
  display: block;
  color: #334155;
  font-size: 8px;
  margin-top: 2px;
}

.cost-print-table td:first-child,
.cost-print-table th:first-child {
  text-align: start;
}

.cost-print-table.price-table th {
  background: #dcfce7;
}

.cost-print-table .cost-col-expenseshare {
  background: #fff7ed;
}

.customs-page {
  color: #000;
  background: #fff;
  font-family: Arial, Tahoma, sans-serif;
  direction: ltr;
  font-size: 11px;
  font-weight: 700;
}

.customs-family-arial {
  font-family: Arial, Tahoma, sans-serif;
}

.customs-family-tahoma {
  font-family: Tahoma, Arial, sans-serif;
}

.customs-family-calibri {
  font-family: Calibri, Arial, sans-serif;
}

.customs-font-compact {
  font-size: 10px;
}

.customs-font-normal {
  font-size: 11px;
}

.customs-font-readable {
  font-size: 12px;
}

.customs-font-large {
  font-size: 12.5px;
}

.customs-font-xlarge {
  font-size: 13.5px;
}

.customs-three-per-page {
  padding: 4.2mm;
}

.customs-header {
  text-align: center;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

.customs-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.customs-header p {
  margin: 4px 0;
  font-size: 13px;
  font-weight: 800;
}

.customs-header h2 {
  margin: 4px 0 2px;
  font-size: 20px;
  text-decoration: underline;
}

.customs-meta,
.packing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-inline-start: 1px solid #000;
  border-top: 1px solid #000;
}

.customs-party-meta {
  grid-template-columns: 1.35fr 1.35fr 0.8fr 0.8fr;
}

.packing-meta.customs-party-meta {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.45fr) minmax(86px, 0.42fr) minmax(96px, 0.46fr);
}

.customs-meta div,
.packing-meta div {
  min-height: 22px;
  border-inline-end: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 4px 6px;
  white-space: pre-line;
  text-align: center;
  display: grid;
  place-items: center;
  gap: 2px;
}

.customs-party span,
.customs-party strong {
  display: block;
  line-height: 1.25;
  text-align: center;
}

.packing-meta .packing-party {
  place-items: stretch;
  align-content: start;
  justify-items: stretch;
  min-height: 58px;
  text-align: left;
}

.packing-meta .packing-party b {
  width: 100%;
  text-align: center;
  font-size: 1.08em;
  letter-spacing: 0;
}

.packing-meta .packing-party span {
  width: 100%;
  text-align: left;
  line-height: 1.35;
  white-space: pre-line;
}

.packing-meta .packing-shipper,
.packing-meta .packing-consignee {
  grid-column: span 2;
}

.packing-meta .packing-mini {
  min-width: 0;
  padding-inline: 3px;
  font-size: 0.95em;
}

.packing-meta .packing-mini strong {
  font-size: 1.05em;
  line-height: 1.2;
  word-break: break-word;
}

.packing-meta .packing-port {
  min-height: 42px;
}

.customs-meta div:nth-child(1),
.customs-meta div:nth-child(2),
.customs-meta div:nth-child(3) {
  grid-column: span 1;
}

.customs-meta div:nth-child(4),
.customs-meta div:nth-child(5) {
  grid-column: span 1;
}

.packing-total {
  grid-column: span 3;
  text-align: center;
  display: grid;
  gap: 4px;
}

.customs-party-meta .packing-total {
  grid-column: 1 / -1;
}

.packing-total b {
  font-size: 13px;
}

.packing-total strong {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #000;
  background: #f6f6f6;
  font-size: 15px;
  letter-spacing: 0;
  word-spacing: 3px;
}

.customs-container {
  break-inside: avoid;
}

.customs-packing .packing-table th,
.customs-packing .packing-table td {
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
}

.customs-packing .packing-table .customs-description-cell {
  text-align: left;
  font-weight: 800;
}

.invoice-table .customs-group-col,
.packing-table .customs-group-col {
  width: 15%;
}

.invoice-table .customs-description-col {
  width: 25%;
}

.invoice-table .customs-qty-col {
  width: 8%;
}

.invoice-table .customs-price-col {
  width: 10%;
}

.invoice-table .customs-money-col,
.invoice-table .customs-weight-col {
  width: 11.5%;
}

.packing-table .customs-description-col {
  width: 36%;
}

.packing-table .customs-qty-col {
  width: 12%;
}

.packing-table .customs-weight-col {
  width: 12.5%;
}

.customs-table .customs-description-heading,
.customs-table .customs-description-cell {
  white-space: nowrap;
}

.customs-table .customs-description-cell {
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: 0;
  word-spacing: 1px;
  font-size: 0.95em;
}

.invoice-table .customs-price-heading,
.invoice-table .customs-tight-heading {
  overflow: hidden;
  word-break: normal;
  overflow-wrap: normal;
  letter-spacing: 0;
}

.invoice-table .customs-price-heading {
  padding-inline: 2px;
  font-size: 0.92em;
  line-height: 1.12;
}

.invoice-table .customs-price-heading span {
  display: block;
  white-space: nowrap;
}

.invoice-table .customs-tight-heading {
  padding-inline: 1px;
  white-space: nowrap;
  font-size: 0.82em;
  line-height: 1.05;
}

.customs-invoice .invoice-table .customs-description-cell,
.customs-packing .packing-table .customs-description-cell {
  text-align: left;
}

.customs-container-bar {
  background: #d9d9d9;
  border: 1px solid #000;
  border-top: 0;
  padding: 4px 5px;
  font-size: 12px;
  font-weight: 900;
}

.customs-table,
.customs-total-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.customs-table th,
.customs-table td,
.customs-total-table th,
.customs-total-table td {
  border: 1px solid #000;
  padding: 4px 5px;
  text-align: center;
  vertical-align: middle;
}

.customs-table th {
  font-size: 13px;
}

.customs-three-per-page.customs-font-compact {
  font-size: 9.2px;
}

.customs-three-per-page.customs-font-normal {
  font-size: 10px;
}

.customs-three-per-page.customs-font-readable {
  font-size: 10.8px;
}

.customs-three-per-page.customs-font-large {
  font-size: 11.3px;
}

.customs-three-per-page.customs-font-xlarge {
  font-size: 11.8px;
}

.customs-three-per-page .customs-header h1 {
  font-size: 18px;
}

.customs-three-per-page.customs-font-readable .customs-header h1,
.customs-three-per-page.customs-font-large .customs-header h1,
.customs-three-per-page.customs-font-xlarge .customs-header h1 {
  font-size: 20px;
}

.customs-three-per-page .customs-header h2 {
  font-size: 14px;
}

.customs-three-per-page.customs-font-readable .customs-header h2,
.customs-three-per-page.customs-font-large .customs-header h2,
.customs-three-per-page.customs-font-xlarge .customs-header h2 {
  font-size: 16px;
}

.customs-three-per-page .customs-header p,
.customs-three-per-page .customs-container-bar {
  font-size: 9.5px;
}

.customs-three-per-page.customs-font-readable .customs-header p,
.customs-three-per-page.customs-font-readable .customs-container-bar,
.customs-three-per-page.customs-font-large .customs-header p,
.customs-three-per-page.customs-font-large .customs-container-bar,
.customs-three-per-page.customs-font-xlarge .customs-header p,
.customs-three-per-page.customs-font-xlarge .customs-container-bar {
  font-size: 10.5px;
}

.customs-three-per-page .customs-meta div,
.customs-three-per-page .packing-meta div {
  min-height: 17px;
  padding: 2px 4px;
}

.customs-three-per-page .packing-meta .packing-party {
  min-height: 46px;
}

.customs-three-per-page .packing-meta .packing-port {
  min-height: 30px;
}

.customs-three-per-page .customs-container {
  margin-top: 3px;
}

.customs-three-per-page .customs-table,
.customs-three-per-page .customs-total-table {
  font-size: inherit;
}

.customs-three-per-page .customs-table th {
  font-size: 1.08em;
}

.customs-three-per-page .invoice-table .customs-price-heading {
  font-size: 0.92em;
}

.customs-three-per-page .invoice-table .customs-tight-heading {
  font-size: 0.82em;
}

.customs-three-per-page .customs-table th,
.customs-three-per-page .customs-table td,
.customs-three-per-page .customs-total-table th,
.customs-three-per-page .customs-total-table td {
  padding: 2px 3px;
}

.customs-total-row td,
.customs-total-table th,
.customs-total-table td {
  font-size: 13px;
  font-weight: 900;
}

.invoice-total-row td,
.packing-container-total-row td {
  background: #f3f4f6;
  font-weight: 900;
}

.invoice-total-row td:nth-last-child(-n + 2),
.packing-container-total-row td:nth-last-child(-n + 2) {
  background: #e8f5f3;
}

.packing-grand-summary {
  margin-top: 5px;
  border: 2px solid #000;
  table-layout: fixed;
}

.packing-grand-summary td {
  background: #e8f5f3;
  color: #08111f;
  padding: 4px 7px;
  font-size: 12.5px;
  white-space: nowrap;
  border-inline-end: 2px solid #000;
}

.packing-grand-summary td:last-child {
  border-inline-end: 1px solid #000;
}

.packing-grand-summary td span,
.packing-grand-summary td strong {
  display: inline-block;
  vertical-align: middle;
}

.packing-grand-summary td span {
  color: #111827;
  font-weight: 950;
  margin-inline-end: 8px;
}

.packing-grand-summary td strong {
  color: #006c5b;
  font-size: 13.5px;
  font-weight: 950;
}

.customs-amount,
.customs-origin {
  margin: 0;
  padding: 6px;
  border: 1px solid #000;
  border-top: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.invoice-grand-total {
  margin-top: 4px;
}

.invoice-grand-total th {
  width: 72%;
}

.invoice-grand-total td {
  font-size: 15px;
}

@media print {
  body.printing-bol > * {
    display: none !important;
  }

  body.printing-bol main,
  body.printing-bol #bolView {
    display: block !important;
  }

  body.printing-bol main > *:not(#bolView),
  body.printing-bol .print-report {
    display: none !important;
  }

  body.printing-bol #bolView {
    width: 100%;
    color: #111827;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-bol .bol-panel {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.printing-bol .bol-toolbar {
    grid-template-columns: repeat(3, 1fr);
    padding: 6px 0 9px;
    border-bottom: 2px solid #111827;
  }

  body.printing-bol .bol-toolbar button {
    display: none !important;
  }

  body.printing-bol .bol-toolbar input,
  body.printing-bol .bol-toolbar select {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 900;
  }

  body.printing-bol .bol-columns {
    grid-template-columns: 1fr;
    gap: 8mm;
  }

  body.printing-bol .bol-side {
    border: 2px solid #cbd5e1;
    background: #fff;
    break-inside: avoid;
  }

  body.printing-bol .bol-card {
    break-inside: avoid;
  }

  body.printing-bol .bol-mini-table {
    width: 100%;
    font-size: 12px;
  }

  body.printing-bol .bol-mini-table th {
    background: #111827;
    color: #fff;
  }

  body.printing-bol .bol-mini-table td {
    background: #fbfcfe;
  }

  body.printing-bol .bol-mini-table input,
  body.printing-bol .bol-mini-table select {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-weight: 800;
    color: #111827;
  }

  body.printing-bol .proposal-card th:last-child,
  body.printing-bol .proposal-card td:last-child {
    display: none;
  }
}

@media (max-width: 980px) {
  .cost-actions,
  .cost-toolbar,
  .cost-saved-row,
  .cost-settings-grid {
    grid-template-columns: 1fr;
  }

  .cost-expense-settings {
    grid-template-columns: 1fr;
  }

  .cost-expense-card,
  .cost-expense-header {
    grid-template-columns: 1fr;
  }

  .invoice-saved-row {
    grid-template-columns: 1fr;
  }

  .invoice-preview-host .customs-page {
    width: 100%;
    min-width: 820px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-main);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="text"]:not(#loginUsername),
input[type="search"],
textarea {
  text-transform: uppercase;
}

button,
.file-button {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.file-button:focus-within {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.format-button {
  width: 48px;
  min-width: 48px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
}

.format-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.format-button.pdf .format-icon {
  background: #dc2626;
}

.format-button.xls .format-icon {
  background: #15803d;
}

.format-button:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

#saveLoadBtn.editing-load {
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.secondary,
.file-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover,
.file-button:hover {
  border-color: #9fb0c2;
}

.danger {
  background: #fff6f5;
  border-color: #f1b8b2;
  color: var(--danger);
}

.file-button input {
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  position: absolute;
}

.auth-locked .app-header,
.auth-locked main {
  display: none;
}

.login-overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #101828, #1f2937);
}

.login-overlay[hidden] {
  display: none;
}

.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.45);
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 14px;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
}

.login-card input {
  text-transform: none;
}

.login-message {
  min-height: 22px;
  color: var(--danger);
  font-weight: 800;
}

.login-reset-link {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.login-reset-link:hover {
  text-decoration: underline;
}

.password-card {
  max-width: 440px;
}

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

.app-header {
  min-height: 112px;
  padding: 22px 32px;
  background: #101828;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.35fr) minmax(260px, 0.9fr);
  align-items: center;
  justify-content: stretch;
  gap: 24px;
}

.save-status {
  grid-column: 1 / -1;
  min-height: 22px;
  color: #d1fae5;
  font-weight: 900;
}

.save-status[data-type="success"] {
  color: #a7f3d0;
}

.save-status[data-type="error"] {
  color: #fecaca;
}

.save-status[data-type="info"] {
  color: #bfdbfe;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.top-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tab-button {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.08);
  color: #d0d5dd;
  border-color: rgba(255, 255, 255, 0.14);
}

.tab-button.active {
  background: #fff;
  color: #101828;
}

.eyebrow {
  margin: 0;
  color: #8da4bd;
  font-size: 13px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-content: flex-start;
}

.global-bol-center {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  margin: 0;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  min-width: 0;
}

.global-bol-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: end;
}

.global-bol-search label,
.global-ai-panel label {
  display: grid;
  gap: 5px;
  color: #d0d5dd;
  font-size: 12px;
  font-weight: 900;
}

.global-bol-search select,
.global-bol-search input,
.global-ai-panel input {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #fff;
  color: #101828;
  padding: 8px 10px;
}

.global-bol-search label {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(170px, 0.75fr);
  gap: 8px;
  min-width: 0;
}

.global-bol-search label > span {
  grid-column: 1 / -1;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.list-pagination span {
  margin-inline-end: auto;
}

.global-report-center {
  border: 1px solid rgba(167, 243, 208, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  padding: 12px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  max-height: 340px;
  overflow: auto;
}

.global-report-center[hidden] {
  display: none !important;
}

.global-report-center header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.global-report-center header strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.global-report-center header span {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 850;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
}

.global-report-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.global-report-actions button {
  width: 100%;
  justify-content: center;
}

.report-action-set {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.report-action-set > button:first-child {
  min-width: 170px;
}

.global-report-actions .report-action-set .format-button {
  width: 46px;
  min-width: 46px;
}

.global-report-actions .strong-action {
  border-color: #2dd4bf;
}

.global-ai-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content;
  gap: 8px;
  align-items: end;
}

.global-ai-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: #d1fae5;
  font-size: 13px;
  font-weight: 850;
}

.global-ai-results span {
  display: block;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 9px;
  color: #e0f2fe;
}

.language-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #d0d5dd;
}

.language-field span {
  color: #d0d5dd;
  margin: 0;
}

.language-field select {
  min-width: 118px;
  width: auto;
}

main {
  width: min(1480px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.intro-panel {
  display: grid;
  gap: 16px;
}

.form-grid,
.dimensions-row {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.dimensions-row {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  align-items: end;
}

.intro-panel > .dimensions-row {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.catalog-panel {
  margin: 16px 0;
}

.catalog-form {
  display: grid;
  grid-template-columns: minmax(155px, 0.9fr) minmax(180px, 1.35fr) repeat(7, minmax(105px, 1fr)) minmax(190px, 1.2fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.catalog-group-settings {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) max-content minmax(240px, 2fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #fbfffe;
}

.catalog-group-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.catalog-group-list span {
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ink);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-actions strong {
  color: var(--accent-dark);
  min-width: 96px;
}

.catalog-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.catalog-list-header div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-list-header strong {
  font-size: 15px;
}

.catalog-list-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.catalog-table {
  min-width: 1040px;
}

.merge-panel,
.catalog-panel {
  margin: 16px 0;
}

.merge-builder {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.merge-choice {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.merge-choice input {
  width: auto;
  min-height: auto;
}

.merged-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.merged-card {
  border-color: #7dd3c7;
  background: #fbfffe;
}

.remove-merge {
  margin-top: 12px;
}

.merged-note {
  background: rgba(15, 118, 110, 0.12);
  border-radius: 5px;
  padding: 3px 5px;
}

.dimensions-row.compact {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  margin: 18px 0;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input[type="number"],
.number-cell,
.metric strong,
.line-total,
.part-totals span {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h2,
.part-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.visual-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.visual-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  font-weight: 800;
}

.visual-toggle input {
  width: auto;
  min-height: auto;
}

.visual-control {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.visual-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drawing-target-select {
  min-width: min(360px, 100%);
  width: 360px;
}

#drawingStatus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.container-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  direction: ltr;
  min-height: 190px;
  margin-top: 118px;
  border: 5px solid #344054;
  border-left-width: 16px;
  background: #eef4f6;
  overflow: visible;
}

.container-visual.drawing-mode {
  cursor: crosshair;
  touch-action: none;
}

.container-visual::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 16px;
  display: block;
  background: repeating-linear-gradient(
    45deg,
    #ef4444,
    #ef4444 8px,
    #facc15 8px,
    #facc15 16px
  );
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22);
  z-index: 9;
  pointer-events: none;
}

.visual-door-label {
  position: absolute;
  top: -112px;
  left: -2px;
  color: #fff;
  background: #dc2626;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 950;
  z-index: 12;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.28);
  text-transform: uppercase;
}

.visual-door-label::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 22px;
  width: 3px;
  height: 16px;
  background: #dc2626;
}

.visual-ruler {
  position: absolute;
  left: 0;
  right: 0;
  top: -74px;
  height: 34px;
  border-block-end: 2px solid #344054;
  z-index: 7;
  pointer-events: none;
}

.visual-ruler::before,
.visual-ruler::after {
  content: "";
  position: absolute;
  inset-block-end: -6px;
  width: 2px;
  height: 12px;
  background: #344054;
}

.visual-ruler::before {
  left: 0;
}

.visual-ruler::after {
  right: 0;
}

.visual-ruler-tick {
  position: absolute;
  inset-block-end: -2px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 3px;
}

.visual-ruler-tick i {
  width: 1px;
  height: 12px;
  background: #344054;
}

.visual-ruler-tick b {
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  font-family: var(--font-number);
}

.visual-section-labels {
  position: absolute;
  left: 0;
  right: 0;
  top: -40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  direction: ltr;
  gap: 6px;
  z-index: 7;
  pointer-events: none;
}

.visual-section-label {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 8px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.visual-section-label strong,
.visual-section-label span,
.visual-section-label small {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-section-label strong {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.visual-section-label span,
.visual-section-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.visual-drawing-tip {
  position: absolute;
  right: 0;
  top: -108px;
  max-width: min(460px, 62%);
  color: #475467;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  z-index: 7;
  text-align: end;
}

.visual-part {
  position: relative;
  z-index: 1;
  border-left: 1px dashed #8aa0b4;
  min-width: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.visual-part:first-child {
  background: #d9f0ed;
}

.visual-fill {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.26), rgba(15, 118, 110, 0.58));
  transition: height 160ms ease;
}

.visual-stack {
  position: relative;
  z-index: 1;
  min-height: 42px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.visual-stack-bottom {
  align-content: end;
}

.visual-item-tag {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-inline-start: 6px solid var(--item-color);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}

.visual-item-tag b {
  min-width: 0;
  color: color-mix(in srgb, var(--item-color) 78%, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-item-tag strong {
  flex: 0 0 auto;
  color: #b42318;
  font-family: var(--font-number);
  white-space: nowrap;
}

.visual-item-tag em {
  color: #344054;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-merge-zone {
  position: absolute;
  z-index: 2;
  min-height: 24px;
  border: 3px solid rgba(180, 83, 9, 0.82);
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 248, 235, 0.58),
    rgba(255, 248, 235, 0.58) 10px,
    rgba(254, 223, 137, 0.34) 10px,
    rgba(254, 223, 137, 0.34) 20px
  );
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 12px 28px rgba(180, 83, 9, 0.12);
}

.visual-merge-zone span {
  position: absolute;
  top: 8px;
  left: 10px;
  max-width: calc(100% - 12px);
  color: #fff;
  background: rgba(122, 63, 5, 0.9);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-drawing-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: auto;
}

.visual-drawing-layer.hidden {
  display: none;
}

.visual-boundary {
  position: absolute;
  min-width: 40px;
  min-height: 24px;
  border: 3px solid var(--item-color, var(--accent));
  background: color-mix(in srgb, var(--item-color, var(--accent)) 18%, rgba(255, 255, 255, 0.4));
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
  overflow: hidden;
  cursor: move;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-boundary.active {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

.visual-boundary.draft {
  --item-color: #101828;
  border-style: dashed;
  background: rgba(16, 24, 40, 0.08);
}

.boundary-label {
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  font-family: var(--boundary-font-family);
  font-size: var(--boundary-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
}

.boundary-name {
  min-width: 0;
  max-width: 100%;
  color: color-mix(in srgb, var(--item-color, var(--accent)) 78%, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boundary-packages {
  color: #b42318;
  font-size: 1.08em;
  font-family: var(--font-number);
  white-space: nowrap;
}

.boundary-group {
  max-width: 100%;
  color: #475467;
  font-size: 0.58em;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.boundary-packages em {
  color: #344054;
  font-style: normal;
  font-size: 0.7em;
  font-weight: 900;
  text-transform: uppercase;
}

.boundary-resize-handle,
.visual-boundary::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 11px;
  height: 11px;
}

.boundary-resize-handle {
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: nwse-resize;
}

.visual-boundary::after {
  pointer-events: none;
  border-inline-end: 2px solid rgba(255, 255, 255, 0.95);
  border-block-end: 2px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 1px rgba(16, 24, 40, 0.4));
}

.alerts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.alert {
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 700;
}

.alert.warn {
  background: #fff8eb;
  color: var(--warn);
  border: 1px solid #fedf89;
}

.alert.danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.parts {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.part-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.part-eyebrow {
  color: var(--accent);
}

.part-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.part-totals span {
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: right;
  vertical-align: top;
}

html[dir="ltr"] th,
html[dir="ltr"] td {
  text-align: left;
}

th {
  background: #f7fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

td input,
td select {
  min-width: 92px;
}

.drawing-target-row {
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 var(--accent);
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 6px;
}

.item-detail {
  min-width: 190px;
  color: var(--muted);
  font-weight: 800;
}

.line-total {
  min-width: 118px;
  color: var(--muted);
  font-weight: 800;
}

.add-item {
  margin-top: 12px;
}

.summary-panel,
.saved-panel {
  margin-top: 16px;
}

.saved-loads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.saved-folder {
  border: 1px solid #bfe7df;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfffe 0%, #ffffff 100%);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
  padding: 14px;
}

.saved-folder-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, max-content);
  gap: 14px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.saved-folder-header strong,
.saved-folder-header span,
.saved-folder-header em {
  display: block;
}

.saved-folder-header strong {
  font-size: 20px;
  color: #0f172a;
}

.saved-folder-header span,
.saved-folder-header em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.saved-folder-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) max-content max-content max-content max-content;
  gap: 8px;
  align-items: end;
}

.saved-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.saved-card {
  border: 1px solid #d6e3f2;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fbfcff;
  border-inline-start: 4px solid #3b82f6;
}

.saved-card strong {
  font-size: 16px;
}

.saved-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.saved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bol-panel {
  margin-top: 16px;
}

.bol-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.2fr) repeat(2, minmax(130px, 165px)) repeat(5, max-content);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.bol-hidden-control {
  display: none !important;
}

.bol-status {
  min-height: 28px;
  color: var(--accent-dark);
  font-weight: 800;
  margin-bottom: 12px;
}

.bol-saved-rows {
  margin: 10px 0 16px;
  border: 1px solid #bfe7df;
  border-radius: 10px;
  background: #fbfffe;
  padding: 12px;
}

.bol-saved-table {
  display: grid;
  gap: 8px;
}

.bol-saved-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(4, minmax(115px, 0.8fr)) max-content;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  border-inline-start: 5px solid #0f766e;
}

.bol-saved-row.active {
  border-color: #0f766e;
  box-shadow: inset 4px 0 0 #0f766e;
}

.bol-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bol-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bol-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.bol-columns.paired {
  grid-template-columns: 1fr;
}

.bol-columns.paired .proposed-side {
  display: none;
}

.bol-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.04);
}

.bol-side:first-child {
  border-color: #b8d7ff;
  background: #f8fbff;
}

.proposed-side {
  background: #fbfffe;
  border-color: #bfe7df;
}

.compact-title h3 {
  margin: 0;
  font-size: 18px;
}

.bol-list {
  display: grid;
  gap: 12px;
}

.bol-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid #d8e6f8;
  border-radius: 10px;
  background: linear-gradient(90deg, #f8fbff 0%, #ffffff 50%, #fbfffe 100%);
  padding: 12px;
}

.bol-pair-row > .actual-card {
  border-inline-start: 5px solid #2563eb;
  background: #f8fbff;
}

.bol-pair-row > .proposal-card {
  border-inline-start: 5px solid #0f766e;
  background: #fbfffe;
}

.bol-pair-head {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.bol-pair-head.actual {
  color: #1d4ed8;
}

.bol-pair-head.proposed {
  color: #0f766e;
}

.bol-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 100%;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.035);
}

.bol-line-name {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.bol-line-group {
  display: inline-block;
  margin-inline-start: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bol-side:first-child .bol-card {
  border-inline-start: 4px solid #3b82f6;
}

.proposed-side .bol-card {
  border-inline-start: 4px solid #0f766e;
}

.missing-proposal {
  border-style: dashed;
  opacity: 0.72;
}

.bol-print-grid {
  display: grid;
  gap: 8px;
}

.bol-print-container {
  break-inside: avoid;
}

.bol-print-container h2 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.bol-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.bol-card header strong {
  display: block;
  font-size: 16px;
}

.bol-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bol-mini-table {
  min-width: 0;
}

.bol-mini-table input {
  min-width: 90px;
}

.bol-item-input {
  min-width: 180px;
}

.bol-number-input {
  max-width: 130px;
}

.proposed-line-total,
.proposal-total-weight {
  min-width: 120px;
  white-space: nowrap;
  font-weight: 800;
}

.smart-search {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.saved-filters,
.backup-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.backup-actions {
  grid-template-columns: repeat(3, minmax(170px, max-content)) minmax(260px, 1fr);
  justify-content: start;
  align-items: center;
}

.backup-status {
  border: 1px solid #b7e4d8;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.invoice-quality-panel {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  display: grid;
  gap: 8px;
  font-weight: 800;
  margin: 12px 0;
  padding: 12px 14px;
}

.invoice-quality-panel.success {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.invoice-quality-panel.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.invoice-quality-panel ul {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding-inline-start: 20px;
}

.server-pagination {
  margin-top: 12px;
}

.search-results h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.search-table {
  min-width: 1040px;
}

.search-belongs {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.print-report {
  display: none;
}

@media (max-width: 980px) {
  .app-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: stretch;
  }

  .global-bol-center,
  .global-bol-search,
  .global-ai-panel {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .global-bol-search label {
    grid-template-columns: 1fr;
  }

  .invoice-toolbar button:nth-last-child(-n + 4) {
    grid-row: auto;
    grid-column: auto;
    justify-self: stretch;
  }

  .header-actions > * {
    flex: 1 1 130px;
  }

  .form-grid,
  .catalog-form,
  .catalog-group-settings,
  .saved-folder-header,
  .saved-folder-actions,
  .bol-saved-row,
  .bol-pair-row,
  .invoice-toolbar,
  .invoice-meta-grid,
  .invoice-party-grid,
  .invoice-settings-grid,
  .invoice-bl-settings,
  .invoice-group-settings,
  .shipment-grid,
  .shipment-chip,
  .bol-toolbar,
  .bol-columns,
  .saved-filters,
  .dimensions-row,
  .dimensions-row.compact,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 20px, 1480px);
    margin-top: 12px;
  }

  .app-header {
    padding: 18px;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .form-grid,
  .catalog-form,
  .invoice-toolbar,
  .invoice-meta-grid,
  .invoice-party-grid,
  .invoice-settings-grid,
  .invoice-bl-settings,
  .invoice-group-settings,
  .shipment-grid,
  .shipment-chip,
  .bol-toolbar,
  .bol-columns,
  .saved-filters,
  .backup-actions,
  .dimensions-row,
  .dimensions-row.compact,
  .metrics {
    grid-template-columns: 1fr;
  }

  .container-visual {
    grid-template-columns: 1fr;
    min-height: 520px;
  }

  .visual-part {
    border-block-start: 1px dashed #8aa0b4;
    border-inline-start: 0;
  }
}

@media screen and (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body:not(.auth-locked) {
    min-width: 0;
  }

  .app-header {
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    padding: 14px 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
  }

  .app-header > *,
  .top-tabs,
  .header-actions,
  .global-bol-center,
  .global-bol-search,
  .global-ai-panel {
    min-width: 0;
    max-width: 100%;
  }

  .app-header h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  .top-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .tab-button,
  .header-actions button,
  .header-actions .file-button,
  .header-actions select,
  .global-bol-search button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 13px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 7px;
  }

  .language-field,
  .global-bol-search label,
  .global-ai-panel label {
    min-width: 0;
    max-width: 100%;
  }

  .global-bol-search {
    grid-template-columns: 1fr;
  }

  .global-bol-search label {
    grid-template-columns: 1fr;
  }

  main {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 32px;
    padding: 0 10px;
    overflow-x: hidden;
  }

  .panel,
  .invoice-panel,
  .shipment-panel,
  .invoice-settings-panel,
  .invoice-options-panel,
  .saved-folder,
  .bol-panel,
  .invoice-container-card,
  .cost-card {
    max-width: 100%;
    overflow: hidden;
    padding: 12px;
  }

  input,
  select,
  textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap,
  .invoice-preview-host,
  .invoice-containers-host,
  .saved-folder-body,
  .bol-side,
  .cost-table-shell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .container-visual {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 245px;
    margin-top: 130px;
    overflow: hidden;
  }

  .visual-section-labels {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .visual-section-label {
    padding: 4px 5px;
  }

  .visual-section-label strong {
    font-size: 11px;
  }

  .visual-section-label span,
  .visual-section-label small,
  .visual-ruler-tick b,
  .visual-drawing-tip {
    font-size: 9px;
  }

  .visual-drawing-tip {
    left: 0;
    right: 0;
    max-width: 100%;
    top: -124px;
  }

  .visual-door-label {
    top: -124px;
    left: 0;
    padding: 6px 8px;
    font-size: 11px;
  }

  .visual-part {
    border-block-start: 0;
    border-inline-start: 1px dashed #8aa0b4;
    min-width: 0;
  }

  .visual-part:first-child {
    border-inline-start: 0;
  }

  .login-overlay {
    padding: 16px;
    overflow: hidden;
  }

  .login-card {
    width: min(100%, 420px);
    padding: 20px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  body {
    background: #fff;
  }

  body > *,
  main > *:not(.print-report) {
    display: none !important;
  }

  main,
  .print-report {
    display: block !important;
  }

  .header-actions,
  .saved-panel,
  .add-item,
  .danger,
  .file-button {
    display: none !important;
  }

  .app-header {
    background: #fff;
    color: #111827;
    border-bottom: 2px solid #111827;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .panel,
  .metric {
    box-shadow: none;
    break-inside: avoid;
  }

  .report-page {
    width: 100%;
    min-height: 281mm;
    color: #111827;
    font-size: 13px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-header {
    border-bottom: 2px solid #111827;
    padding-bottom: 5px;
    margin-bottom: 7px;
  }

  .report-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
  }

  .report-header div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .report-plan {
    position: relative;
    direction: ltr;
    margin: 18mm 0 7px;
  }

  .report-door-label {
    position: absolute;
    top: -15mm;
    left: 0;
    background: #dc2626;
    color: #fff;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .report-door-label::after {
    content: "";
    position: absolute;
    bottom: -7mm;
    left: 15px;
    width: 3px;
    height: 7mm;
    background: #dc2626;
  }

  .report-part-labels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    direction: ltr;
    gap: 4px;
    margin-bottom: 4px;
  }

  .report-part-label {
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    padding: 4px 5px;
    background: #f8fafc;
  }

  .report-part-label strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
  }

  .report-part-label span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: #475467;
  }

  .report-part-label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 900;
    color: #111827;
  }

  .report-container-visual {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    direction: ltr;
    border: 3px solid #111827;
    border-left-width: 11px;
    height: 70mm;
    margin-bottom: 7px;
    overflow: hidden;
    background: #eef4f6;
  }

  .report-visual-part {
    border-left: 1px dashed #667085;
    min-width: 0;
  }

  .report-merge-zone {
    position: absolute;
    inset-block: 2mm;
    border: 2px solid #b45309;
    border-radius: 5px;
    background: rgba(254, 223, 137, 0.22);
  }

  .report-merge-zone span {
    position: absolute;
    top: 2mm;
    left: 2mm;
    background: #92400e;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 900;
  }

  .report-boundary {
    position: absolute;
    border: 2px solid var(--item-color);
    border-radius: 4px;
    background: color-mix(in srgb, var(--item-color) 15%, #fff);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .report-boundary .boundary-label,
  .report-inline-item .boundary-label {
    font-size: 13px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.88);
  }

  .report-boundary .boundary-packages,
  .report-inline-item .boundary-packages {
    color: #b42318;
  }

  .report-boundary .boundary-group,
  .report-inline-item .boundary-group {
    color: #344054;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .report-inline-items {
    position: absolute;
    inset: 4px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    align-items: end;
    pointer-events: none;
  }

  .report-inline-item {
    border: 1px solid var(--item-color);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
  }

  .report-notes {
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    padding: 5px 7px;
    margin: 0 0 7px;
    background: #fbfcfe;
    break-inside: avoid;
  }

  .report-notes strong {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
  }

  .report-notes p {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
  }

  .report-table {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0 3px;
  }

  .report-table th,
  .report-table td {
    padding: 6px 7px;
    border: 1px solid #d0d5dd;
    vertical-align: top;
  }

  .report-table th {
    background: #111827;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0;
  }

  .report-zone-row td {
    background: #f8fafc;
    border-block: 1px solid #cbd5e1;
  }

  .report-zone-row:nth-child(even) td {
    background: #eef6f4;
  }

  .report-zone-name {
    width: 19%;
    border-inline-start: 4px solid #0f766e !important;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
  }

  .report-zone-contents {
    width: 49%;
  }

  .report-zone-contents span {
    display: inline-grid;
    gap: 2px;
    margin: 0 3px 3px 0;
    padding: 4px 7px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #eff6ff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
  }

  .report-zone-contents span b,
  .report-zone-contents span small,
  .report-zone-contents span strong {
    display: block;
  }

  .report-zone-contents span small {
    color: #475467;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .report-zone-contents span strong {
    color: #b42318;
    font-family: var(--font-number);
    font-size: 11px;
  }

  .report-zone-number {
    width: 16%;
    color: #0f766e;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
  }

  .report-table tfoot td {
    border-top: 2px solid #111827;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    background: #dff7ef;
  }

  body.printing-bundle .print-report {
    display: block !important;
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-bundle .report-page,
  body.printing-bundle .customs-page {
    display: block;
    width: 100%;
    break-after: page;
    page-break-after: always;
  }

  body.printing-bundle .report-page:last-child,
  body.printing-bundle .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-bundle .cost-page {
    page: costReport;
    min-height: 196mm;
  }

  body.printing-bundle .cost-page .customs-table {
    font-size: 9.5px;
  }

  body.printing-bundle .cost-page .customs-table th,
  body.printing-bundle .cost-page .customs-table td {
    padding: 4px 4px;
  }
}

@media print {
  body.printing-invoice {
    background: #fff !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 7mm;
  }

  body.printing-invoice > * {
    display: none !important;
  }

  body.printing-invoice main,
  body.printing-invoice .invoice-print {
    display: block !important;
  }

  body.printing-invoice #plannerView,
  body.printing-invoice #bolView,
  body.printing-invoice #invoiceView,
  body.printing-invoice .print-report,
  body.printing-invoice main > *:not(.invoice-print) {
    display: none !important;
  }

  body.printing-invoice .invoice-print {
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-invoice .customs-page {
    display: block;
    width: 100%;
    min-height: 283mm;
    break-after: page;
    page-break-after: always;
  }

  body.printing-invoice .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-invoice .customs-header h1 {
    font-size: 22px;
  }

  body.printing-invoice .customs-table th,
  body.printing-invoice .customs-table td {
    padding: 3px 4px;
  }
}

@media print {
  @page costReport {
    size: A4 landscape;
    margin: 6mm;
  }

  body.printing-cost {
    background: #fff !important;
  }

  body.printing-cost > * {
    display: none !important;
  }

  body.printing-cost main,
  body.printing-cost .invoice-print,
  body.printing-cost .cost-print {
    display: block !important;
  }

  body.printing-cost #plannerView,
  body.printing-cost #bolView,
  body.printing-cost #invoiceView,
  body.printing-cost #costView,
  body.printing-cost .print-report,
  body.printing-cost main > *:not(.cost-print) {
    display: none !important;
  }

  body.printing-cost .cost-print {
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-cost .customs-page {
    page: costReport;
    display: block;
    width: 100%;
    min-height: 196mm;
    break-after: page;
    page-break-after: always;
  }

  body.printing-cost .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-cost .cost-print-header h1 {
    font-size: 21px;
  }

  body.printing-cost .cost-print-summary span {
    font-size: 12px;
    padding: 5px 6px;
  }

  body.printing-cost .customs-table {
    font-size: 9.5px;
  }

  body.printing-cost .customs-table th,
  body.printing-cost .customs-table td {
    padding: 4px 4px;
  }
}
