/* =========================================================
   WIRTZ HUB · OPERACIONES · LOGÍSTICA
   CSS completo limpio
   Control de retiro · Colecta / Flex
   Sin armado · Sin scanner · Sin validación de SKU
   ========================================================= */

/* =========================================================
   PAGE
   ========================================================= */

.logistica-page {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;

  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - var(--topbar-height) - 44px);

  color: #111827;
  overflow-x: hidden;

  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif;

  animation: logisticaPageIn 0.22s ease both;
}

.logistica-page *,
.logistica-modal *,
.logistica-toast {
  box-sizing: border-box;

  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif;
}

html[data-theme="dark"] .logistica-page {
  color: #f9fafb;
}

/* =========================================================
   BLOQUES BASE
   ========================================================= */

.logistica-head,
.logistica-metrics,
.logistica-types,
.logistica-panel {
  width: 100%;
  max-width: 100%;

  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 16px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(249, 250, 251, 0.965)),
    color-mix(in srgb, var(--panel-solid) 98%, transparent);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 12px 28px rgba(17, 24, 39, 0.04);

  overflow: hidden;
}

html[data-theme="dark"] .logistica-head,
html[data-theme="dark"] .logistica-metrics,
html[data-theme="dark"] .logistica-types,
html[data-theme="dark"] .logistica-panel {
  border-color: rgba(255, 255, 255, 0.1);

  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.965), rgba(8, 8, 8, 0.945)),
    rgba(10, 10, 10, 0.92);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035) inset,
    0 14px 36px rgba(0, 0, 0, 0.32);
}

/* =========================================================
   HEADER
   ========================================================= */

.logistica-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 8px;
  align-items: center;

  min-height: 60px;
  padding: 10px;
}

.logistica-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.logistica-brand__icon {
  display: grid;
  place-items: center;

  width: 33px;
  height: 33px;
  min-width: 33px;

  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 11px;
  background: #ffffff;

  color: #111827;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 8px 18px rgba(17, 24, 39, 0.06);
}

.logistica-brand__icon .icon,
.logistica-brand__icon svg {
  display: block;

  width: 16px;
  height: 16px;

  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.15;
}

