/* رزرو ناوگان — چیدمان فرم و پرداخت‌ها (بعد از float-fields.css بارگذاری شود) */

.fr-form .fr-row-main,
.fr-form .fr-row-route,
.fr-form .fr-row-refs,
.fr-pay-row .fr-pay-row-top,
.fr-pay-row .fr-pay-row-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.fr-form .fr-col-carrier {
  flex: 1.2 1 160px;
  min-width: 140px;
}
.fr-form .fr-col-plate,
.fr-form .fr-col-loading,
.fr-form .fr-col-driver {
  flex: 1 1 140px;
  min-width: 120px;
}

/* فیلدهای پرشوندهٔ خودکار — زمینهٔ خاکستری */
.fr-form .fr-autofill,
.fr-form input.fr-autofill[readonly],
.fr-form .fr-cmr-display.fr-autofill {
  background: #e8edf3 !important;
  background-color: #e8edf3 !important;
  color: #334155;
  cursor: default;
}
.fr-form .fr-cmr-display.fr-autofill.fr-cmr-has-doc {
  background: #e8edf3 !important;
}

#fleet-reservations .section-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
}
#fleet-reservations .section-controls .search-box.fr-search-box {
  flex: 0 0 168px;
  min-width: 140px;
  max-width: 180px;
}
#fleet-reservations .section-controls .fr-search-box input {
  padding: 6px 30px 6px 8px;
  font-size: 13px;
}
#fleet-reservations .section-controls .fr-list-filter {
  min-width: 0;
  flex: 0 0 auto;
  width: auto;
  max-width: 150px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13px;
}
#fleet-reservations .fr-date-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
#fleet-reservations .fr-date-range .fr-list-filter {
  width: 108px;
  max-width: 108px;
}
#fleet-reservations .fr-date-sep {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  #fleet-reservations .section-controls {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  #fleet-reservations .section-controls .search-box,
  #fleet-reservations .section-controls .search-box.fr-search-box {
    min-width: 140px;
    max-width: 180px;
  }
}
#fleetReservationsTable tbody tr.fr-list-total td {
  font-weight: 700;
  background: #e2e8f0;
  border-top: 2px solid #94a3b8;
  cursor: default;
}
#fleetReservationsTable tbody tr.fr-list-total:hover td {
  filter: none;
  background: #e2e8f0;
}

/* کد ملی و موبایل باریک‌تر؛ مبدأ/مقصد پهن‌تر */
.fr-form .fr-col-nid,
.fr-form .fr-col-mobile {
  flex: 0.55 1 90px;
  min-width: 88px;
  max-width: 140px;
}
.fr-form .fr-col-origin,
.fr-form .fr-col-dest {
  flex: 1.2 1 140px;
  min-width: 120px;
}

.fr-form .fr-col-inq,
.fr-form .fr-col-fleet-no,
.fr-form .fr-col-cmr {
  flex: 1 1 140px;
  min-width: 120px;
}

.fr-form .fr-cmr-display {
  cursor: default;
}
.fr-form .fr-cmr-display.fr-cmr-has-doc {
  color: var(--float-accent, #1d4ed8);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.fr-fleet-match-status {
  margin: 0 0 6px;
  min-height: 1.2em;
  font-size: 0.86rem;
  color: #64748b;
}
.fr-fleet-match-status.is-ok {
  color: #047857;
  font-weight: 600;
}
.fr-fleet-match-status.is-warn {
  color: #b45309;
}

.fr-vins-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 12px;
  background: #f8fafc;
}
.fr-vins-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.fr-vins-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}
.fr-vins-list li.fr-vin-item {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.88rem;
}
.fr-vin-order {
  color: #64748b;
  min-width: 1.4rem;
}
.fr-vin-code {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: embed;
}

.fr-cmr-preview {
  min-height: 50vh;
}
.fr-cmr-frame {
  width: 100%;
  min-height: 60vh;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.fr-cmr-img-wrap {
  text-align: center;
  max-height: 70vh;
  overflow: auto;
}
.fr-cmr-img-wrap img {
  max-width: 100%;
  height: auto;
}

.fr-pay-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 10px 10px;
  margin-bottom: 8px;
  background: #fff;
}

.fr-pay-row-docs {
  align-items: center !important;
  margin-top: 6px;
}

.fr-pay-track-field {
  flex: 2 1 180px;
  min-width: 160px;
  margin-bottom: 0 !important;
  position: relative;
}

/*
  لیبل کد رهگیری روی ضلع بالا با پس‌زمینهٔ مات تا خط کادر زیر لیبل پاک شود
  (مثل بقیهٔ float-fieldها؛ !important چون ممکن است قوانین عمومی پس‌زمینه را شفاف کنند)
*/
.fr-pay-track-field.float-field > label,
.fr-pay-track-field > label {
  position: absolute !important;
  top: 0 !important;
  right: 0.9rem !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 0.4rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: var(--float-label-idle, #475569) !important;
  background: #fff !important;
  background-color: #fff !important;
  pointer-events: none;
  z-index: 3 !important;
  max-width: calc(100% - 1.8rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr-pay-track-field.float-field:focus-within > label,
.fr-pay-track-field:focus-within > label {
  color: var(--float-accent, #1d4ed8) !important;
}

.fr-pay-file-field {
  flex: 1.4 1 160px;
  min-width: 150px;
  margin-bottom: 0 !important;
  position: relative;
}

.fr-pay-file-field > input[type='file'] {
  padding-top: 0.85rem;
  padding-bottom: 0.55rem;
  min-height: 2.65rem;
  box-sizing: border-box;
}

.fr-pay-file-field > label,
.fr-pay-file-field.float-field > label {
  position: absolute !important;
  top: 0 !important;
  right: 0.9rem;
  left: auto;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 0.4rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1;
  color: var(--float-label-idle, #475569) !important;
  background: #fff !important;
  background-color: #fff !important;
  pointer-events: none;
  z-index: 3 !important;
}

.fr-pay-file-field:focus-within > label,
.fr-pay-file-field.float-field:focus-within > label {
  color: var(--float-accent, #1d4ed8) !important;
}

/* فقط وقتی سند قبلی وجود دارد؛ خط تیرهٔ خالی حذف شد تا هم‌تراز بماند */
.fr-pay-receipt-prev {
  font-size: 0.8rem;
  margin-top: 4px;
  line-height: 1.3;
}

.fr-pay-remove-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  align-self: center;
  height: 2.65rem;
  margin-bottom: 0;
}

.fr-pay-remove-wrap .fr-pay-remove {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .fr-form .fr-col-nid,
  .fr-form .fr-col-mobile {
    max-width: none;
    flex: 1 1 45%;
  }
}
