/* ============================================================
   DISPATCH & TRANSPORT — PREMIUM ERP THEME
   Packing Status Column Removed Version
============================================================ */

:root {
  --primary: #108082;
  --primary-dark: #0d6668;
  --primary-light: #e6f4f4;
  --primary-mid: #c7ede8;

  --navy: #071b3a;
  --green: #16a34a;
  --green-dark: #15803d;
  --green-lt: #dcfce7;

  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-lt: #fef2f2;
  --red-mid: #fca5a5;

  --blue: #2563eb;
  --blue-lt: #eff6ff;
  --blue-mid: #bae6fd;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,.07);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18);
  --shadow-xl: 0 30px 80px rgba(0,0,0,.22);
  --transition: .2s ease;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f4f7fb;
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  min-height: 100vh;
}

.main-content {
  padding: 25px;
  max-width: 100%;
  margin: 0 auto;
}

/* ================= TOPBAR ================= */

.topbar {
  background: #fff;
  padding: 20px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar p {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ================= SECTION ================= */

.section-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ================= FILTER BAR ================= */

.transport-filter-bar {
  display: grid;
  grid-template-columns:
    minmax(260px, 1.8fr)
    minmax(130px, .8fr)
    minmax(130px, .8fr)
    minmax(160px, 1fr)
    minmax(170px, 1fr)
    minmax(145px, .9fr)
    minmax(140px, .8fr)
    minmax(140px, .8fr)
    minmax(115px, .6fr)
    minmax(115px, .6fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.transport-filter-bar input,
.transport-filter-bar select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
}

.transport-filter-bar input:focus,
.transport-filter-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,128,130,.12);
}

.transport-filter-bar .btn {
  width: 100%;
  height: 42px;
  border-radius: 11px;
}

/* ================= TABLE ================= */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.table-wrap table {
  width: 100%;
  min-width: 1350px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--gray-200);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--primary-light);
}

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

/* 10 Columns After Packing Status Removed */

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
  width: 145px;
  white-space: nowrap;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
  width: 240px;
  white-space: normal;
  line-height: 1.35;
}

.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) {
  width: 125px;
}

.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) {
  width: 125px;
}

.table-wrap th:nth-child(5),
.table-wrap td:nth-child(5) {
  width: 145px;
}

.table-wrap th:nth-child(6),
.table-wrap td:nth-child(6) {
  width: 145px;
}

.table-wrap th:nth-child(7),
.table-wrap td:nth-child(7) {
  width: 135px;
}

.table-wrap th:nth-child(8),
.table-wrap td:nth-child(8) {
  width: 155px;
}

.table-wrap th:nth-child(9),
.table-wrap td:nth-child(9) {
  width: 145px;
}

.table-wrap th:nth-child(10),
.table-wrap td:nth-child(10) {
  width: 270px;
}

/* ================= BADGES ================= */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 100px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pending,
.pending {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge.dispatched,
.dispatched {
  background: var(--green-lt);
  color: var(--green-dark);
  border: 1px solid #86efac;
}

.badge.submitted,
.submitted {
  background: var(--green-lt);
  color: var(--green-dark);
  border: 1px solid #86efac;
}

.badge.pay-received,
.pay-received {
  background: var(--green-lt);
  color: var(--green-dark);
  border: 1px solid #86efac;
}

.badge.pay-partial,
.pay-partial {
  background: var(--red-lt);
  color: var(--red);
  border: 1px solid var(--red-mid);
}

.badge.req-special,
.req-special {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge.req-normal,
.req-normal {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

.badge.badge-info,
.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-mid);
}

/* ================= BUTTONS ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(16,128,130,.3);
}

.btn.success {
  background: var(--green);
  color: #fff;
}

.btn.success:hover {
  background: var(--green-dark);
}

.btn.secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn.secondary:hover {
  background: var(--gray-200);
}

.btn.cancel {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.btn.cancel:hover {
  background: var(--gray-200);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.action-buttons .btn {
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
}

.btn.lr-btn,
.lr-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 3px 10px rgba(16,128,130,.25);
}

.btn.lr-btn:hover,
.lr-btn:hover {
  box-shadow: 0 6px 18px rgba(16,128,130,.38);
}

.btn.info-btn,
.info-btn {
  background: var(--blue);
  color: #fff;
}

.btn.unlock-btn,
.unlock-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

/* ================= DISPATCH MODAL ================= */

.order-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.54);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.order-modal.show {
  display: flex;
}