.logistica-brand h2 {
  margin: 0;

  color: #111827;

  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.logistica-brand p {
  margin: 3px 0 0;
  max-width: 760px;

  color: #4b5563;

  font-size: 10px;
  font-weight: 760;
  line-height: 1.35;
}

html[data-theme="dark"] .logistica-brand__icon {
  border-color: rgba(255, 255, 255, 0.14);
  background: #111111;
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-brand h2 {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-brand p {
  color: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.logistica-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.logistica-date,
.logistica-select {
  display: grid;
  gap: 4px;
}

.logistica-date span,
.logistica-select span {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.logistica-date input,
.logistica-select select {
  width: 100%;
  min-width: 132px;
  height: 32px;

  padding: 0 10px;

  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 9px;
  background: #ffffff;

  color: #111827;
  outline: none;

  font-size: 9.4px;
  font-weight: 850;

  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;

  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.logistica-date input:hover,
.logistica-date input:focus,
.logistica-select select:hover,
.logistica-select select:focus {
  border-color: rgba(17, 24, 39, 0.32);
  background: #f9fafb;

  box-shadow:
    0 0 0 2px rgba(17, 24, 39, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

html[data-theme="dark"] .logistica-date span,
html[data-theme="dark"] .logistica-select span {
  color: rgba(255, 255, 255, 0.52);
}

html[data-theme="dark"] .logistica-date input,
html[data-theme="dark"] .logistica-select select {
  border-color: rgba(255, 255, 255, 0.18);
  background: #090909;
  color: #f8fafc;
}

html[data-theme="dark"] .logistica-date input:hover,
html[data-theme="dark"] .logistica-date input:focus,
html[data-theme="dark"] .logistica-select select:hover,
html[data-theme="dark"] .logistica-select select:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: #050505;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-date input[type="date"] {
  color-scheme: dark;
}

html[data-theme="dark"] .logistica-date input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) grayscale(1) brightness(1.2);
  opacity: 0.72;
  cursor: pointer;
}

/* =========================================================
   BOTONES
   ========================================================= */

.logistica-btn,
.logistica-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  min-height: 32px;
  padding: 0 10px;

  border: 1px solid rgba(17, 24, 39, 0.2);
  border-radius: 9px;
  background: #ffffff;

  color: #111827;

  font-size: 9.2px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 1px 2px rgba(17, 24, 39, 0.05);

  cursor: pointer;
  outline: none;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.14s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.logistica-btn .icon,
.logistica-btn svg,
.logistica-modal-close .icon,
.logistica-modal-close svg {
  display: block;

  width: 13px;
  height: 13px;
  min-width: 13px;

  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.15;
}

.logistica-btn:hover,
.logistica-modal-close:hover {
  border-color: rgba(17, 24, 39, 0.34);
  background: #f3f4f6;
  color: #111827;
  transform: translateY(-1px);
}

.logistica-btn:active,
.logistica-modal-close:active {
  transform: translateY(0) scale(0.985);
}

.logistica-btn:disabled {
  cursor: not-allowed;
  color: #6b7280;
  background: #e5e7eb;
  border-color: #d1d5db;
  box-shadow: none;
  opacity: 0.75;
  transform: none;
}

.logistica-btn--dark {
  border-color: #050505;
  background: #050505;
  color: #ffffff;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.logistica-btn--dark:hover {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-btn,
html[data-theme="dark"] .logistica-modal-close {
  border-color: rgba(255, 255, 255, 0.18);
  background: #101010;
  color: rgba(255, 255, 255, 0.9);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.045) inset,
    0 8px 18px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .logistica-btn:hover,
html[data-theme="dark"] .logistica-modal-close:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: #181818;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-btn--dark {
  border-color: rgba(255, 255, 255, 0.28);
  background: #050505;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-btn--dark:hover {
  background: #000000;
  color: #ffffff;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.logistica-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.logistica-metric {
  display: grid;
  align-content: center;
  gap: 3px;

  min-height: 56px;
  padding: 10px;

  border-right: 1px solid rgba(17, 24, 39, 0.11);
}

.logistica-metric:last-child {
  border-right: 0;
}

.logistica-metric span {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-metric strong {
  color: #111827;

  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-metric small {
  color: #6b7280;

  font-size: 8px;
  font-weight: 820;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-metric:nth-child(3) strong {
  color: #15803d;
}

.logistica-metric:nth-child(4) strong {
  color: #b91c1c;
}

html[data-theme="dark"] .logistica-metric {
  border-right-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .logistica-metric span {
  color: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .logistica-metric strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-metric small {
  color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .logistica-metric:nth-child(3) strong {
  color: #86efac;
}

html[data-theme="dark"] .logistica-metric:nth-child(4) strong {
  color: #fca5a5;
}

/* =========================================================
   RESUMEN COLECTA / FLEX
   ========================================================= */

.logistica-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logistica-type-card {
  display: grid;
  gap: 9px;

  padding: 11px;

  border-right: 1px solid rgba(17, 24, 39, 0.11);
}

.logistica-type-card:last-child {
  border-right: 0;
}

.logistica-type-card header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.logistica-type-card__icon {
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  min-width: 34px;

  border: 1px solid #050505;
  border-radius: 11px;
  background: #050505;

  color: #ffffff;
}

.logistica-type-card.is-ok .logistica-type-card__icon {
  border-color: #15803d;
  background: #15803d;
}

.logistica-type-card.is-pending .logistica-type-card__icon {
  border-color: #b91c1c;
  background: #b91c1c;
}

.logistica-type-card__icon .icon,
.logistica-type-card__icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.15;
}

.logistica-type-card header strong {
  display: block;

  color: #111827;

  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.logistica-type-card header small {
  display: block;
  margin-top: 3px;

  color: #4b5563;

  font-size: 9px;
  font-weight: 820;
  line-height: 1;
}

.logistica-type-card section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 12px;

  overflow: hidden;
}

.logistica-type-card section div {
  display: grid;
  gap: 3px;

  min-height: 46px;
  padding: 8px;

  border-right: 1px solid rgba(17, 24, 39, 0.1);
}

.logistica-type-card section div:last-child {
  border-right: 0;
}

.logistica-type-card section span {
  color: #4b5563;

  font-size: 7.5px;
  font-weight: 950;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-type-card section strong {
  color: #111827;

  font-size: 14px;
  font-weight: 950;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .logistica-type-card {
  border-right-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .logistica-type-card__icon {
  border-color: rgba(255, 255, 255, 0.22);
  background: #050505;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-type-card.is-ok .logistica-type-card__icon {
  border-color: rgba(134, 239, 172, 0.48);
  background: #0f2d1b;
  color: #86efac;
}

html[data-theme="dark"] .logistica-type-card.is-pending .logistica-type-card__icon {
  border-color: rgba(252, 165, 165, 0.48);
  background: #2b0b0b;
  color: #fca5a5;
}

html[data-theme="dark"] .logistica-type-card header strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-type-card header small {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-type-card section {
  border-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .logistica-type-card section div {
  border-right-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .logistica-type-card section span {
  color: rgba(255, 255, 255, 0.46);
}

html[data-theme="dark"] .logistica-type-card section strong {
  color: rgba(255, 255, 255, 0.88);
}

/* =========================================================
   PANEL LISTA
   ========================================================= */

.logistica-list-panel {
  display: grid;
  min-height: 0;
}

.logistica-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 46px;
  padding: 10px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.11);
}

.logistica-panel-head span {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.logistica-panel-head strong {
  display: block;
  margin-top: 3px;

  color: #111827;

  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
}

html[data-theme="dark"] .logistica-panel-head {
  border-bottom-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .logistica-panel-head span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-panel-head strong {
  color: rgba(255, 255, 255, 0.92);
}

/* =========================================================
   TABLA PRINCIPAL
   ========================================================= */

.logistica-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 330px);
  min-height: 360px;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: rgba(120, 128, 145, 0.35) transparent;
}

.logistica-table-wrap::-webkit-scrollbar,
.logistica-modal-body::-webkit-scrollbar,
.logistica-modal-pedidos-list::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.logistica-table-wrap::-webkit-scrollbar-track,
.logistica-modal-body::-webkit-scrollbar-track,
.logistica-modal-pedidos-list::-webkit-scrollbar-track {
  background: transparent;
}

.logistica-table-wrap::-webkit-scrollbar-thumb,
.logistica-modal-body::-webkit-scrollbar-thumb,
.logistica-modal-pedidos-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(120, 128, 145, 0.35);
  background-clip: content-box;
}

.logistica-table {
  width: 100%;
  min-width: 100%;

  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.logistica-table th,
.logistica-table td {
  position: relative;

  height: 42px;
  padding: 0 12px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  border-right: 1px solid rgba(17, 24, 39, 0.12);

  color: #374151;

  font-size: 10px;
  font-weight: 780;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;

  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-table th:last-child,
.logistica-table td:last-child {
  border-right: 0;
}

.logistica-table th {
  position: sticky;
  top: 0;
  z-index: 2;

  height: 36px;

  background: rgba(255, 255, 255, 0.98);

  color: #4b5563;

  font-size: 7.7px;
  font-weight: 950;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.logistica-table tbody tr:nth-child(even) {
  background: rgba(17, 24, 39, 0.018);
}

.logistica-table tbody tr:hover {
  background: rgba(17, 24, 39, 0.045);
}

.logistica-table th:nth-child(1),
.logistica-table td:nth-child(1) {
  width: 26%;
}

.logistica-table th:nth-child(2),
.logistica-table td:nth-child(2) {
  width: 11%;
  text-align: center;
}

.logistica-table th:nth-child(3),
.logistica-table td:nth-child(3),
.logistica-table th:nth-child(4),
.logistica-table td:nth-child(4),
.logistica-table th:nth-child(5),
.logistica-table td:nth-child(5),
.logistica-table th:nth-child(6),
.logistica-table td:nth-child(6) {
  width: 8.5%;
  text-align: center;
}

.logistica-table th:nth-child(7),
.logistica-table td:nth-child(7) {
  width: 17%;
  text-align: center;
}

.logistica-table th:nth-child(8),
.logistica-table td:nth-child(8) {
  width: 13%;
  text-align: center;
}

.logistica-table strong {
  display: block;

  color: #111827;

  font-size: 10px;
  font-weight: 950;
  line-height: 1.15;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-table small {
  display: block;
  margin-top: 3px;

  color: #4b5563;

  font-size: 8.4px;
  font-weight: 820;
  line-height: 1.2;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .logistica-table th,
html[data-theme="dark"] .logistica-table td {
  border-bottom-color: rgba(255, 255, 255, 0.105);
  border-right-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.74);
}

html[data-theme="dark"] .logistica-table th {
  background: rgba(10, 10, 10, 0.98);
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.028);
}

html[data-theme="dark"] .logistica-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .logistica-table strong {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .logistica-table small {
  color: rgba(255, 255, 255, 0.48);
}

.logistica-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.logistica-row-actions .logistica-btn {
  min-height: 30px;
  height: 30px;
  min-width: 68px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 8.6px;
}

/* =========================================================
   ESTADOS COMO TEXTO LIMPIO
   ========================================================= */

.logistica-pill {
  display: inline;
  padding: 0;
  margin: 0;

  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;

  font-size: 9.2px;
  font-weight: 860;
  line-height: 1.15;
  white-space: nowrap;
}

.logistica-pill--colecta {
  color: #57534e;
}

.logistica-pill--flex {
  color: #15803d;
}

.logistica-status {
  display: inline;

  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;

  padding: 0;
  margin: 0;

  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;

  font-size: 10px;
  font-weight: 820;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-status::before,
.logistica-status::after {
  display: none;
  content: none;
}

.logistica-status--retirado {
  color: #15803d;
}

.logistica-status--parcial {
  color: #c2410c;
}

.logistica-status--pendiente,
.logistica-status--sin-pedidos {
  color: #b91c1c;
}

html[data-theme="dark"] .logistica-pill--colecta {
  color: #d6d3d1;
}

html[data-theme="dark"] .logistica-pill--flex {
  color: #86efac;
}

html[data-theme="dark"] .logistica-status--retirado {
  color: #86efac;
}

html[data-theme="dark"] .logistica-status--parcial {
  color: #fdba74;
}

html[data-theme="dark"] .logistica-status--pendiente,
html[data-theme="dark"] .logistica-status--sin-pedidos {
  color: #fca5a5;
}

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

.logistica-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  place-items: center;

  padding: 16px;

  background: rgba(0, 0, 0, 0.52);

  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
}

.logistica-modal.is-open {
  display: grid;
  animation: logisticaModalBackdropIn 0.16s ease both;
}

.logistica-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;

  width: min(1240px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);

  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;

  overflow: hidden;

  animation: logisticaModalIn 0.18s ease both;
}

.logistica-modal-card--loading {
  width: min(760px, calc(100vw - 32px));
  height: min(420px, calc(100vh - 32px));
}

.logistica-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 72px;
  padding: 14px 16px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
}

.logistica-modal-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.logistica-modal-icon {
  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;
  min-width: 42px;

  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 15px;
  background: #f9fafb;

  color: #111827;
}

.logistica-modal-icon .icon,
.logistica-modal-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.15;
}

.logistica-modal-title > div {
  min-width: 0;
}

.logistica-modal-title span {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.logistica-modal-title h3 {
  margin: 4px 0 0;

  color: #111827;

  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-modal-title p {
  margin: 5px 0 0;

  color: #4b5563;

  font-size: 10px;
  font-weight: 780;
  line-height: 1.25;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-modal-close {
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 11px;
}

.logistica-modal-body {
  display: grid;
  align-content: start;
  gap: 11px;

  min-height: 0;
  padding: 12px;

  background: #f8fafc;

  overflow-y: auto;
  overflow-x: hidden;
}

.logistica-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;

  min-height: 58px;
  padding: 11px 14px;

  border-top: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
}

html[data-theme="dark"] .logistica-modal-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: #0b0b0c;

  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.72),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

html[data-theme="dark"] .logistica-modal-head,
html[data-theme="dark"] .logistica-modal-footer {
  border-color: rgba(255, 255, 255, 0.09);
  background: #121214;
}

html[data-theme="dark"] .logistica-modal-body {
  background: #080809;
}

html[data-theme="dark"] .logistica-modal-icon {
  border-color: rgba(255, 255, 255, 0.14);
  background: #18181a;
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-modal-title span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-modal-title h3 {
  color: rgba(255, 255, 255, 0.94);
}

html[data-theme="dark"] .logistica-modal-title p {
  color: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   MODAL SUMMARY
   ========================================================= */

.logistica-modal-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));

  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 16px;
  background: #ffffff;

  overflow: hidden;
}

.logistica-modal-summary article {
  display: grid;
  align-content: center;
  gap: 4px;

  min-height: 66px;
  padding: 11px;

  border-right: 1px solid rgba(17, 24, 39, 0.11);
  background: transparent;
}

.logistica-modal-summary article:last-child {
  border-right: 0;
}

.logistica-modal-summary span {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-modal-summary strong {
  color: #111827;

  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .logistica-modal-summary {
  border-color: rgba(255, 255, 255, 0.1);
  background: #111113;
}

html[data-theme="dark"] .logistica-modal-summary article {
  border-right-color: rgba(255, 255, 255, 0.075);
}

html[data-theme="dark"] .logistica-modal-summary span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-modal-summary strong {
  color: rgba(255, 255, 255, 0.92);
}

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

.logistica-modal-section {
  display: grid;
  min-height: 0;

  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 16px;
  background: #ffffff;

  overflow: hidden;
}

.logistica-modal-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-height: 50px;
  padding: 11px 12px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
}

.logistica-modal-section > header span:not(.logistica-status) {
  color: #4b5563;

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.logistica-modal-section > header strong {
  display: block;
  margin-top: 3px;

  color: #111827;

  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
}

html[data-theme="dark"] .logistica-modal-section {
  border-color: rgba(255, 255, 255, 0.1);
  background: #101011;
}

html[data-theme="dark"] .logistica-modal-section > header {
  border-bottom-color: rgba(255, 255, 255, 0.09);
  background: #141416;
}

html[data-theme="dark"] .logistica-modal-section > header span:not(.logistica-status) {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-modal-section > header strong {
  color: rgba(255, 255, 255, 0.92);
}

/* =========================================================
   PEDIDOS MODAL
   ========================================================= */

.logistica-modal-pedidos-list {
  display: grid;
  gap: 0;

  max-height: calc(100vh - 340px);

  overflow-y: auto;
  overflow-x: hidden;
}

.logistica-pedido-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(360px, 1.2fr) 108px 96px;
  align-items: stretch;
  gap: 0;

  min-height: 62px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  background: transparent;

  transition: background 0.16s ease;
}

.logistica-pedido-row:last-child {
  border-bottom: 0;
}

.logistica-pedido-row:hover {
  background: rgba(17, 24, 39, 0.035);
}

.logistica-pedido-row.is-retirado {
  box-shadow: inset 3px 0 0 rgba(21, 128, 61, 0.62);
}

.logistica-pedido-row.is-pendiente {
  box-shadow: inset 3px 0 0 rgba(185, 28, 28, 0.55);
}

.logistica-pedido-row__main {
  display: grid;
  align-content: center;
  gap: 3px;

  min-width: 0;
  padding: 11px 13px;

  border-right: 1px solid rgba(17, 24, 39, 0.11);
}

.logistica-pedido-row__main strong {
  color: #111827;

  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-pedido-row__main small {
  color: #4b5563;

  font-size: 8.6px;
  font-weight: 760;
  line-height: 1.25;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-pedido-row__data {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border-right: 1px solid rgba(17, 24, 39, 0.11);
}

.logistica-pedido-row__data > div {
  display: grid;
  align-content: center;
  gap: 3px;

  min-width: 0;
  padding: 10px;

  border-right: 1px solid rgba(17, 24, 39, 0.1);
}

.logistica-pedido-row__data > div:last-child {
  border-right: 0;
}

.logistica-pedido-row__data span {
  color: #6b7280;

  font-size: 7.4px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-pedido-row__data strong {
  color: #111827;

  font-size: 9.2px;
  font-weight: 860;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logistica-pedido-row__status,
.logistica-pedido-row__actions {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px;

  border-right: 1px solid rgba(17, 24, 39, 0.1);
}

.logistica-pedido-row__actions {
  border-right: 0;
}

.logistica-pedido-row__actions .logistica-btn {
  min-height: 30px;
  height: 30px;
  min-width: 72px;
  padding: 0 10px;
  font-size: 8.4px;
}

html[data-theme="dark"] .logistica-pedido-row {
  border-bottom-color: rgba(255, 255, 255, 0.09);
  background: #0f0f10;
  box-shadow: none;
}

html[data-theme="dark"] .logistica-pedido-row:hover {
  background: #151517;
}

html[data-theme="dark"] .logistica-pedido-row__main,
html[data-theme="dark"] .logistica-pedido-row__data,
html[data-theme="dark"] .logistica-pedido-row__status,
html[data-theme="dark"] .logistica-pedido-row__actions,
html[data-theme="dark"] .logistica-pedido-row__data > div {
  border-color: rgba(255, 255, 255, 0.075);
}

html[data-theme="dark"] .logistica-pedido-row__main strong,
html[data-theme="dark"] .logistica-pedido-row__data strong {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .logistica-pedido-row__main small,
html[data-theme="dark"] .logistica-pedido-row__data span {
  color: rgba(255, 255, 255, 0.48);
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.logistica-modal-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;

  min-height: 180px;
  padding: 18px;

  color: #4b5563;
  text-align: center;
}

.logistica-modal-empty .icon,
.logistica-modal-empty svg {
  width: 30px;
  height: 30px;
  color: #111827;
  stroke: #111827;
  stroke-width: 2.15;
}

.logistica-modal-empty strong {
  color: #111827;

  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.logistica-modal-empty span {
  max-width: 360px;

  color: #4b5563;

  font-size: 8.2px;
  font-weight: 760;
  line-height: 1.35;
}

html[data-theme="dark"] .logistica-modal-empty .icon,
html[data-theme="dark"] .logistica-modal-empty svg {
  color: rgba(255, 255, 255, 0.88);
  stroke: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .logistica-modal-empty strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-modal-empty span {
  color: rgba(255, 255, 255, 0.56);
}

/* =========================================================
   MOBILE LIST
   ========================================================= */

.logistica-mobile-list {
  display: none;
}

.logistica-mobile-empty {
  display: grid;
  gap: 4px;

  padding: 12px;

  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 14px;
  background: #ffffff;
}

.logistica-mobile-empty strong {
  color: #111827;

  font-size: 9px;
  font-weight: 950;
}

.logistica-mobile-empty span {
  color: #4b5563;

  font-size: 7.5px;
  font-weight: 820;
}

.logistica-mobile-empty.is-error strong {
  color: #b91c1c;
}

.logistica-mobile-card {
  display: grid;
  gap: 8px;

  padding: 10px;

  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 14px;
  background: #ffffff;

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.76) inset,
    0 8px 22px rgba(17, 24, 39, 0.045);

  overflow: hidden;

  animation: logisticaMobileCardIn 0.22s ease both;
}

.logistica-mobile-card__head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.logistica-mobile-card__icon {
  display: grid;
  place-items: center;

  width: 32px;
  height: 32px;
  min-width: 32px;

  border: 1px solid #050505;
  border-radius: 10px;
  background: #050505;

  color: #ffffff;
}

.logistica-mobile-card__icon .icon,
.logistica-mobile-card__icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.15;
}

.logistica-mobile-card__head strong {
  display: block;

  color: #111827;

  font-size: 10px;
  font-weight: 950;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistica-mobile-card__head small {
  display: block;
  margin-top: 2px;

  color: #4b5563;

  font-size: 8px;
  font-weight: 820;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistica-mobile-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;

  border: 1px solid rgba(17, 24, 39, 0.11);
  border-radius: 12px;

  overflow: hidden;
}

.logistica-mobile-card__grid div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: center;

  min-height: 34px;
  padding: 8px;

  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
}

.logistica-mobile-card__grid div:last-child {
  border-bottom: 0;
}

.logistica-mobile-card__grid span {
  color: #4b5563;

  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistica-mobile-card__grid strong {
  color: #111827;

  font-size: 9px;
  font-weight: 900;
  text-align: right;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistica-mobile-card footer {
  display: grid;
  grid-template-columns: 1fr;
}

.logistica-mobile-card footer .logistica-btn {
  width: 100%;
}

html[data-theme="dark"] .logistica-mobile-empty,
html[data-theme="dark"] .logistica-mobile-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: #101011;
}

html[data-theme="dark"] .logistica-mobile-empty strong,
html[data-theme="dark"] .logistica-mobile-card__head strong,
html[data-theme="dark"] .logistica-mobile-card__grid strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .logistica-mobile-empty span,
html[data-theme="dark"] .logistica-mobile-card__head small,
html[data-theme="dark"] .logistica-mobile-card__grid span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .logistica-mobile-card__icon {
  border-color: rgba(255, 255, 255, 0.22);
  background: #050505;
  color: #ffffff;
}

html[data-theme="dark"] .logistica-mobile-card__grid {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .logistica-mobile-card__grid div {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

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

.logistica-toast {
  position: fixed;
  right: 14px;
  bottom: 38px;
  z-index: 10000;

  max-width: min(390px, calc(100vw - 28px));
  padding: 11px 13px;

  border: 1px solid rgba(17, 24, 39, 0.13);
  border-radius: 12px;
  background: #ffffff;

  color: #111827;

  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;

  box-shadow:
    0 18px 48px rgba(17, 24, 39, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;

  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);

  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.logistica-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.logistica-toast--error {
  color: #b91c1c;
}

.logistica-toast--success {
  color: #15803d;
}

html[data-theme="dark"] .logistica-toast {
  border-color: rgba(255, 255, 255, 0.12);
  background: #101011;
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .logistica-toast--error {
  color: #fca5a5;
}

html[data-theme="dark"] .logistica-toast--success {
  color: #86efac;
}

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

@media (max-width: 1260px) {
  .logistica-head {
    grid-template-columns: 1fr;
  }

  .logistica-actions {
    justify-content: flex-start;
  }

  .logistica-pedido-row {
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1fr) 96px 86px;
  }
}

@media (max-width: 980px) {
  .logistica-modal-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .logistica-modal-summary article {
    border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  }

  .logistica-modal-summary article:nth-child(3n) {
    border-right: 0;
  }

  .logistica-pedido-row {
    grid-template-columns: 1fr;
  }

  .logistica-pedido-row__main,
  .logistica-pedido-row__data,
  .logistica-pedido-row__status,
  .logistica-pedido-row__actions {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  }

  .logistica-pedido-row__actions {
    border-bottom: 0;
  }

  .logistica-pedido-row__actions .logistica-btn {
    width: 100%;
  }

  html[data-theme="dark"] .logistica-modal-summary article,
  html[data-theme="dark"] .logistica-pedido-row__main,
  html[data-theme="dark"] .logistica-pedido-row__data,
  html[data-theme="dark"] .logistica-pedido-row__status,
  html[data-theme="dark"] .logistica-pedido-row__actions {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 760px) {
  .logistica-page {
    gap: 7px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow-x: hidden;
  }

  .logistica-head,
  .logistica-metrics,
  .logistica-types,
  .logistica-panel {
    border-radius: 14px;
  }

  .logistica-head {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding: 9px;
  }

  .logistica-brand {
    align-items: flex-start;
  }

  .logistica-brand p {
    display: none;
  }

  .logistica-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .logistica-date,
  .logistica-select {
    width: 100%;
  }

  .logistica-date input,
  .logistica-select select,
  .logistica-actions .logistica-btn {
    width: 100%;
    min-width: 0;
    height: 34px;
    min-height: 34px;
  }

  .logistica-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistica-metric {
    min-height: 54px;
    padding: 9px;
    border-right: 1px solid rgba(17, 24, 39, 0.09);
    border-top: 1px solid rgba(17, 24, 39, 0.09);
  }

  .logistica-metric:nth-child(1),
  .logistica-metric:nth-child(2) {
    border-top: 0;
  }

  .logistica-metric:nth-child(2n) {
    border-right: 0;
  }

  html[data-theme="dark"] .logistica-metric {
    border-right-color: rgba(255, 255, 255, 0.09);
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .logistica-types {
    grid-template-columns: 1fr;
  }

  .logistica-type-card {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  }

  .logistica-type-card:last-child {
    border-bottom: 0;
  }

  .logistica-type-card section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistica-type-card section div:nth-child(2n) {
    border-right: 0;
  }

  .logistica-type-card section div:nth-child(n + 3) {
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  html[data-theme="dark"] .logistica-type-card {
    border-bottom-color: rgba(255, 255, 255, 0.11);
  }

  html[data-theme="dark"] .logistica-type-card section div:nth-child(n + 3) {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .logistica-table-wrap {
    display: none;
  }

  .logistica-mobile-list {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .logistica-modal {
    padding: 8px;
    align-items: end;
  }

  .logistica-modal-card {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 20px;

    animation: logisticaMobileModalIn 0.2s ease both;
  }

  .logistica-modal-card--loading {
    height: min(420px, calc(100vh - 16px));
  }

  .logistica-modal-head {
    min-height: auto;
    padding: 10px;
  }

  .logistica-modal-title {
    align-items: flex-start;
  }

  .logistica-modal-title h3 {
    font-size: 14px;
    white-space: normal;
  }

  .logistica-modal-title p {
    display: none;
  }

  .logistica-modal-body {
    padding: 8px;
    gap: 8px;
  }

  .logistica-modal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 14px;
  }

  .logistica-modal-summary article {
    min-height: 58px;
    padding: 9px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.11);
  }

  .logistica-modal-summary article:nth-child(2n) {
    border-right: 0;
  }

  .logistica-modal-summary article:nth-child(3n) {
    border-right: 1px solid rgba(17, 24, 39, 0.11);
  }

  .logistica-modal-summary article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .logistica-modal-summary strong {
    font-size: 15px;
  }

  html[data-theme="dark"] .logistica-modal-summary article {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  html[data-theme="dark"] .logistica-modal-summary article:nth-child(3n) {
    border-right-color: rgba(255, 255, 255, 0.1);
  }

  .logistica-modal-section {
    border-radius: 14px;
  }

  .logistica-modal-section > header {
    align-items: flex-start;
  }

  .logistica-modal-pedidos-list {
    max-height: none;
    overflow: visible;
  }

  .logistica-pedido-row {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .logistica-pedido-row__main {
    padding: 10px;
  }

  .logistica-pedido-row__main strong,
  .logistica-pedido-row__main small {
    white-space: normal;
  }

  .logistica-pedido-row__data {
    grid-template-columns: 1fr;
  }

  .logistica-pedido-row__data > div {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;

    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  }

  .logistica-pedido-row__data > div:last-child {
    border-bottom: 0;
  }

  .logistica-pedido-row__data strong {
    text-align: right;
  }

  .logistica-modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }

  .logistica-modal-footer .logistica-btn {
    width: 100%;
    min-height: 34px;
  }

  .logistica-toast {
    left: 10px;
    right: 10px;
    bottom: 34px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .logistica-head,
  .logistica-metrics,
  .logistica-types,
  .logistica-panel {
    border-radius: 12px;
  }

  .logistica-head {
    padding: 8px;
  }

  .logistica-brand__icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .logistica-brand h2 {
    font-size: 13.5px;
  }

  .logistica-actions {
    grid-template-columns: 1fr;
  }

  .logistica-metrics {
    grid-template-columns: 1fr;
  }

  .logistica-metric {
    border-right: 0;
  }

  .logistica-metric:nth-child(2) {
    border-top: 1px solid rgba(17, 24, 39, 0.09);
  }

  .logistica-type-card section {
    grid-template-columns: 1fr;
  }

  .logistica-type-card section div {
    border-right: 0;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  .logistica-type-card section div:first-child {
    border-top: 0;
  }

  .logistica-mobile-list {
    padding: 7px;
    gap: 7px;
  }

  .logistica-mobile-card {
    padding: 9px;
    border-radius: 13px;
  }

  .logistica-mobile-card__grid div,
  .logistica-pedido-row__data > div {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .logistica-modal-card {
    border-radius: 18px;
  }

  .logistica-modal-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .logistica-modal-summary {
    grid-template-columns: 1fr;
  }

  .logistica-modal-summary article {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(17, 24, 39, 0.11) !important;
  }

  .logistica-modal-summary article:last-child {
    border-bottom: 0 !important;
  }

  html[data-theme="dark"] .logistica-modal-summary article {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

.is-spinning {
  animation: logisticaSpin 0.85s linear infinite;
}

@keyframes logisticaSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes logisticaPageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logisticaMobileCardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logisticaModalBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes logisticaModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logisticaMobileModalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .logistica-page,
  .logistica-page *,
  .logistica-page *::before,
  .logistica-page *::after,
  .logistica-modal,
  .logistica-modal *,
  .logistica-modal *::before,
  .logistica-modal *::after,
  .logistica-toast {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}/* =========================================================
   LOGÍSTICA · MISMO TAMAÑO VISUAL QUE LAS DEMÁS PÁGINAS
   Ajuste fino: no más grande que Etiquetas / Armado
   ========================================================= */

.logistica-page {
  gap: 9px !important;
}

/* Header */
.logistica-head {
  min-height: 60px !important;
  padding: 10px !important;
  gap: 10px !important;
}

.logistica-brand {
  gap: 9px !important;
}

.logistica-brand__icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 11px !important;
}

.logistica-brand__icon .icon,
.logistica-brand__icon svg {
  width: 15.5px !important;
  height: 15.5px !important;
}

.logistica-brand h2 {
  font-size: 15px !important;
}

.logistica-brand p {
  font-size: 9.8px !important;
  line-height: 1.36 !important;
}

/* Filtros header */
.logistica-date span,
.logistica-select span {
  font-size: 7.8px !important;
}

.logistica-date input,
.logistica-select select {
  height: 30px !important;
  min-height: 30px !important;
  min-width: 128px !important;
  padding: 0 9px !important;
  border-radius: 10px !important;
  font-size: 9.4px !important;
}

/* Botones */
.logistica-btn,
.logistica-modal-close {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  font-size: 9.4px !important;
}

.logistica-btn .icon,
.logistica-btn svg,
.logistica-modal-close .icon,
.logistica-modal-close svg {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
}

/* Métricas */
.logistica-metric {
  min-height: 48px !important;
  padding: 9px 10px !important;
  gap: 4px !important;
}

.logistica-metric span {
  font-size: 7.8px !important;
}

.logistica-metric strong {
  font-size: 16px !important;
}

.logistica-metric small {
  font-size: 7.8px !important;
}

/* Resumen Colecta / Flex */
.logistica-type-card {
  gap: 9px !important;
  padding: 10px !important;
}

.logistica-type-card header {
  gap: 9px !important;
}

.logistica-type-card__icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 11px !important;
}

.logistica-type-card__icon .icon,
.logistica-type-card__icon svg {
  width: 15px !important;
  height: 15px !important;
}

.logistica-type-card header strong {
  font-size: 12.5px !important;
}

.logistica-type-card header small {
  font-size: 8.8px !important;
}

.logistica-type-card section div {
  min-height: 44px !important;
  padding: 8px !important;
}

.logistica-type-card section span {
  font-size: 7.6px !important;
}

.logistica-type-card section strong {
  font-size: 13.5px !important;
}

/* Panel */
.logistica-panel-head {
  min-height: 44px !important;
  padding: 9px 10px !important;
}

.logistica-panel-head span {
  font-size: 7.8px !important;
}

.logistica-panel-head strong {
  font-size: 12px !important;
}

/* Tabla principal */
.logistica-table-wrap {
  max-height: calc(100vh - 330px) !important;
  min-height: 340px !important;
}

.logistica-table th {
  height: 32px !important;
  padding: 0 8px !important;
  font-size: 7.8px !important;
}

.logistica-table td {
  height: 48px !important;
  padding: 0 8px !important;
  font-size: 9.6px !important;
}

.logistica-table strong {
  font-size: 10px !important;
}

.logistica-table small {
  font-size: 8px !important;
}

.logistica-pill,
.logistica-status {
  font-size: 9px !important;
}

.logistica-row-actions {
  gap: 5px !important;
}

.logistica-row-actions .logistica-btn {
  min-height: 30px !important;
  height: 30px !important;
  min-width: 68px !important;
  padding: 0 9px !important;
  font-size: 8.8px !important;
}

/* Modal */
.logistica-modal {
  padding: 14px !important;
}

.logistica-modal-card {
  width: min(1120px, calc(100vw - 32px)) !important;
  height: min(740px, calc(100vh - 32px)) !important;
  max-height: calc(100vh - 32px) !important;
  border-radius: 16px !important;
}

.logistica-modal-card--loading {
  width: min(720px, calc(100vw - 32px)) !important;
  height: min(400px, calc(100vh - 32px)) !important;
}

.logistica-modal-head {
  min-height: 54px !important;
  padding: 10px 12px !important;
}

.logistica-modal-title {
  gap: 9px !important;
}

.logistica-modal-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 11px !important;
}

.logistica-modal-icon .icon,
.logistica-modal-icon svg {
  width: 15px !important;
  height: 15px !important;
}

.logistica-modal-title span {
  font-size: 8px !important;
}

.logistica-modal-title h3 {
  margin-top: 3px !important;
  font-size: 14px !important;
}

.logistica-modal-title p {
  margin-top: 4px !important;
  font-size: 8.8px !important;
}

.logistica-modal-close {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  padding: 0 !important;
}

.logistica-modal-body {
  gap: 10px !important;
  padding: 10px !important;
}

.logistica-modal-footer {
  min-height: 48px !important;
  padding: 10px 12px !important;
  gap: 7px !important;
}

/* Resumen modal */
.logistica-modal-summary {
  border-radius: 15px !important;
}

.logistica-modal-summary article {
  min-height: 56px !important;
  padding: 10px !important;
  gap: 4px !important;
}

.logistica-modal-summary span {
  font-size: 7.8px !important;
}

.logistica-modal-summary strong {
  font-size: 16px !important;
}

/* Secciones modal */
.logistica-modal-section {
  border-radius: 15px !important;
}

.logistica-modal-section > header {
  min-height: 46px !important;
  padding: 10px 11px !important;
}

.logistica-modal-section > header span:not(.logistica-status) {
  font-size: 7.8px !important;
}

.logistica-modal-section > header strong {
  font-size: 12px !important;
}

/* Lista pedidos modal */
.logistica-modal-pedidos-list {
  max-height: calc(100vh - 320px) !important;
}

.logistica-pedido-row {
  grid-template-columns: minmax(240px, 1.15fr) minmax(340px, 1.2fr) 100px 90px !important;
  min-height: 56px !important;
}

.logistica-pedido-row__main {
  padding: 9px 11px !important;
  gap: 3px !important;
}

.logistica-pedido-row__main strong {
  font-size: 10px !important;
}

.logistica-pedido-row__main small {
  font-size: 8px !important;
}

.logistica-pedido-row__data > div {
  padding: 8px !important;
  gap: 3px !important;
}

.logistica-pedido-row__data span {
  font-size: 7.6px !important;
}

.logistica-pedido-row__data strong {
  font-size: 9px !important;
}

.logistica-pedido-row__status,
.logistica-pedido-row__actions {
  padding: 8px !important;
}

.logistica-pedido-row__actions .logistica-btn {
  min-height: 30px !important;
  height: 30px !important;
  min-width: 68px !important;
  padding: 0 9px !important;
  font-size: 8.8px !important;
}

/* Empty states */
.logistica-modal-empty {
  min-height: 180px !important;
  padding: 20px !important;
  gap: 8px !important;
}

.logistica-modal-empty .icon,
.logistica-modal-empty svg {
  width: 30px !important;
  height: 30px !important;
}

.logistica-modal-empty strong {
  font-size: 13px !important;
}

.logistica-modal-empty span {
  font-size: 9.4px !important;
}

/* Mobile */
.logistica-mobile-list {
  gap: 9px !important;
  padding: 10px !important;
}

.logistica-mobile-empty {
  padding: 12px !important;
  gap: 5px !important;
}

.logistica-mobile-empty strong {
  font-size: 11px !important;
}

.logistica-mobile-empty span {
  font-size: 9px !important;
}

.logistica-mobile-card {
  gap: 9px !important;
  padding: 10px !important;
  border-radius: 14px !important;
}

.logistica-mobile-card__head {
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  gap: 9px !important;
}

.logistica-mobile-card__icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}

.logistica-mobile-card__icon .icon,
.logistica-mobile-card__icon svg {
  width: 14px !important;
  height: 14px !important;
}

.logistica-mobile-card__head strong {
  font-size: 10px !important;
}

.logistica-mobile-card__head small {
  font-size: 8px !important;
}

.logistica-mobile-card__grid div {
  min-height: 32px !important;
  padding: 8px !important;
  grid-template-columns: 82px minmax(0, 1fr) !important;
}

.logistica-mobile-card__grid span {
  font-size: 7.6px !important;
}

.logistica-mobile-card__grid strong {
  font-size: 9.4px !important;
}

/* Toast */
.logistica-toast {
  padding: 10px 12px !important;
  font-size: 10px !important;
}

/* Responsive */
@media (max-width: 980px) {
  .logistica-pedido-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .logistica-head {
    padding: 9px !important;
  }

  .logistica-brand p {
    display: none !important;
  }

  .logistica-date input,
  .logistica-select select,
  .logistica-actions .logistica-btn {
    height: 32px !important;
    min-height: 32px !important;
  }

  .logistica-metric {
    min-height: 48px !important;
    padding: 9px !important;
  }

  .logistica-type-card section div {
    min-height: 42px !important;
  }

  .logistica-modal-card {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 16px !important;
  }

  .logistica-modal-head {
    padding: 9px !important;
  }

  .logistica-modal-body {
    padding: 9px !important;
    gap: 9px !important;
  }

  .logistica-modal-summary article {
    min-height: 54px !important;
    padding: 9px !important;
  }

  .logistica-modal-summary strong {
    font-size: 15px !important;
  }

  .logistica-pedido-row__main {
    padding: 10px !important;
  }

  .logistica-pedido-row__data > div {
    grid-template-columns: 82px minmax(0, 1fr) !important;
    padding: 8px !important;
  }

  .logistica-modal-footer .logistica-btn {
    min-height: 32px !important;
    height: 32px !important;
  }
}

@media (max-width: 420px) {
  .logistica-brand__icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  .logistica-brand h2 {
    font-size: 14px !important;
  }

  .logistica-mobile-card__grid div,
  .logistica-pedido-row__data > div {
    grid-template-columns: 76px minmax(0, 1fr) !important;
  }

  .logistica-modal-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
}