.historial-index-toggle-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 10px auto 5px;
  padding: 0 1.25rem;
}

.historial-index-toggle-inner {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(242, 242, 247, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* Stack: form e historial comparten la misma celda del grid. Ambas vistas
   mantienen su lugar en el layout, la inactiva queda invisible (no display:none)
   para que la celda siempre tenga la altura de la vista más alta. */
.historial-index-stack {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "stack";
  width: 100%;
}

.historial-index-stack > #andesmarForm-wrapper-index,
.historial-index-stack > #historialEtiquetasSection {
  grid-area: stack;
  width: 100%;
  display: block;
}

.historial-index-stack > .is-inactive-view {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  height: 0;
  overflow: hidden;
  min-height: 0 !important;
}

.historial-index-stack > .is-active-view {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  z-index: 1;
}

.historial-index-toggle-btn {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  color: #1c1c1e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  outline: none;
}

.historial-index-toggle-btn i {
  font-size: 0.95rem;
}

.historial-index-toggle-btn:hover {
  background: rgba(10, 132, 255, 0.08);
  color: #0071e3;
}

.historial-index-toggle-btn.active {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 3px 10px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.historial-index-toggle-btn.active:hover {
  color: #ffffff;
  transform: translateY(-0.5px);
  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Dark mode */
[data-theme="dark"] .historial-index-toggle-inner {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(71, 85, 105, 0.55);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .historial-index-toggle-btn {
  color: #cbd5e1;
}

[data-theme="dark"] .historial-index-toggle-btn:hover {
  background: rgba(125, 166, 255, 0.14);
  color: #ffffff;
}

[data-theme="dark"] .historial-index-toggle-btn.active {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow:
    0 3px 12px rgba(59, 130, 246, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Mobile: pill full-width y botones que se reparten el espacio */
@media (max-width: 576px) {
  .historial-index-toggle-container {
    padding: 0 0.75rem;
  }

  .historial-index-toggle-inner {
    width: 100%;
    max-width: 420px;
  }

  .historial-index-toggle-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
  }

  .historial-index-toggle-btn i {
    font-size: 0.9rem;
  }
}

/* Wrapper principal formulario (andesmarForm) */
#andesmarForm-wrapper-index {
  width: 100%;
  max-width: 1200px;
  min-width: 100px;
  margin: 1.25rem auto 2.5rem;
}

/* Wrapper principal historial */
.historial-index-wrapper {
  width: 100%;
  max-width: 1200px;
  min-width: 100px;
  box-sizing: border-box;
  margin: 1.25rem auto 2.5rem;
}

/* Loading / empty: reserva altura para evitar salto visual */
.historial-index-loading,
.historial-index-cards-grid:empty::before {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  content: "";
}

/* Texto principal */

.historial-index-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.historial-index-badge {
  align-self: flex-start;
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f172a;
  background: linear-gradient(135deg, #e0f2fe, #f5f3ff);
  border: 1px solid rgba(96, 165, 250, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.historial-index-badge i {
  font-size: 0.9rem;
}

.historial-index-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.historial-index-title span.emoji {
  font-size: 1.5rem;
}

.historial-index-subtitle {
  font-size: 0.9rem;
  color: #4b5563;
}

/* ===== Toolbar filtros + búsqueda ===== */

.historial-index-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ===== Filtros de transporte — toggle chips circulares ===== */

.historial-index-filter-transportes {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-left: auto;
}

.historial-index-filter-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.historial-index-filter-pill {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-bottom: 0 !important;
}

/* Reset del logo pill: quitamos cualquier estilo heredado de styles.css */
.historial-index-filter-transportes .historial-index-filter-logo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  color: transparent !important;
  font-size: 0 !important;
  transition:
    transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease !important;
  pointer-events: none;
  position: relative;
  overflow: visible !important;
}

.historial-index-filter-transportes .historial-index-filter-logo > span {
  display: none !important;
}

/* Imagen del logo — círculo de marca con PNG blanco encima */
.historial-index-filter-transportes .historial-index-filter-logo img {
  width: 30px !important;
  height: 30px !important;
  padding: 5px !important;
  border-radius: 999px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  object-fit: contain !important;
  transition:
    filter 0.2s ease,
    opacity 0.2s ease;
  /* OFF: desaturado y tenue */
  filter: saturate(0.25) brightness(0.95);
  opacity: 0.55;
}

/* Hover: se empieza a ver el color */
.historial-index-filter-pill:hover .historial-index-filter-logo {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.9) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08) !important;
}

.historial-index-filter-pill:hover .historial-index-filter-logo img {
  filter: saturate(0.7) brightness(1);
  opacity: 0.85;
}

/* CHECKED: full color */
.historial-index-filter-check:checked + .historial-index-filter-logo img {
  filter: none;
  opacity: 1;
}

/* Anillo del chip según la marca seleccionada */
.historial-index-filter-pill:has(input[value="andreani"]:checked) .historial-index-filter-logo {
  border-color: #dc2626 !important;
  background: #fff !important;
  box-shadow:
    0 0 0 3px rgba(220, 38, 38, 0.18),
    0 4px 12px rgba(220, 38, 38, 0.22) !important;
}

.historial-index-filter-pill:has(input[value="andesmar"]:checked) .historial-index-filter-logo {
  border-color: #2563eb !important;
  background: #fff !important;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.18),
    0 4px 12px rgba(37, 99, 235, 0.22) !important;
}

.historial-index-filter-pill:has(input[value="cds"]:checked) .historial-index-filter-logo {
  border-color: #1e40af !important;
  background: #fff !important;
  box-shadow:
    0 0 0 3px rgba(30, 64, 175, 0.18),
    0 4px 12px rgba(30, 64, 175, 0.25) !important;
}

.historial-index-filter-check:focus-visible + .historial-index-filter-logo {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 3px;
}

/* Click feedback */
.historial-index-filter-pill:active .historial-index-filter-logo {
  transform: translateY(0) scale(0.95);
}

/* Dark mode */
[data-theme="dark"] .historial-index-filter-transportes .historial-index-filter-logo {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(71, 85, 105, 0.7) !important;
}

[data-theme="dark"] .historial-index-filter-pill:has(input[value="andreani"]:checked) .historial-index-filter-logo,
[data-theme="dark"] .historial-index-filter-pill:has(input[value="andesmar"]:checked) .historial-index-filter-logo,
[data-theme="dark"] .historial-index-filter-pill:has(input[value="cds"]:checked) .historial-index-filter-logo {
  background: #1e293b !important;
}

/* Búsqueda */

.historial-index-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex: 1 1 180px;
  max-width: 340px;
  order: -1;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.historial-index-search:focus-within {
  border-color: rgba(96, 165, 250, 0.75);
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.historial-index-search-icon {
  font-size: 0.88rem;
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.historial-index-search:focus-within .historial-index-search-icon {
  color: #3b82f6;
}

.historial-index-search-input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  min-width: 0;
  font-size: 0.875rem;
  color: #0f172a;
  padding: 0;
  margin: 0;
}

.historial-index-search-input::placeholder {
  color: #94a3b8;
}

/* Loading + error */

.historial-index-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  padding: 2.5rem 0;
}

.historial-index-loading img {
  width: 100px;
  object-fit: contain;
  opacity: 0.9;
}

.historial-index-error {
  margin-bottom: 0.75rem;
  color: #b91c1c;
  font-size: 0.85rem;
}

/* ===== Grid de cards (4 en desktop) ===== */

.historial-index-cards-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  min-height: 120px;
}

.historial-index-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
  color: #6b7280;
}

/* 2 columnas en tablet */
@media (min-width: 768px) {
  .historial-index-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 4 columnas en desktop */
@media (min-width: 992px) {
  .historial-index-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== Card individual — iOS / Sonoma ===== */
.historial-index-card {
  position: relative;
  border-radius: 16px;
  padding: 0.95rem 1rem 0.85rem;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 170px;
  overflow: hidden;
  transition:
    transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.2s ease;
  backface-visibility: hidden;
}

.historial-index-card::before {
  content: none;
}

/* Hover iOS: lift sutil + borde azul + shadow soft */
.historial-index-card:hover {
  transform: translateY(-2px);
  cursor: pointer;
  border-color: rgba(147, 197, 253, 0.8);
  box-shadow:
    0 4px 16px rgba(37, 99, 235, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.08);
}

.historial-index-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.95);
  outline: none;
  box-shadow:
    0 4px 16px rgba(37, 99, 235, 0.16),
    0 0 0 3px rgba(147, 197, 253, 0.35);
}

.historial-index-card-header,
.historial-index-card-body {
  position: relative;
  z-index: 1;
}

/* Header de la card */

.historial-index-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.historial-index-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Logo del transporte dentro de la card de historial */
.historial-index-card .cotizacion-logo-pill {
  border-radius: 999px;
  font-size: 0.75rem;
}

.historial-index-envio {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.historial-index-envio-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 600;
}

.historial-index-envio-value {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif !important;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2563eb;
  letter-spacing: -0.01em;
  text-decoration: none !important;
}

.historial-index-envio-link,
.historial-index-envio-link .historial-index-envio-value {
  text-decoration: none !important;
}

.historial-index-envio-link:hover .historial-index-envio-value {
  color: #1d4ed8;
}

.historial-index-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.historial-index-card-date {
  font-size: 0.6rem;
  color: #6b7280;
  text-transform: uppercase;
}

/* Body de la card */

.historial-index-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #111827;
}

.historial-index-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.historial-index-row i {
  font-size: 0.85rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.historial-index-row span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  color: #334155;
}

/* Nombre y dirección en UPPERCASE + ellipsis */

.historial-index-nombre {
  font-weight: 400;
  text-transform: uppercase;
  font-family: "Chakra Petch", sans-serif !important;
  font-size: 0.8rem;
}

.historial-index-direccion {
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bultos */

.historial-index-bultos {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.historial-index-bultos-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.historial-index-bultos-title i {
  font-size: 0.9rem;
}

.historial-index-bulto-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.8);
  border: 1px solid rgba(191, 219, 254, 0.7);
  font-size: 0.76rem;
  font-weight: 500;
  color: #1e40af;
}

.historial-index-bulto-pill-hidden {
  display: none;
}

.historial-index-bultos-toggle {
  border: none;
  background: none;
  padding: 0;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.historial-index-bultos-toggle i {
  font-size: 0.9rem;
}

/* Colores por transporte (para otras parts si las usás) */

.historial-index-card-andreani .historial-index-transport-pill {
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.historial-index-card-andesmar .historial-index-transport-pill {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.historial-index-card-cds .historial-index-transport-pill {
  background: rgba(14, 165, 233, 0.14);
  color: #075985;
}

/* ===== Paginación ===== */

.historial-index-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.2rem;
  gap: 0.75rem;
}

.historial-index-page-info {
  font-size: 0.8rem;
  color: #6b7280;
}

.historial-index-page-buttons {
  display: flex;
  gap: 0.4rem;
}

.historial-index-page-buttons .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

/* ===== Logo pill global (tu snippet) ===== */

/* Base del logo: pill neutro */
.cotizacion-logo-pill img {
  padding: 5px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.5);
}

/* Fondo según la logística (círculo de color atrás del logo) */
.cotizacion-card-andreani .cotizacion-logo-pill img {
  background: radial-gradient(
    circle at 30% 20%,
    #f97373,
    #b91c1c
  ); /* rojo Andreani fuerte */
}

.cotizacion-card-andesmar .cotizacion-logo-pill img {
  background: radial-gradient(
    circle at 30% 20%,
    #60a5fa,
    #1d4ed8
  ); /* azul Andesmar fuerte */
}

.cotizacion-card-oca .cotizacion-logo-pill img {
  background: radial-gradient(
    circle at 30% 20%,
    #a855f7,
    #4c1d95
  ); /* violeta OCA fuerte */
}

.cotizacion-card-cruz .cotizacion-logo-pill img {
  background: radial-gradient(
    circle at 30% 20%,
    #1e40af,
    #0c1e5e
  ); /* azul oscuro Cruz del Sur */
}

/* Mismo fondo para las cards de HISTORIAL según transporte */
.historial-index-card-andreani .cotizacion-logo-pill img {
  background: radial-gradient(circle at 30% 20%, #f97373, #b91c1c);
}

.historial-index-card-andesmar .cotizacion-logo-pill img {
  background: radial-gradient(circle at 30% 20%, #60a5fa, #1d4ed8);
}

.historial-index-card-cds .cotizacion-logo-pill img {
  background: radial-gradient(circle at 30% 20%, #1e40af, #0c1e5e);
}

/* ===== Responsive extra ===== */

@media (max-width: 576px) {
  .historial-index-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .historial-index-search {
    flex: 0 0 auto;
    max-width: none;
  }
}

/* Colores de fondo para los circulitos de los FILTROS de transporte */
.historial-index-filter-pill
  input[value="andreani"]
  + .historial-index-filter-logo
  img {
  background: radial-gradient(
    circle at 30% 20%,
    #f97373,
    #b91c1c
  ); /* rojo Andreani fuerte */
}

.historial-index-filter-pill
  input[value="andesmar"]
  + .historial-index-filter-logo
  img {
  background: radial-gradient(
    circle at 30% 20%,
    #60a5fa,
    #1d4ed8
  ); /* azul Andesmar fuerte */
}

.historial-index-filter-pill
  input[value="cds"]
  + .historial-index-filter-logo
  img {
  background: radial-gradient(
    circle at 30% 20%,
    #1e40af,
    #0c1e5e
  ); /* azul oscuro Cruz del Sur */
}

/* Nombre / localidad / dirección: una sola fila + ellipsis */

.historial-index-nombre,
.historial-index-localidad,
.historial-index-direccion {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nombre iOS: Semibold, sin uppercase ruidoso */
.historial-index-nombre {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    sans-serif !important;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #0f172a;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding-bottom: 0.4rem;
  margin-bottom: 0.1rem;
}

.historial-index-localidad {
  font-size: 0.78rem;
  color: #475569;
  text-transform: none;
  letter-spacing: 0;
}

.historial-index-direccion {
  font-size: 0.78rem;
  text-transform: none;
  color: #475569;
  letter-spacing: 0;
}

/* Por si no tenés definida .hidden en tu CSS global */
.hidden {
  display: none !important;
}

.historial-index-card-footer {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  justify-content: flex-start;
}

.historial-index-envio {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.historial-index-envio-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.historial-index-envio-link .historial-index-envio-value {
  cursor: pointer;
}

.historial-index-copy-btn {
  border: none;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 5px;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

.historial-index-copy-btn i {
  font-size: 0.85rem;
}

/* MODAL TRACKING */
.andreani-modal-overlay-ios {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.andreani-modal-open-ios {
  overflow: hidden;
}

.andreani-modal-ios {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: 80vh;
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Roboto",
    sans-serif;
}

.andreani-modal-header-ios {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem 1.2rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.98),
    rgba(226, 232, 240, 0.98)
  );
}

.andreani-modal-title-group-ios {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.andreani-modal-title-ios {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.andreani-modal-logo-ios {
  padding: 2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background-color: red;
}

.andreani-modal-subtitle-ios {
  margin: 0;
  font-size: 0.8rem;
  color: #4b5563;
}

.andreani-modal-subtitle-ios .andreani-modal-tracking-ios {
  font-weight: 600;
  color: #111827;
}

.andreani-modal-close-ios {
  border: none;
  background: transparent;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: #6b7280;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.andreani-modal-close-ios:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #111827;
}

.andreani-modal-body-ios {
  padding: 0.85rem 1.2rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.andreani-modal-panel-ios {
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Panel de datos del envío (primer módulo) */
.andreani-info-main-ios {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.andreani-info-status-ios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.andreani-status-pill-ios {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.09);
  color: #166534;
  border: 1px solid rgba(74, 222, 128, 0.8);
}

.andreani-status-date-ios {
  font-size: 0.75rem;
  color: #6b7280;
}

.andreani-info-destinatario-ios {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.andreani-info-line-ios {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.andreani-info-label-ios {
  min-width: 90px;
  font-weight: 600;
  color: #4b5563;
}

/* TODOS LOS DATOS DEL PRIMER MÓDULO EN UPPERCASE */
.andreani-info-value-ios,
.andreani-status-pill-ios,
.andreani-status-date-ios {
  color: #111827;
  font-weight: 600;
  text-transform: uppercase;
}

.andreani-info-extra-ios {
  margin-top: 0.25rem;
}

.andreani-info-grid-ios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.andreani-info-chip-ios {
  border-radius: 5px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.andreani-info-chip-label-ios {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  font-size: 0.65rem;
  color: #6b7280;
}

.andreani-info-chip-value-ios {
  font-weight: 500;
  color: #111827;
}

/* Título timeline */
.andreani-tl-title-ios {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

/* CONTENEDOR TIMELINE */
.andreani-tl-ios {
  position: relative;
  padding-left: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Cada item: marcador + contenido */
.andreani-tl-item-ios {
  display: flex;
  align-items: stretch; /* estira el marcador al alto del contenido */
  gap: 0.55rem;
}

/* Columna del marcador (dot + línea) */
.andreani-tl-marker-ios {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.15rem;
  width: 18px;
}

/* Punto (dot) */
.andreani-tl-dot-ios {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 2px solid #cbd5f5;
}

/* Dot ACTIVO (último movimiento) – verde + LATIDO */
.andreani-tl-marker-active-ios .andreani-tl-dot-ios {
  background: #22c55e;
  border-color: #16a34a;
  animation: andreani-dot-pulse-ios 1.4s ease-out infinite;
}

/* Línea vertical que une los puntos */
.andreani-tl-line-ios {
  flex: 1;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(148, 163, 184, 0.9),
    rgba(148, 163, 184, 0.25)
  );
  margin-top: 2px;
}

/* Contenido de cada evento */
.andreani-tl-content-ios {
  width: 100%;
  padding-bottom: 0.4rem;
  border-radius: 12px;
  padding: 0.4rem 0.6rem 0.35rem;
  background: rgba(248, 250, 252, 0.9);
}

/* Header del evento (más compacto) */
.andreani-tl-header-row-ios {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.andreani-tl-estado-ios {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
}

.andreani-tl-fecha-ios {
  font-size: 0.72rem;
  color: #6b7280;
}

.andreani-tl-traduccion-ios {
  margin: 0;
  font-size: 0.78rem;
  color: #374151;
}

.andreani-tl-meta-row-ios {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.andreani-tl-chip-ios {
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.7rem;
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
}

.andreani-tl-empty-ios {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Footer y estados de carga / error */

.andreani-modal-footer-ios {
  padding: 0.5rem 1.2rem 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(248, 250, 252, 0.96);
}

.andreani-modal-error-ios {
  font-size: 0.78rem;
  color: #b91c1c;
}

.andreani-modal-loading-layer-ios {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  background:
    radial-gradient(circle at 10% 0, rgba(129, 140, 248, 0.1), transparent 55%),
    radial-gradient(
      circle at 90% 100%,
      rgba(45, 212, 191, 0.1),
      transparent 55%
    ),
    rgba(248, 250, 252, 0.92);
}

.andreani-modal-loading-spinner-ios {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.45);
  border-top-color: #2563eb;
  animation: andreani-spin-ios 0.7s linear infinite;
}

.andreani-modal-loading-layer-ios span {
  font-size: 0.8rem;
  color: #4b5563;
}

@keyframes andreani-spin-ios {
  to {
    transform: rotate(360deg);
  }
}

/* LATIDO DEL PUNTO ACTIVO */
@keyframes andreani-dot-pulse-ios {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.historial-index-card-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
}

/* Botones iOS en el footer de la card */
.historial-index-etiqueta-btn,
.historial-index-track-btn {
  border-radius: 25px !important;
  padding: 0.4rem 0.8rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.01em;
  transition:
    transform 0.1s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease !important;
}

.historial-index-etiqueta-btn strong {
  font-weight: 700;
}

.historial-index-etiqueta-btn.btn-primary {
  color: #fff !important;
  height: 35px !important;
}

.historial-index-etiqueta-btn.btn-danger {
  color: #fff !important;
  height: 35px !important;
}

.historial-index-etiqueta-btn.btn-dark-blue {
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%) !important;
  color: #fff !important;
}

.historial-index-etiqueta-btn:hover {
  background-color: #111827 !important;
  color: #fff !important;
}

.historial-index-track-btn,
.historial-index-track-btn.btn-secondary {
  background: rgba(241, 245, 249, 0.95) !important;
  color: #334155 !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.historial-index-track-btn:hover,
.historial-index-track-btn.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  transform: translateY(-1px);
}

.historial-index-track-btn i,
.historial-index-etiqueta-btn i {
  font-size: 0.85rem;
}

.historial-index-etiqueta-btn img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Responsive modal */

@media (max-width: 768px) {
  .andreani-modal-ios {
    max-width: 100%;
    margin: 0 0.75rem;
  }
}

/* Selector de localidad / CP dentro de Acciones */
.andreani-actions-localidad-wrapper-ios {
  position: relative;
}

.andreani-actions-localidad-list-ios {
  position: absolute;
  z-index: 50;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 4px;
}

.andreani-localidad-item-ios {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.andreani-localidad-item-ios:hover {
  background: rgba(239, 246, 255, 0.9);
}

.andreani-localidad-main-ios {
  display: flex;
  flex-direction: column;
}

.andreani-localidad-name-ios {
  font-weight: 600;
  color: #0f172a;
}

.andreani-localidad-cp-ios {
  font-size: 0.72rem;
  color: #4b5563;
}

.andreani-localidad-prov-ios {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.9);
  color: #1d4ed8;
}

.andreani-actions-buttons-bar-ios {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 10px;
}

.andreani-actions-buttons-bar-ios .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.andreani-accion-loading-layer-ios {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.andreani-accion-loading-layer-ios img {
  width: 150px;
  height: auto;
}

/* Estado de mensajes en el formulario de cambio de domicilio */
.andreani-actions-status-ios {
  font-size: 0.8rem;
  min-height: 1.2rem;
  margin-right: auto;
}

.andreani-accion-status-error {
  color: #b91c1c;
}

.andreani-accion-status-ok {
  color: #166534;
}

/* Overlay de acciones (cambio domicilio / baja etiqueta) */
.andreani-modal-ios.andreani-modal-blur-accion .andreani-modal-header-ios,
.andreani-modal-ios.andreani-modal-blur-accion .andreani-modal-body-ios,
.andreani-modal-ios.andreani-modal-blur-accion .andreani-modal-footer-ios {
  filter: blur(3px);
  pointer-events: none;
}

.andreani-accion-overlay-ios {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(248, 250, 252, 0.6);
  z-index: 20;
}

.andreani-accion-overlay-img-ios {
  width: 120px;
  height: auto;
  margin-bottom: 0.4rem;
}

.andreani-accion-overlay-text-ios {
  font-size: 0.85rem;
  color: #374151;
}

/* Estado de mensajes en la sección de acciones */
.andreani-actions-status-ios {
  font-size: 0.8rem;
  min-height: 1.2rem;
}

.andreani-localidad-item-ios {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.andreani-localidad-item-ios:hover {
  background: rgba(239, 246, 255, 0.9);
}

.andreani-localidad-name-ios {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
}

.andreani-localidad-cp-ios {
  font-size: 0.75rem;
  color: #4b5563;
  margin-left: 0.4rem;
}

.andreani-localidad-prov-ios {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  color: #475569;
}
/* FIN MODAL TRACKING */
