/* Logistics desktop pages */
.logistics-page {
  background: var(--page-bg, #f5f7fa);
  padding: 28px 18px 56px;
}

.logistics-page .container {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.logistics-page .container-frame {
  width: 100%;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border-color, #dde6ee);
  border-radius: 12px;
  background: var(--surface-bg, #fff);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.logistics-page .container-frame > h3 {
  margin: 0 0 20px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--brand-color, #348dcc);
  color: var(--text-color, #172331);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: left;
}

.logistics-page .search-container,
.logistics-page .filter-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.logistics-page .logistics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.logistics-page .search-container > div {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.logistics-page h4 {
  margin: 0 0 7px;
  color: var(--muted-text, #5b6775);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.logistics-page input,
.logistics-page select {
  min-height: 40px;
  border: 1px solid var(--border-color, #d7e0e8);
  border-radius: 8px;
  background: #fff;
  color: var(--text-color, #172331);
  padding: 8px 11px;
  box-shadow: none;
}

.logistics-page input:focus,
.logistics-page select:focus {
  border-color: var(--brand-color, #348dcc);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(52, 141, 204, 0.15);
}

.logistics-page #searchInput {
  width: min(420px, 42vw);
}

.logistics-page #qttInput {
  width: 120px;
}

.logistics-page .btn {
  min-height: 40px;
  border-radius: 8px;
  border: 0;
  font-weight: 700;
  box-shadow: none;
}

.logistics-page .btn-primary,
.logistics-page .btn-success,
.logistics-page .btn-process {
  background: var(--brand-color, #348dcc);
  color: #fff;
}

.logistics-page .btn-primary:hover,
.logistics-page .btn-success:hover,
.logistics-page .btn-process:hover {
  filter: brightness(0.94);
}

.logistics-page .btn-process {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
}

.logistics-page .btn-secondary {
  background: #e9eef4;
  color: #25364a;
}

.logistics-page .btn-danger {
  background: #c94a4a;
  color: #fff;
}

.logistics-page .btn-warning,
.logistics-page .btn-orange {
  background: #f0b84a;
  color: #2c2110;
}

.logistics-page .table-wrapper {
  width: 100%;
  min-height: 46vh;
  max-height: calc(100vh - 290px);
  overflow: auto;
  border: 1px solid var(--border-color, #dfe7ef);
  border-radius: 10px;
  background: #fff;
}

.logistics-page table {
  width: 100%;
  min-width: 1100px;
  margin: 0;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0;
  float: none !important;
}

.logistics-page th,
.logistics-page td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e7edf3;
  color: var(--text-color, #172331);
  font-size: 0.9rem;
  line-height: 1.35;
  vertical-align: middle;
}

.logistics-page th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4f8;
  color: #25364a;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.logistics-page tbody tr:nth-child(even) {
  background: #fafcff;
}

.logistics-page tbody tr:hover {
  background: rgba(52, 141, 204, 0.08);
}

.logistics-page .table-ticket th,
.logistics-page .table-ticket td {
  text-align: center;
}

.logistics-page td:first-child,
.logistics-page th:first-child {
  padding-left: 16px;
}

.logistics-page .sortable {
  cursor: pointer;
}

.logistics-page .sort-indicator {
  display: inline-block;
  margin-left: 5px;
  color: #7c8b9b;
  font-size: 0.8rem;
}

.logistics-page #ordersTable tbody tr.pendente {
  background-color: rgba(52, 141, 204, 0.18) !important;
}

.logistics-page #ordersTable tbody tr.isoverdue,
.logistics-page #ordersTable tbody tr.waiting90,
.logistics-page #ordersTable tbody tr.pendente.waiting90 {
  background-color: #ffd6d6 !important;
}

.logistics-page #ordersTable tbody tr.waiting60,
.logistics-page #ordersTable tbody tr.pendente.waiting60 {
  background-color: #ffe2c4 !important;
}

.logistics-page #ordersTable tbody tr.waiting30,
.logistics-page #ordersTable tbody tr.pendente.waiting30 {
  background-color: #fff3b8 !important;
}

.logistics-page #ordersTable tbody tr.duplicada,
.logistics-page #ordersTable tbody tr.pendente.duplicada,
.logistics-page #ordersTable tbody tr.waiting30.duplicada,
.logistics-page #ordersTable tbody tr.waiting60.duplicada,
.logistics-page #ordersTable tbody tr.waiting90.duplicada {
  background-color: #ffd09b !important;
}

.logistics-page tr.delivered,
.logistics-page tr.collected,
.logistics-page tr.fechado {
  background: #edf8ef;
}

.logistics-page tr.transit {
  background: #eef6ff;
}

.logistics-page .modal-content {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.logistics-page .modal-header {
  border-bottom: 1px solid var(--border-color, #dfe7ef);
  background: #f7fafc;
}

.logistics-page .modal-title,
.logistics-page h6 {
  color: var(--text-color, #172331);
  font-weight: 800;
}

.logistics-page #sendBtn {
  margin-top: 20px;
}

.logistics-page .logistics-meta-hidden {
  display: none;
}

.logistics-page #loadingSpinner.logistics-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 24px 0;
}

.logistics-page #loadingSpinner.logistics-spinner .loading {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 74px;
}

.logistics-page #loadingSpinner.logistics-spinner .spinner {
  display: none;
}

.logistics-page #loadingSpinner.logistics-spinner .loading::after {
  width: 42px;
  height: 42px;
  content: "";
  border: 4px solid #d9e4ed;
  border-top-color: var(--brand-color, #348dcc);
  border-radius: 999px;
  animation: logistics-spin 0.8s linear infinite;
}

.logistics-page .orders-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.logistics-page .orders-page-header h3 {
  margin-bottom: 3px;
}

.logistics-page .orders-summary {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
}

.logistics-page .orders-contact-filter-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #dfe7ef;
  background: #f8fafc;
}

.logistics-page .orders-filter-label {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.logistics-page .orders-contact-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.logistics-page .orders-contact-filters .btn,
.logistics-page .orders-status-filters .btn {
  flex: 0 0 auto;
  width: auto;
}

.logistics-page .orders-contact-filters .btn.active,
.logistics-page .orders-status-filters .btn.active {
  outline: 2px solid var(--brand-color, #348dcc);
  outline-offset: 2px;
}

.logistics-page .orders-search-container label {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.logistics-page .orders-master-wrapper {
  max-height: calc(100vh - 330px);
}

.logistics-page .orders-master-table .order-main-row {
  cursor: pointer;
}

.logistics-page #ordersTable.orders-master-table > thead > tr > th,
.logistics-page #ordersTable.orders-master-table > tbody > .order-main-row > td,
.logistics-page #ordersTable.orders-master-table .order-lines-table th,
.logistics-page #ordersTable.orders-master-table .order-lines-table td {
  display: table-cell;
}

.logistics-page #ordersTable.orders-master-table .order-detail-row[hidden] {
  display: none !important;
}

.logistics-page .orders-master-table .order-main-row:focus-visible {
  outline: 2px solid var(--brand-color, #348dcc);
  outline-offset: -2px;
}

.logistics-page .orders-process-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
}

.logistics-page .orders-process-data {
  display: grid;
  gap: 2px;
}

.logistics-page .orders-process-data strong {
  color: #172331;
  font-size: 0.86rem;
}

.logistics-page .orders-process-data span {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.25;
}

.logistics-page .order-expand-button {
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #334155;
}

.logistics-page .order-expand-button:hover {
  border-color: var(--brand-color, #348dcc);
  color: var(--brand-color, #348dcc);
}

.logistics-page .orders-total {
  font-weight: 800;
  white-space: nowrap;
}

.logistics-page .order-state {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.logistics-page .order-state-concluida {
  background: #dcfce7;
  color: #166534;
}

.logistics-page .order-state-pendente {
  background: #dbeafe;
  color: #1d4ed8;
}

.logistics-page .order-state-waiting30 {
  background: #fef3c7;
  color: #92400e;
}

.logistics-page .order-state-waiting60,
.logistics-page .order-state-duplicada {
  background: #ffedd5;
  color: #9a3412;
}

.logistics-page .order-state-waiting90 {
  background: #fee2e2;
  color: #991b1b;
}

.logistics-page #ordersTable .order-detail-row,
.logistics-page #ordersTable .order-detail-row:hover {
  background: #f8fafc !important;
}

.logistics-page #ordersTable .order-detail-row > td {
  padding: 0 !important;
  border-bottom: 2px solid #cbd5e1;
}

.logistics-page .order-detail-panel {
  padding: 12px 16px 16px 54px;
  overflow-x: auto;
}

.logistics-page .order-lines-table {
  width: 100%;
  min-width: 760px;
  border: 1px solid #dfe7ef;
  background: #fff;
}

.logistics-page .order-lines-table th {
  position: static;
  padding: 8px 10px;
  background: #edf2f7;
  color: #334155;
  font-size: 0.76rem;
}

.logistics-page .order-lines-table td {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.logistics-page .orders-empty,
.logistics-page .orders-empty-detail {
  padding: 28px !important;
  color: #64748b;
  text-align: center;
}

@media (max-width: 900px) {
  .logistics-page .orders-contact-filter-block {
    grid-template-columns: 1fr;
  }

  .logistics-page .orders-master-wrapper {
    max-height: none;
  }

  .logistics-page .order-detail-panel {
    padding: 10px;
  }
}

@keyframes logistics-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .logistics-page {
    padding: 18px 10px 42px;
  }

  .logistics-page .container-frame {
    padding: 16px;
  }

  .logistics-page #searchInput {
    width: 100%;
  }

  .logistics-page .search-container,
  .logistics-page .filter-buttons {
    align-items: stretch;
  }

  .logistics-page .btn,
  .logistics-page input {
    width: 100%;
  }
}
