#internal-waybills .section-controls {
  flex-wrap: wrap;
  gap: 8px;
}

#internal-waybills .iw-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
}

#internal-waybills .iw-bulk-bar[hidden] {
  display: none !important;
}

#iwTable.data-table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
}

#iwTable.data-table thead th {
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  white-space: nowrap;
}

#iwTable.data-table tbody td {
  padding: 4px 8px;
  vertical-align: middle;
  border-bottom: 1px solid #fff;
}

#iwTable .col-check {
  width: 36px;
  text-align: center;
}

#iwTable .col-ops {
  white-space: nowrap;
  width: 1%;
}

#iwTable tbody tr.iw-list-total td {
  font-weight: 700;
  background: #e2e8f0;
  border-top: 2px solid #94a3b8;
}

.iw-print-frame {
  width: min(210mm, 96vw);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.iw-print-frame object,
.iw-print-frame img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
}

.iw-print-frame object {
  min-height: 60vh;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #iwPrintRoot,
  #iwPrintRoot * {
    visibility: visible !important;
  }
  /* دکمه‌ها و کروم مودال در چاپ دیده نشوند */
  #iwPrintRoot .no-print,
  #iwPrintRoot .no-print *,
  .modal-header,
  .modal-header *,
  .modal-header-actions,
  .close {
    display: none !important;
    visibility: hidden !important;
  }
  .modal,
  .modal-content,
  .modal-body {
    position: static !important;
    inset: auto !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  html,
  body {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #iwPrintRoot {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  #iwPrintRoot .iw-print-frame {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #iwPrintRoot #iwWaybillImg,
  #iwPrintRoot #iwWaybillObject,
  #iwPrintRoot .iw-waybill-inline,
  #iwPrintRoot .iw-waybill-inline svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    box-shadow: none !important;
    object-fit: contain;
  }
  #iwPrintRoot .iw-waybill-inline {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  #iwPrintRoot .iw-waybill-inline svg {
    /* نسبت A5 افقی را داخل یک صفحه نگه می‌دارد */
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
  }
  @page {
    size: A5 landscape;
    margin: 3mm;
  }
}

/* فرم صدور حواله — کارت‌های گروه‌بندی‌شده */
.iw-form-modal.modal-content,
.modal-content.iw-form-modal {
  max-width: min(980px, 96vw);
}

.iw-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.iw-form-code {
  margin: 0;
  font-size: 13px;
}

.iw-form-card {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.iw-form-card-head {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  background: linear-gradient(180deg, #eff6ff, #e0f2fe);
  border-bottom: 1px solid #bfdbfe;
}

.iw-form-card-body {
  padding: 14px 14px 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.iw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: stretch;
}

.iw-form-row-1 {
  grid-template-columns: 1fr;
}

.iw-form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.iw-form-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.iw-form .form-group.float-field {
  margin-bottom: 0.95rem;
}

.iw-form .form-group.float-field > label {
  top: 50%;
  transform: translateY(-50%);
  line-height: 1.2;
}

.iw-form .form-group.float-field > textarea + label {
  top: 0.95rem;
  transform: none;
}

.iw-form .form-group.float-field.is-floated > label,
.iw-form .form-group.float-field.has-value > label,
.iw-form .form-group.float-field:focus-within > label {
  top: 0 !important;
  transform: translateY(-50%) !important;
}

.iw-form .form-group.float-field > input.money-input,
.iw-form .form-group.float-field > input[data-money='1'] {
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.iw-form .form-group.float-field > .jdp-field {
  width: 100%;
}

.iw-form .form-group.float-field > .jdp-field > label {
  display: none;
}

.iw-image-modal .iw-print-frame {
  background: #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  min-height: 50vh;
  overflow: auto;
}

.iw-image-modal #iwWaybillImg,
.iw-image-modal .iw-waybill-inline {
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
}

.iw-image-modal .iw-waybill-inline svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.iw-form .form-group.float-field > input.iw-money-readonly,
.iw-form .form-group.float-field > input#iwf_totalFreight[readonly] {
  background: #f8fafc;
  cursor: default;
  color: #0f172a;
}

@media (max-width: 800px) {
  .iw-form-row,
  .iw-form-row-3,
  .iw-form-row-4 {
    grid-template-columns: 1fr;
  }
}