.order-modal-box {
  width: 100%;
  max-width: 960px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalIn .26s cubic-bezier(.34,1.56,.64,1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 {
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close,
.close-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.close-btn:hover {
  background: rgba(255,255,255,.3);
  transform: rotate(90deg);
}

.modal-grid {
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  overflow-y: auto;
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.field label i {
  color: var(--primary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: inherit;
  background: var(--gray-50);
  color: var(--gray-900);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16,128,130,.12);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f8fafc;
  color: #111827;
  cursor: not-allowed;
}

.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.currency-input {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 13px;
  font-weight: 700;
  color: var(--gray-900);
  font-size: 15px;
  pointer-events: none;
}

.currency-input input {
  padding-left: 30px;
}

.dispatch-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1.5px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fff;
}

/* ================= POPUPS ================= */

.custom-popup,
.status-popup {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.52);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.status-popup {
  z-index: 100000;
}

.custom-popup.show,
.status-popup.show {
  display: flex;
}

.popup-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalIn .26s cubic-bezier(.34,1.56,.64,1);
}

.popup-head {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-head h3 {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-pass > input[type="password"] {
  display: block;
  width: calc(100% - 40px);
  margin: 18px 20px 0;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: var(--gray-50);
  color: var(--gray-900);
  letter-spacing: 3px;
}

.modern-pass > input[type="password"]:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16,128,130,.12);
}

.popup-actions {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ================= LR POPUP ================= */

.lr-popup-box {
  max-width: 500px;
}

.lr-popup-head {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lr-popup-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lr-head-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,.18);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.lr-popup-head h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.lr-popup-head p {
  font-size: 12.5px;
  color: rgba(255,255,255,.75);
  margin-top: 3px;
}

.lr-popup-body {
  padding: 18px 22px;
}

.lr-field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lr-order-card {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lr-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
}

.lr-order-row:last-child {
  border-bottom: none;
}

.lr-order-row span {
  color: var(--gray-500);
}

.lr-order-row b {
  color: var(--gray-900);
  font-weight: 700;
}

.lr-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary-light);
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-xs);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 2px;
}

.lr-file-label:hover {
  background: var(--primary-mid);
}

#lrImagePreview {
  margin-top: 10px;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.lr-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lr-thumb {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  display: block;
}

.btn-lr-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border: none;
}

.btn-lr-view:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-lr-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-lr-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.lr-popup-footer {
  padding: 16px 22px 20px;
  border-top: 1.5px solid var(--gray-100);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ================= STATUS POPUP ================= */

.status-box {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xl);
}

.status-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green-lt);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.status-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.45;
}

/* ================= UPLOAD TOAST ================= */

#uploadProgressBar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 13px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}

@keyframes popupIn {
  from {
    opacity: 0;
    transform: scale(.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================= FOOTER ================= */

.footer {
  margin-top: 26px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* ================= SCROLLBAR ================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1500px) {
  .transport-filter-bar {
    grid-template-columns: repeat(5, 1fr);
  }

  .transport-filter-bar input:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 992px) {
  .transport-filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .transport-filter-bar input:first-child {
    grid-column: span 2;
  }

  .modal-grid,
  .dispatch-extra-grid,
  .lr-field-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons .btn {
    width: 100%;
  }

  .popup-actions,
  .lr-popup-footer {
    flex-direction: column;
  }

  .popup-actions .btn,
  .lr-popup-footer .btn,
  .btn-lr-submit {
    width: 100%;
    justify-content: center;
  }

  .modal-footer {
    justify-content: stretch;
  }

  .modal-footer .btn {
    flex: 1;
  }
}

@media (max-width: 576px) {
  .transport-filter-bar {
    grid-template-columns: 1fr;
  }

  .transport-filter-bar input:first-child {
    grid-column: span 1;
  }
}